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

# Update Loyalty Rule Chain

> Update a loyalty rule chain



## OpenAPI

````yaml /api-reference/openapi.documented.json post /api/loyalty/rule_chains/{loyaltyRuleChainId}
openapi: 3.0.2
info:
  title: Snag Solutions - API Docs
  description: >-
    Documentation for Loyalty & Socials APIs. Some endpoints require an API key
    to authenticate. To obtain a key, reach out to the Snag Solutions team at
    support@snagsolutions.io.
  version: '0.1'
servers:
  - url: https://admin.snagsolutions.io/
    description: Production
security: []
paths:
  /api/loyalty/rule_chains/{loyaltyRuleChainId}:
    post:
      tags:
        - Loyalty
      summary: Update Loyalty Rule Chain
      description: Update a loyalty rule chain
      parameters:
        - name: loyaltyRuleChainId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: organizationId
          in: query
          required: true
          schema:
            type: string
            format: uuid
        - name: websiteId
          in: query
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                loyaltyRuleId:
                  type: string
                  format: uuid
                  title: Loyalty Rule ID
                  description: Unique identifier for the loyalty rule
                  example: 123e4567-e89b-12d3-a456-426614174111
                operatorType:
                  default: AND
                  type: string
                  enum:
                    - AND
                    - OR
                  title: Condition Type
                  description: >-
                    Type of the condition. AND if all conditions must be met, OR
                    if any condition can be met.
                  example: AND
                loyaltyConditions:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - rule
                          - rules
                          - points
                          - badge
                          - badges
                        title: Rule Type
                        description: The type of rule
                        example: rule
                      description:
                        type: string
                        nullable: true
                        title: Rule Description
                        description: The description of the rule
                        example: Example description
                      amount:
                        type: number
                        nullable: true
                        title: Amount
                        description: The amount of the rule
                        example: 10
                      repeatCount:
                        type: number
                        nullable: true
                        title: Repeat Count
                        description: >-
                          The number of times the rule should be repeated to
                          fulfill the condition
                        example: 1
                      requiredCount:
                        type: number
                        nullable: true
                        title: Required Count
                        description: >-
                          The number of rules that need to be fulfilled to
                          satisfy the condition
                        example: 1
                      loyaltyRuleChainId:
                        type: string
                        format: uuid
                        nullable: true
                        title: Loyalty Rule Chain ID
                        description: >-
                          UUID of the loyalty rule chain (optional, converted to
                          lowercase)
                        example: 123e4567-e89b-12d3-a456-426614174333
                      loyaltyRuleIds:
                        type: array
                        items:
                          type: string
                          format: uuid
                        title: Loyalty Rule IDs
                        description: >-
                          Array of UUIDs of the rules (optional, converted to
                          lowercase)
                        example:
                          - 123e4567-e89b-12d3-a456-426614174111
                      loyaltyRuleGroupIds:
                        type: array
                        items:
                          type: string
                          format: uuid
                        title: Rule Group IDs
                        description: >-
                          Array of UUIDs of the rule group (optional, converted
                          to lowercase)
                        example:
                          - 123e4567-e89b-12d3-a456-426614174222
                      loyaltyLeaderboardViewIds:
                        type: array
                        items:
                          type: string
                          format: uuid
                        title: Loyalty Leaderboard View IDs
                        description: >-
                          Array of UUIDs of the Loyalty Leaderboard (optional,
                          converted to lowercase)
                        example:
                          - 123e4567-e89b-12d3-a456-426614174222
                      loyaltyCurrencyIds:
                        type: array
                        items:
                          type: string
                          format: uuid
                        title: Currency IDs
                        description: >-
                          Array of UUIDs of the currency (optional, converted to
                          lowercase)
                        example:
                          - 123e4567-e89b-12d3-a456-426614174333
                      loyaltyBadgeIds:
                        type: array
                        items:
                          type: string
                          format: uuid
                        title: Badge IDs
                        description: >-
                          Array of UUIDs of the badge (optional, converted to
                          lowercase)
                        example:
                          - 123e4567-e89b-12d3-a456-426614174333
                      csvUrl:
                        type: string
                        format: uri
                        nullable: true
                        title: CSV URL
                        description: URL of the CSV file (optional)
                        example: https://example.com/csv
                  minItems: 1
                  title: Conditions
                  description: Array of conditions for the rule chain
                  example:
                    - type: rule
                      loyaltyRuleId: 123e4567-e89b-12d3-a456-426614174111
              required:
                - name
                - loyaltyRuleId
                - loyaltyConditions
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties: {}
                required:
                  - data
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Forbidden, Could not validate api key
                required:
                  - message
                title: Forbidden Response
                description: Schema for forbidden response
                example: Forbidden, Could not validate api key
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````