> ## 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.

# Get Loyalty Rule Chains

> Retrieve configured loyalty rule chains



## OpenAPI

````yaml /api-reference/openapi.documented.json get /api/loyalty/rule_chains
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:
    get:
      tags:
        - Loyalty
      summary: Get Loyalty Rule Chains
      description: Retrieve configured loyalty rule chains
      parameters:
        - name: organizationId
          in: query
          description: Unique identifier for the organization
          required: true
          schema:
            type: string
            format: uuid
            title: Organization ID
            example: 123e4567-e89b-12d3-a456-426614174001
        - name: websiteId
          in: query
          description: Unique identifier for the website
          required: true
          schema:
            type: string
            format: uuid
            title: Website ID
            example: 123e4567-e89b-12d3-a456-426614174002
        - name: limit
          in: query
          description: Number of rule chains to return
          schema:
            default: 10
            type: number
            minimum: 1
            maximum: 100
            title: Limit
            example: 10
        - name: startingAfter
          in: query
          description: Starting after the given rule chain ID
          schema:
            type: string
            format: uuid
            title: Starting After
            example: 123e4567-e89b-12d3-a456-426614174002
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          title: ID
                          description: Unique identifier for the rule chain
                          example: 123e4567-e89b-12d3-a456-426614174001
                        name:
                          type: string
                          title: Name
                          description: Name of the rule chain
                          example: My Rule Chain
                        loyaltyRuleId:
                          type: string
                          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: Operator Type
                          description: >-
                            Type of the operator. AND if all conditions must be
                            met, OR if any condition can be met.
                          example: AND
                        loyaltyConditions:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                                title: ID
                                description: Unique identifier for the condition
                                example: 123e4567-e89b-12d3-a456-426614174001
                              type:
                                type: string
                                enum:
                                  - rule
                                  - rules
                                  - points
                                  - section
                                  - level
                                  - api
                                  - badge
                                  - badges
                                  - csv
                                title: Type
                                description: Type of the condition
                                example: rule
                              description:
                                type: string
                                nullable: true
                                title: Description
                                description: Description of the condition
                                example: My Condition
                              amount:
                                type: number
                                nullable: true
                                title: Amount
                                description: Amount of the condition
                                example: 100
                              repeatCount:
                                type: number
                                nullable: true
                                title: Repeat Count
                                description: Number of times the condition must be met
                                example: 1
                              requiredCount:
                                type: number
                                nullable: true
                                title: Required Count
                                description: Number of times the condition must be met
                                example: 1
                              csvUrl:
                                type: string
                                format: uri
                                nullable: true
                                title: CSV URL
                                description: URL of the CSV file
                                example: https://example.com/csv
                              association:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                      title: ID
                                      description: Unique identifier for the association
                                      example: 123e4567-e89b-12d3-a456-426614174001
                                    loyaltyRuleGroupId:
                                      type: string
                                      nullable: true
                                      title: Loyalty Rule Group ID
                                      description: >-
                                        Unique identifier for the loyalty rule
                                        group
                                      example: 123e4567-e89b-12d3-a456-426614174001
                                    loyaltyRuleId:
                                      type: string
                                      nullable: true
                                      title: Loyalty Rule ID
                                      description: Unique identifier for the loyalty rule
                                      example: 123e4567-e89b-12d3-a456-426614174111
                                    loyaltyCurrencyId:
                                      type: string
                                      nullable: true
                                      title: Loyalty Currency ID
                                      description: >-
                                        Unique identifier for the loyalty
                                        currency
                                      example: 123e4567-e89b-12d3-a456-426614174001
                                    loyaltyBadgeId:
                                      type: string
                                      nullable: true
                                      title: Loyalty Badge ID
                                      description: Unique identifier for the loyalty badge
                                      example: 123e4567-e89b-12d3-a456-426614174001
                                    loyaltyRule:
                                      type: object
                                      properties:
                                        name:
                                          type: string
                                          title: Name
                                          description: Name of the loyalty rule
                                          example: My Loyalty Rule
                                      required:
                                        - name
                                      nullable: true
                                    loyaltyCurrency:
                                      type: object
                                      properties:
                                        name:
                                          type: string
                                          title: Name
                                          description: Name of the loyalty currency
                                          example: My Loyalty Currency
                                      required:
                                        - name
                                      nullable: true
                                  required:
                                    - id
                                    - loyaltyRuleGroupId
                                    - loyaltyRuleId
                                    - loyaltyCurrencyId
                                    - loyaltyBadgeId
                                    - loyaltyRule
                                    - loyaltyCurrency
                            required:
                              - id
                              - type
                              - description
                              - amount
                              - repeatCount
                              - requiredCount
                              - csvUrl
                              - association
                      required:
                        - id
                        - name
                        - loyaltyRuleId
                        - loyaltyConditions
                  hasNextPage:
                    type: boolean
                required:
                  - data
                  - hasNextPage
        '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

````