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

> Get loyalty accounts



## OpenAPI

````yaml /api-reference/openapi.documented.json get /api/loyalty/accounts
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/accounts:
    get:
      tags:
        - Loyalty
      summary: Get loyalty accounts
      description: Get loyalty accounts
      parameters:
        - name: organizationId
          in: query
          description: Unique identifier for the organization to filter by
          schema:
            type: string
            format: uuid
            title: Organization ID
            example: 123e4567-e89b-12d3-a456-426614174001
        - name: websiteId
          in: query
          description: Unique identifier for the website to filter by
          schema:
            type: string
            format: uuid
            title: Website ID
            example: 123e4567-e89b-12d3-a456-426614174002
        - name: startingAfter
          in: query
          description: Pagination cursor to start after a specific account ID
          schema:
            type: string
            format: uuid
            title: Starting After
            example: 123e4567-e89b-12d3-a456-426614174100
        - name: limit
          in: query
          description: Maximum number of accounts to return
          schema:
            type: integer
            minimum: 1
            maximum: 100
            title: Limit
            example: 20
        - name: walletAddress
          in: query
          description: Wallet address(es) to filter accounts by
          schema:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
                minItems: 1
            title: Wallet Address
            example:
              - '0x1234567890abcdef1234567890abcdef12345678'
        - name: userId
          in: query
          description: >-
            User ID(s) to filter accounts by.  Pass in null to get a currencys
            main accounts.
          schema:
            oneOf:
              - type: string
                format: uuid
              - type: string
                enum:
                  - 'null'
              - type: array
                items:
                  type: string
                  format: uuid
                minItems: 1
            title: User ID
            example:
              - 123e4567-e89b-12d3-a456-426614174000
        - name: walletGroupIdentifier
          in: query
          description: Wallet group identifier to filter accounts by
          schema:
            type: string
            title: Wallet Group Identifier
            example: group123
        - name: sortDir
          in: query
          description: >-
            Order the accounts in ascending or descending order, sorted by
            amount
          schema:
            default: desc
            type: string
            enum:
              - asc
              - desc
            title: Sort Direction
            example: desc
        - name: loyaltyCurrencyId
          in: query
          description: Unique identifier for the loyalty currency
          schema:
            type: string
            format: uuid
            title: Loyalty Currency ID
            example: 123e4567-e89b-12d3-a456-426614174090
        - name: userGroupExternalIdentifier
          in: query
          description: External identifier for the user group controlled by you
          schema:
            type: string
            format: uuid
            title: User Group External Identifier
        - name: userGroupId
          in: query
          description: Unique identifier for the user group
          schema:
            type: string
            format: uuid
            title: User Group ID
            example: 123e4567-e89b-12d3-a456-426614174090
        - name: externalIdentifier
          in: query
          description: External identifier for the user
          schema:
            type: string
            title: External Identifier
            example: 123e4567-e89b-12d3-a456-426614174090
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          title: Loyalty Account ID
                          description: Unique identifier for the loyalty account
                          example: 123e4567-e89b-12d3-a456-426614174050
                        amount:
                          nullable: true
                          title: Amount
                          description: Balance amount in the loyalty account
                          example: 1500
                        loyaltyCurrencyId:
                          type: string
                          format: uuid
                          title: Loyalty Currency ID
                          description: Unique identifier for the loyalty currency
                          example: 123e4567-e89b-12d3-a456-426614174090
                        userId:
                          type: string
                          format: uuid
                          nullable: true
                          title: User ID
                          description: Unique identifier for the user
                          example: 123e4567-e89b-12d3-a456-426614174000
                        user:
                          oneOf:
                            - type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                  title: User ID
                                  description: Unique identifier for the user
                                  example: 123e4567-e89b-12d3-a456-426614174000
                                walletAddress:
                                  type: string
                                  nullable: true
                                  title: Wallet Address
                                  description: Ethereum wallet address of the user
                                  example: '0x1234567890abcdef1234567890abcdef12345678'
                                userMetadata:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      walletGroupIdentifier:
                                        type: string
                                        nullable: true
                                        title: Wallet Group Identifier
                                        description: Identifier for the wallet group
                                        example: group123
                                      twitterUser:
                                        type: string
                                        nullable: true
                                        title: Twitter User
                                        description: >-
                                          Twitter username associated with the
                                          user
                                        example: '@user123'
                                      discordUser:
                                        type: string
                                        nullable: true
                                        title: Discord User
                                        description: >-
                                          Discord username associated with the
                                          user
                                        example: user123#4567
                                      logoUrl:
                                        type: string
                                        nullable: true
                                        title: Logo URL
                                        description: URL of the user's logo
                                        example: https://example.com/logo.png
                                      displayName:
                                        type: string
                                        nullable: true
                                        title: Display Name
                                        description: Display name of the user
                                        example: John Doe
                                    required:
                                      - walletGroupIdentifier
                                      - twitterUser
                                      - discordUser
                                      - logoUrl
                                      - displayName
                                    title: User Metadata
                                    description: Schema for user metadata
                                  title: User Metadata
                                  description: Array of metadata associated with the user
                                websiteUserAttributeValues:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      value:
                                        type: string
                                        title: Value
                                        description: Value for the website user attribute
                                        example: Website User Attribute Value
                                      websiteUserAttribute:
                                        type: object
                                        properties:
                                          id:
                                            type: string
                                            format: uuid
                                            title: Website User Attribute ID
                                            description: >-
                                              Unique identifier for the website user
                                              attribute
                                            example: 123e4567-e89b-12d3-a456-426614174004
                                          label:
                                            type: string
                                            title: Label
                                            description: Label for the website user attribute
                                            example: Website User Attribute Label
                                        required:
                                          - id
                                          - label
                                        title: Website User Attribute
                                        description: Website user attribute details
                                    required:
                                      - value
                                      - websiteUserAttribute
                                    title: Website User Attribute Value
                                    description: Schema for a website user attribute value
                                  title: Website User Attribute Values
                                  description: >-
                                    Array of website user attribute values for
                                    the user
                              required:
                                - id
                                - walletAddress
                                - userMetadata
                                - websiteUserAttributeValues
                              title: User
                              description: Schema for a user
                            - type: string
                              format: 'null'
                              nullable: true
                          nullable: true
                          title: User
                          description: User associated with the loyalty account
                        lockVersion:
                          nullable: true
                          title: Lock Version
                          description: Version number used for optimistic locking
                          example: 1
                      required:
                        - id
                        - loyaltyCurrencyId
                        - userId
                        - user
                      title: Loyalty Account
                      description: Schema for a loyalty account
                    title: Data
                    description: Array of loyalty accounts
                  hasNextPage:
                    type: boolean
                    title: Has Next Page
                    description: Indicates if there is a next page of results
                    example: true
                  message:
                    type: string
                    title: Message
                    description: Optional message
                    example: Success
                required:
                  - data
                  - hasNextPage
                title: Get Loyalty Accounts Response
                description: Schema for the response of getting loyalty accounts
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Request body is invalid
                required:
                  - message
                title: Bad Request Response
                description: Schema for bad request response
        '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
        '429':
          description: '429'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Too many requests
                required:
                  - message
                title: Too Many Request Response
                description: Schema for too many request response
        '500':
          description: '500'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    title: Success
                    description: Indicates operation success
                    example: false
                  message:
                    type: string
                    title: Message
                    description: Error message
                    example: Internal server error
                  debugInfo:
                    type: string
                    title: Debug Info
                    description: Optional debug information
                    example: Stack trace or additional error details
                required:
                  - success
                  - message
                title: Internal Server Error Response
                description: Schema for internal server error response
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````