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

# Get available referrals



## OpenAPI

````yaml openapi-v2-affiliate-referrals get /referrals
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:
    get:
      summary: Get available referrals
      operationId: getReferrals
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - name: q
          in: query
          description: Search params. Searches by email, uid, username, website
          required: false
          schema:
            type: string
        - 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
        - name: filters[created_at][from]
          in: query
          description: created_at start date
          required: false
          schema:
            type: string
            format: date
        - name: filters[created_at][to]
          in: query
          description: created_at end date
          required: false
          schema:
            type: string
            format: date
        - name: filters[customer_since][from]
          in: query
          description: customer_since start date
          required: false
          schema:
            type: string
            format: date
        - name: filters[customer_since][to]
          in: query
          description: customer_since end date
          required: false
          schema:
            type: string
            format: date
        - name: filters[campaign_id]
          in: query
          description: Campaign ids. Can be Integer or an Array of Integers
          required: false
          schema:
            oneOf:
              - type: integer
              - type: array
                items:
                  type: integer
        - name: sorting[state]
          in: query
          description: Sort by state direction
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
        - name: sorting[email]
          in: query
          description: Sort by email direction
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Referral'
        '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:
    Referral:
      type: object
      properties:
        id:
          type: integer
        uid:
          type: string
        state:
          type: string
          enum:
            - subscribed
            - signup
            - active
            - cancelled
            - refunded
            - denied
            - pending
            - moved
        metadata:
          type: object
        created_at:
          type: string
          format: date-time
        customer_since:
          type: string
          format: date-time
        email:
          type: string
          format: email
        promoter_campaign:
          $ref: '#/components/schemas/PromoterCampaign'
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
        - code
    PromoterCampaign:
      type: object
      properties:
        id:
          type: integer
        campaign_id:
          type: integer
        created_at:
          type: string
          format: date-time
        campaign:
          $ref: '#/components/schemas/Campaign'
    Campaign:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        color:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Access token passed as a Bearer token in the Authorization header

````