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

# List customers

> Lists the customers registered under your tenant. Call it to page through your customer base, or to check whether an email address is already registered before creating a record. Filter with `email`, `xp_status` and `eligible_tier_id`, and page with `page` and `limit`. The response `data` carries `items` alongside `total_count`, `page`, `limit`, `total_pages` and `has_next_page`. Returns 404 when the tenant behind the API key cannot be found.



## OpenAPI

````yaml /openapi/kintra-gateway.json get /gateway/customers
openapi: 3.0.0
info:
  description: >-
    Server-to-server API for the Kintra loyalty platform. Requests are
    authenticated with a tenant API key and a request signature; the tenant
    comes from the key.
  title: Kintra Gateway API
  version: 1.0.0
servers:
  - description: Production environment
    url: https://api.kintra.io/api/v1
security: []
paths:
  /gateway/customers:
    get:
      tags:
        - Customers
      summary: List customers
      description: >-
        Lists the customers registered under your tenant. Call it to page
        through your customer base, or to check whether an email address is
        already registered before creating a record. Filter with `email`,
        `xp_status` and `eligible_tier_id`, and page with `page` and `limit`.
        The response `data` carries `items` alongside `total_count`, `page`,
        `limit`, `total_pages` and `has_next_page`. Returns 404 when the tenant
        behind the API key cannot be found.
      operationId: ListCustomers
      parameters:
        - in: query
          name: email
          required: false
          schema:
            type: string
        - in: query
          name: xp_status
          required: false
          schema:
            $ref: '#/components/schemas/XpStatus'
        - in: query
          name: eligible_tier_id
          required: false
          schema:
            type: string
        - in: query
          name: page
          required: false
          schema:
            default: 1
            format: double
            type: number
        - in: query
          name: limit
          required: false
          schema:
            default: 10
            format: double
            type: number
        - description: >-
            Hex HMAC-SHA256 of the timestamp, the uppercase method, the url as
            sent and the request body, keyed by the signing secret.
          in: header
          name: X-Tenant-Signature
          required: true
          schema:
            type: string
        - description: Unix seconds. Checked before the signature.
          in: header
          name: X-Tenant-Timestamp
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ApiResponse_IPaginationResponse_ICustomerProfileResponse__
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_null_'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_null_'
          description: Tenant not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_null_'
          description: Internal server error
      security:
        - tenant_api_key: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: >
            # Export KINTRA_API for your environment first; the base URL is on
            the introduction page.

            KEY="YOUR_TENANT_KEY_ID"

            SECRET="YOUR_SIGNING_SECRET"


            # The signature covers the path and query exactly as sent, so both
            are split

            # off the base URL and reused for the request line below.

            API_PATH="/${KINTRA_API#*://*/}"

            API_HOST="${KINTRA_API%"$API_PATH"}"

            METHOD="GET"

            PATH_AND_QUERY="$API_PATH/gateway/customers"


            # No body on this method, so the signature covers an empty body
            string.

            BODY=''


            TIMESTAMP="$(date +%s)"

            SIGNATURE="$(printf '%s' "$TIMESTAMP$METHOD$PATH_AND_QUERY$BODY" \
              | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')"

            curl -sS -w '\n%{http_code}' -X "$METHOD" "$API_HOST$PATH_AND_QUERY"
            \
              -H "X-Tenant-Key: $KEY" \
              -H "X-Tenant-Timestamp: $TIMESTAMP" \
              -H "X-Tenant-Signature: $SIGNATURE"
        - label: TypeScript
          lang: typescript
          source: >
            import { createHmac } from 'node:crypto'


            // Export KINTRA_API for your environment first; the base URL is on
            the introduction page.

            const { origin, pathname } = new URL(process.env.KINTRA_API ?? '')

            const key = 'YOUR_TENANT_KEY_ID'

            const secret = 'YOUR_SIGNING_SECRET'


            const method = 'GET'

            // The signature covers the path and query as sent, starting at the
            API prefix.

            const pathAndQuery = `${pathname}/gateway/customers`


            // No body on this method, so the signature covers an empty body
            string.

            const body = ''


            const timestamp = Math.floor(Date.now() / 1000).toString()

            const signature = createHmac('sha256',
            secret).update(`${timestamp}${method}${pathAndQuery}${body}`).digest('hex')


            const response = await fetch(`${origin}${pathAndQuery}`, {
              method,
              headers: {
                'X-Tenant-Key': key,
                'X-Tenant-Timestamp': timestamp,
                'X-Tenant-Signature': signature
              }
            })


            console.log(response.status, await response.json())
components:
  schemas:
    XpStatus:
      enum:
        - active
        - locked
      type: string
    ApiResponse_IPaginationResponse_ICustomerProfileResponse__:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/IPaginationResponse_ICustomerProfileResponse_'
        errors:
          items:
            properties:
              message:
                type: string
              path:
                type: string
            required:
              - path
              - message
            type: object
          type: array
        message:
          type: string
        success:
          type: boolean
      required:
        - success
      type: object
    ApiResponse_null_:
      additionalProperties: false
      properties:
        data:
          enum:
            - null
          nullable: true
          type: number
        errors:
          items:
            properties:
              message:
                type: string
              path:
                type: string
            required:
              - path
              - message
            type: object
          type: array
        message:
          type: string
        success:
          type: boolean
      required:
        - success
      type: object
    IPaginationResponse_ICustomerProfileResponse_:
      additionalProperties: false
      properties:
        has_next_page:
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/ICustomerProfileResponse'
          type: array
        limit:
          format: double
          type: number
        page:
          format: double
          type: number
        total_count:
          format: double
          type: number
        total_pages:
          format: double
          type: number
      required:
        - total_count
        - page
        - limit
        - has_next_page
        - total_pages
        - items
      type: object
    ICustomerProfileResponse:
      additionalProperties: false
      properties:
        tenant:
          description: >-
            Current tenant label; present for authenticated customer profile
            reads.
          properties:
            id:
              type: string
            name:
              type: string
            slug:
              type: string
          required:
            - slug
            - name
            - id
          type: object
        user:
          allOf:
            - $ref: '#/components/schemas/IUserProfileResponse'
            - properties:
                clubs:
                  items:
                    $ref: '#/components/schemas/IClubResponse'
                  nullable: true
                  type: array
                cohort_metadata:
                  allOf:
                    - $ref: '#/components/schemas/Record_string.unknown_'
                  nullable: true
                country:
                  allOf:
                    - $ref: '#/components/schemas/ICountryResponse'
                  nullable: true
                xp_status:
                  anyOf:
                    - $ref: '#/components/schemas/XpStatus'
                    - type: string
                  nullable: true
              type: object
      required:
        - user
      type: object
    IUserProfileResponse:
      additionalProperties: false
      properties:
        auth_provider:
          type: string
        auth_provider_id:
          type: string
        created_at:
          format: date-time
          nullable: true
          type: string
        email:
          type: string
        first_name:
          nullable: true
          type: string
        id:
          type: string
        internal_wallets:
          items:
            $ref: '#/components/schemas/IInternalWalletResponse'
          type: array
        last_name:
          nullable: true
          type: string
        onboarding_status:
          anyOf:
            - $ref: '#/components/schemas/UserOnboardingStatus'
            - type: string
        onboarding_type:
          anyOf:
            - $ref: '#/components/schemas/UserOnboardingType'
            - type: string
          nullable: true
        status:
          type: string
        updated_at:
          format: date-time
          nullable: true
          type: string
        username:
          type: string
      required:
        - id
        - username
        - email
        - auth_provider
        - auth_provider_id
        - status
        - onboarding_status
      type: object
    IClubResponse:
      additionalProperties: false
      description: JSON response for a row in `core.clubs`.
      properties:
        country_id:
          nullable: true
          type: string
        icon_url:
          nullable: true
          type: string
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        sport_id:
          nullable: true
          type: string
        status:
          anyOf:
            - $ref: '#/components/schemas/ClubStatus'
            - type: string
      required:
        - id
        - name
        - slug
        - sport_id
        - country_id
        - icon_url
        - status
      type: object
    Record_string.unknown_:
      additionalProperties: {}
      description: Construct a type with a set of properties K of type T
      properties: {}
      type: object
    ICountryResponse:
      additionalProperties: false
      description: JSON response for a row in `core.countries`.
      properties:
        code:
          nullable: true
          type: string
        icon_url:
          nullable: true
          type: string
        id:
          type: string
        name:
          type: string
        status:
          anyOf:
            - $ref: '#/components/schemas/CountryStatus'
            - type: string
      required:
        - id
        - name
        - code
        - icon_url
        - status
      type: object
    IInternalWalletResponse:
      additionalProperties: false
      properties:
        address:
          type: string
        created_at:
          format: date-time
          type: string
        deleted_at:
          format: date-time
          nullable: true
          type: string
        id:
          type: string
        label:
          nullable: true
          type: string
        updated_at:
          format: date-time
          type: string
        user_id:
          type: string
        wallet_kind:
          type: string
      required:
        - id
        - address
        - wallet_kind
        - user_id
      type: object
    UserOnboardingStatus:
      enum:
        - initial
        - registered
        - active
      type: string
    UserOnboardingType:
      enum:
        - admin
        - tenant
        - user
      type: string
    ClubStatus:
      description: Lifecycle status for reference rows in `core.clubs`.
      enum:
        - active
        - inactive
      type: string
    CountryStatus:
      description: Lifecycle status for reference rows in `core.countries`.
      enum:
        - active
        - inactive
      type: string
  securitySchemes:
    tenant_api_key:
      description: Tenant API key
      in: header
      name: x-tenant-key
      type: apiKey

````