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

# Get Export

Poll this to follow an export's progress and to collect its file. A completed
export carries a fresh `download_url` on every response, valid for six hours,
so fetch the file soon after reading one, or read this endpoint again for a
new link.

Seven days after completing, the file is deleted and the export reports
`expired`.


## OpenAPI

````yaml api-reference/v2/openapi.json GET /v2/customers/exports/{id}
openapi: 3.1.1
info:
  title: LoyaltyLion Admin API
  version: v2
servers:
  - url: https://api.loyaltylion.com
security: []
tags:
  - name: identity
  - name: activities
  - name: orders
  - name: transactions
  - name: customers
  - name: customerExports
  - name: webhooks
  - name: emails
  - name: sites
  - name: reviews
  - name: rewards
  - name: integrations
  - name: gatsby
paths:
  /v2/customers/exports/{id}:
    get:
      tags:
        - customerExports
      operationId: customerExports.getCustomerExport
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: number
          description: The ID of the export
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CustomerExportsGetCustomerExportResponseBody
        '400':
          $ref: '#/components/responses/ClientErrorBadRequest'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - ProgramApiKey:
            - read_customers
components:
  schemas:
    CustomerExportsGetCustomerExportResponseBody:
      type: object
      properties:
        export:
          $ref: '#/components/schemas/CustomerExport'
      required:
        - export
      additionalProperties: false
    CustomerExport:
      oneOf:
        - $ref: '#/components/schemas/CustomerExportPending'
        - $ref: '#/components/schemas/CustomerExportProcessing'
        - $ref: '#/components/schemas/CustomerExportCompleted'
        - $ref: '#/components/schemas/CustomerExportExpired'
        - $ref: '#/components/schemas/CustomerExportFailed'
      title: Customer export
      description: >-
        An export moves from `pending` to `processing` to `completed`, and to
        `expired` once its file is deleted seven days later; a run that cannot
        finish ends `failed`. Which fields are present depends on its `status`
      type: object
      discriminator:
        propertyName: status
        mapping:
          pending:
            $ref: '#/components/schemas/CustomerExportPending'
          processing:
            $ref: '#/components/schemas/CustomerExportProcessing'
          completed:
            $ref: '#/components/schemas/CustomerExportCompleted'
          expired:
            $ref: '#/components/schemas/CustomerExportExpired'
          failed:
            $ref: '#/components/schemas/CustomerExportFailed'
    CustomerExportPending:
      type: object
      properties:
        id:
          type: number
        filters:
          type: object
          properties:
            email:
              description: Return only customers whose email contains the specified string
              type: string
            created_at_min:
              description: >-
                Return only customers created on or after the specified `ISO
                8601` datetime string
              type: string
            created_at_max:
              description: >-
                Return only customers created before the specified `ISO 8601`
                datetime string
              type: string
            updated_at_min:
              description: >-
                Return only customers updated on or after the specified `ISO
                8601` datetime string
              type: string
            updated_at_max:
              description: >-
                Return only customers updated before the specified `ISO 8601`
                datetime string
              type: string
          additionalProperties: false
          description: The filters this export was requested with
        created_at:
          type: string
          description: When the export was requested, as an ISO 8601 timestamp
        status:
          type: string
          const: pending
          description: The export is queued and has not started
      required:
        - id
        - filters
        - created_at
        - status
      additionalProperties: false
      title: Pending customer export
    CustomerExportProcessing:
      type: object
      properties:
        id:
          type: number
        filters:
          type: object
          properties:
            email:
              description: Return only customers whose email contains the specified string
              type: string
            created_at_min:
              description: >-
                Return only customers created on or after the specified `ISO
                8601` datetime string
              type: string
            created_at_max:
              description: >-
                Return only customers created before the specified `ISO 8601`
                datetime string
              type: string
            updated_at_min:
              description: >-
                Return only customers updated on or after the specified `ISO
                8601` datetime string
              type: string
            updated_at_max:
              description: >-
                Return only customers updated before the specified `ISO 8601`
                datetime string
              type: string
          additionalProperties: false
          description: The filters this export was requested with
        created_at:
          type: string
          description: When the export was requested, as an ISO 8601 timestamp
        status:
          type: string
          const: processing
          description: The export is running
        started_at:
          type: string
          description: When processing began, as an ISO 8601 timestamp
        progress:
          type: object
          properties:
            rows_processed:
              type: number
              description: How many customers have been written so far
            rows_total:
              description: >-
                Roughly how many customers the export will write, for showing
                progress against. An approximation, re-estimated whenever
                processing starts or resumes, so it can change or become null
                while the export runs; `rows_processed` is the truth. Null when
                no estimate was available
              type:
                - number
                - 'null'
          required:
            - rows_processed
            - rows_total
          additionalProperties: false
      required:
        - id
        - filters
        - created_at
        - status
        - started_at
        - progress
      additionalProperties: false
      title: Processing customer export
    CustomerExportCompleted:
      type: object
      properties:
        id:
          type: number
        filters:
          type: object
          properties:
            email:
              description: Return only customers whose email contains the specified string
              type: string
            created_at_min:
              description: >-
                Return only customers created on or after the specified `ISO
                8601` datetime string
              type: string
            created_at_max:
              description: >-
                Return only customers created before the specified `ISO 8601`
                datetime string
              type: string
            updated_at_min:
              description: >-
                Return only customers updated on or after the specified `ISO
                8601` datetime string
              type: string
            updated_at_max:
              description: >-
                Return only customers updated before the specified `ISO 8601`
                datetime string
              type: string
          additionalProperties: false
          description: The filters this export was requested with
        created_at:
          type: string
          description: When the export was requested, as an ISO 8601 timestamp
        started_at:
          type: string
          description: When processing began, as an ISO 8601 timestamp
        completed_at:
          type: string
          description: When the file was written, as an ISO 8601 timestamp
        row_count:
          type: number
          description: How many customers the file holds, one per line
        file_size:
          type: number
          description: Size of the file in bytes
        status:
          type: string
          const: completed
          description: The export finished and its file is available for download
        expires_at:
          type: string
          description: >-
            When the file is deleted, seven days after the export completed, as
            an ISO 8601 timestamp. The export is `expired` from then on
        download_url:
          type: string
          description: >-
            A signed link to the file, minted for this response and valid for
            six hours. Read the export again for a fresh link
        download_url_expires_at:
          type: string
          description: >-
            When the link in `download_url` stops working, as an ISO 8601
            timestamp
      required:
        - id
        - filters
        - created_at
        - started_at
        - completed_at
        - row_count
        - file_size
        - status
        - expires_at
        - download_url
        - download_url_expires_at
      additionalProperties: false
      title: Completed customer export
    CustomerExportExpired:
      type: object
      properties:
        id:
          type: number
        filters:
          type: object
          properties:
            email:
              description: Return only customers whose email contains the specified string
              type: string
            created_at_min:
              description: >-
                Return only customers created on or after the specified `ISO
                8601` datetime string
              type: string
            created_at_max:
              description: >-
                Return only customers created before the specified `ISO 8601`
                datetime string
              type: string
            updated_at_min:
              description: >-
                Return only customers updated on or after the specified `ISO
                8601` datetime string
              type: string
            updated_at_max:
              description: >-
                Return only customers updated before the specified `ISO 8601`
                datetime string
              type: string
          additionalProperties: false
          description: The filters this export was requested with
        created_at:
          type: string
          description: When the export was requested, as an ISO 8601 timestamp
        started_at:
          type: string
          description: When processing began, as an ISO 8601 timestamp
        completed_at:
          type: string
          description: When the file was written, as an ISO 8601 timestamp
        row_count:
          type: number
          description: How many customers the file holds, one per line
        file_size:
          type: number
          description: Size of the file in bytes
        status:
          type: string
          const: expired
          description: >-
            The file was deleted, seven days after the export completed. Request
            another export for a fresh file
        expired_at:
          type: string
          description: When the file was deleted, as an ISO 8601 timestamp
      required:
        - id
        - filters
        - created_at
        - started_at
        - completed_at
        - row_count
        - file_size
        - status
        - expired_at
      additionalProperties: false
      title: Expired customer export
    CustomerExportFailed:
      type: object
      properties:
        id:
          type: number
        filters:
          type: object
          properties:
            email:
              description: Return only customers whose email contains the specified string
              type: string
            created_at_min:
              description: >-
                Return only customers created on or after the specified `ISO
                8601` datetime string
              type: string
            created_at_max:
              description: >-
                Return only customers created before the specified `ISO 8601`
                datetime string
              type: string
            updated_at_min:
              description: >-
                Return only customers updated on or after the specified `ISO
                8601` datetime string
              type: string
            updated_at_max:
              description: >-
                Return only customers updated before the specified `ISO 8601`
                datetime string
              type: string
          additionalProperties: false
          description: The filters this export was requested with
        created_at:
          type: string
          description: When the export was requested, as an ISO 8601 timestamp
        status:
          type: string
          const: failed
          description: >-
            The export failed. It produced no file and will not be retried;
            request another one
        started_at:
          description: >-
            When processing began, as an ISO 8601 timestamp. Null if the export
            failed before it started
          type:
            - string
            - 'null'
        failed_at:
          type: string
          description: When the export failed, as an ISO 8601 timestamp
      required:
        - id
        - filters
        - created_at
        - status
        - started_at
        - failed_at
      additionalProperties: false
      title: Failed customer export
  responses:
    ClientErrorBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties:
                      type: string
                required:
                  - message
            required:
              - error
  securitySchemes:
    ProgramApiKey:
      type: http
      scheme: bearer
      description: >-
        An API key linked to a Program in LoyaltyLion, with a set of permissions
        (scopes). API keys can be created manually, or acquired through an
        OAuth2 flow. The API key should be provided as a `Bearer` token in the
        `Authorization` header

````