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

# Export referrals



## OpenAPI

````yaml openapi-v2-affiliate-referrals get /referrals/export
openapi: 3.0.1
info:
  title: FirstPromoter API
  version: '1.0'
  description: API documentation for FirstPromoter affiliate referrals
servers:
  - url: https://api.firstpromoter.com/api/v2/affiliate
security:
  - BearerAuth: []
paths:
  /referrals/export:
    get:
      summary: Export referrals
      operationId: exportReferrals
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - name: filters[type]
          in: query
          description: Type (lead or customer)
          required: false
          schema:
            type: string
            enum:
              - lead
              - customer
        - name: filters[state]
          in: query
          description: State
          required: false
          schema:
            type: string
            enum:
              - subscribed
              - signup
              - active
              - cancelled
              - refunded
              - denied
              - pending
              - moved
      responses:
        '200':
          description: Successful response
          content:
            text/csv:
              schema:
                type: string
        '202':
          description: Export is being processed
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '401':
          description: >-
            Unauthorized — the Bearer access token is missing, invalid, expired,
            or revoked. No JSON response body is returned.
          content:
            application/json:
              schema:
                type: object
              example: {}
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    AccountId:
      name: Account-ID
      in: header
      required: true
      description: Account identifier that specifies which account is making the request
      schema:
        type: string
        example: acc_123456
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
        - code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Access token passed as a Bearer token in the Authorization header

````