> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fanfare.io/llms.txt
> Use this file to discover all available pages before exploring further.

# PUT /audiences/loyalty-tiers/{groupId}

> Update loyalty tier audiences in a group



## OpenAPI

````yaml /api/openapi/admin-api.json put /audiences/loyalty-tiers/{groupId}
openapi: 3.1.0
info:
  description: Admin API for Fanfare
  title: Fanfare Admin API
  version: 1.0.0
servers:
  - description: Production
    url: https://admin.fanfare.io/api
  - description: Local development
    url: http://localhost:4800
security:
  - SecretKeyAuth: []
paths:
  /audiences/loyalty-tiers/{groupId}:
    put:
      tags:
        - Audiences
      description: Update loyalty tier audiences in a group
      operationId: putAudiencesLoyaltyTiersByGroupId
      parameters:
        - in: path
          name: groupId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                attribute:
                  enum:
                    - loyaltyBalance
                    - loyaltyLifetimePoints
                    - ltv
                    - totalOrders
                    - aov
                    - activityScore
                    - purchaseFrequencyScore
                    - monetaryScore
                  type: string
                groupName:
                  type: string
                tiers:
                  items:
                    properties:
                      endValue:
                        nullable: true
                        oneOf:
                          - type: number
                          - type: string
                      iconName:
                        nullable: true
                        type: string
                      name:
                        type: string
                      order:
                        type: number
                      startValue:
                        oneOf:
                          - type: number
                          - type: string
                    required:
                      - name
                      - startValue
                      - order
                    type: object
                  type: array
              required:
                - groupName
                - attribute
                - tiers
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  audiences:
                    items:
                      properties:
                        archived:
                          type: boolean
                        createdAt:
                          format: date-time
                          type: string
                        createdBy:
                          type: string
                        description:
                          anyOf:
                            - type: string
                            - type: 'null'
                        groupId:
                          anyOf:
                            - format: uuid
                              type: string
                            - type: 'null'
                        groupName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        groupType:
                          anyOf:
                            - enum:
                                - SEGMENTED_VALUE
                                - RFM
                            - type: 'null'
                        iconName:
                          anyOf:
                            - type: string
                            - type: 'null'
                        id:
                          format: uuid
                          type: string
                        imports:
                          items:
                            properties:
                              archived:
                                type: boolean
                              audienceId:
                                format: uuid
                                type: string
                              createdAt:
                                format: date-time
                                type: string
                              createdBy:
                                type: string
                              errorCount:
                                type: number
                              errors:
                                anyOf:
                                  - items:
                                      properties:
                                        issues:
                                          items: {}
                                          type: array
                                        row:
                                          type: number
                                      required:
                                        - row
                                        - issues
                                      type: object
                                    type: array
                                  - type: 'null'
                              id:
                                format: uuid
                                type: string
                              organizationId:
                                format: uuid
                                type: string
                              processedConsumers:
                                type: number
                              progress:
                                type: number
                              s3Key:
                                type: string
                              status:
                                enum:
                                  - PENDING
                                  - PROCESSING
                                  - COMPLETED
                                  - FAILED
                              totalConsumers:
                                anyOf:
                                  - type: number
                                  - type: 'null'
                              updatedAt:
                                anyOf:
                                  - format: date-time
                                    type: string
                                  - type: 'null'
                              updatedBy:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - id
                              - organizationId
                              - createdAt
                              - createdBy
                              - archived
                              - audienceId
                              - status
                              - progress
                              - processedConsumers
                              - errorCount
                              - s3Key
                            type: object
                          type: array
                        lastRefreshedAt:
                          anyOf:
                            - format: date-time
                              type: string
                            - type: 'null'
                        metadata:
                          anyOf:
                            - additionalProperties: {}
                              propertyNames:
                                type: string
                              type: object
                            - type: 'null'
                        name:
                          minLength: 1
                          type: string
                        organizationId:
                          format: uuid
                          type: string
                        primaryExternalId:
                          anyOf:
                            - type: string
                            - type: 'null'
                        primaryLastSyncedAt:
                          anyOf:
                            - format: date-time
                              type: string
                            - type: 'null'
                        primarySourceVendor:
                          anyOf:
                            - type: string
                            - type: 'null'
                        primarySyncSource:
                          anyOf:
                            - properties:
                                archived:
                                  type: boolean
                                createdAt:
                                  format: date-time
                                  type: string
                                createdBy:
                                  type: string
                                id:
                                  format: uuid
                                  type: string
                                lastSyncedAt:
                                  anyOf:
                                    - format: date-time
                                      type: string
                                    - type: 'null'
                                organizationId:
                                  format: uuid
                                  type: string
                                sourceData:
                                  anyOf:
                                    - additionalProperties: {}
                                      propertyNames:
                                        type: string
                                      type: object
                                    - type: 'null'
                                syncSource:
                                  type: string
                                syncSourceId:
                                  type: string
                                syncStatus:
                                  anyOf:
                                    - enum:
                                        - PENDING
                                        - SUCCESS
                                        - FAILED
                                    - type: 'null'
                                  default: PENDING
                                updatedAt:
                                  anyOf:
                                    - format: date-time
                                      type: string
                                    - type: 'null'
                                updatedBy:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                              required:
                                - id
                                - organizationId
                                - createdAt
                                - createdBy
                                - archived
                                - syncSource
                                - syncSourceId
                              type: object
                            - type: 'null'
                        primarySyncSourceId:
                          anyOf:
                            - type: string
                            - type: 'null'
                        refreshIntervalSeconds:
                          anyOf:
                            - type: number
                            - type: 'null'
                        rules:
                          items:
                            properties:
                              audienceId:
                                format: uuid
                                type: string
                              field:
                                type: string
                              groupId:
                                anyOf:
                                  - format: uuid
                                    type: string
                                  - type: 'null'
                              id:
                                format: uuid
                                type: string
                              operator:
                                enum:
                                  - EQUALS
                                  - NOT_EQUALS
                                  - GREATER_THAN
                                  - GREATER_THAN_OR_EQUAL
                                  - LESS_THAN
                                  - LESS_THAN_OR_EQUAL
                                  - BETWEEN
                                  - CONTAINS
                                  - NOT_CONTAINS
                                  - IN
                                  - NOT_IN
                                  - EXISTS
                                  - NOT_EXISTS
                              organizationId:
                                format: uuid
                                type: string
                              position:
                                anyOf:
                                  - type: number
                                  - type: 'null'
                                default: 0
                              values:
                                items:
                                  anyOf:
                                    - type: string
                                    - type: number
                                    - type: boolean
                                    - type: 'null'
                                type: array
                            required:
                              - id
                              - organizationId
                              - audienceId
                              - field
                              - operator
                              - values
                            type: object
                          type: array
                        type:
                          enum:
                            - DYNAMIC
                            - STATIC_LIST
                            - SYNCED_LIST
                        updatedAt:
                          anyOf:
                            - format: date-time
                              type: string
                            - type: 'null'
                        updatedBy:
                          anyOf:
                            - type: string
                            - type: 'null'
                      required:
                        - id
                        - organizationId
                        - createdAt
                        - createdBy
                        - archived
                        - name
                        - type
                        - rules
                        - imports
                      type: object
                    type: array
                  tierGroup:
                    type: string
                required:
                  - tierGroup
                  - audiences
                type: object
          description: Loyalty tier audiences updated successfully
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    const: validation_error
                  issues:
                    items:
                      properties:
                        expected:
                          type: string
                        kind:
                          type: string
                        message:
                          type: string
                        path:
                          items:
                            properties:
                              input: {}
                              key:
                                type: string
                              origin:
                                type: string
                              type:
                                type: string
                            required:
                              - type
                              - origin
                              - input
                              - key
                            type: object
                          type: array
                        received:
                          type: string
                        type:
                          type: string
                      required:
                        - kind
                        - type
                        - expected
                        - received
                        - message
                        - path
                      type: object
                    type: array
                required:
                  - error
                  - issues
                type: object
          description: Bad Request - Invalid input schema
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Unauthorized - Authentication required
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Forbidden - User must be authenticated
        '500':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Internal server error
components:
  securitySchemes:
    SecretKeyAuth:
      description: Fanfare secret key. Keep secret credentials on your server.
      scheme: bearer
      type: http

````