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

# Get Affiliate(s)

> Returns a single affiliate when `id` or `email` is supplied, or every affiliate in the program when neither is. Looking up an affiliate that does not exist returns `null` with a 200, not a 404.

Each affiliate includes an `affiliateLinks` array holding every referral link slug they own — this is the source of truth for links. The legacy `link` field is deprecated and is usually `null`; use the [affiliate link endpoints](/api-reference/links/get) to manage links.



## OpenAPI

````yaml GET /affiliates
openapi: 3.0.1
info:
  title: Referly API
  description: >-
    REST API for managing affiliates, referrals, sales, affiliate links, coupons
    and promotional codes in your Referly affiliate program.


    Every request must send `Authorization: Bearer <YOUR_API_KEY>`. The token is
    scoped to a single affiliate program, so no program ID is ever required in
    the request — every read and write is automatically limited to that program.


    Requests are rate limited per token, per endpoint and per method.
  version: 1.0.0
servers:
  - url: https://www.referly.so/api/v1
security:
  - bearerAuth: []
paths:
  /affiliates:
    get:
      summary: Get affiliate(s)
      description: >-
        Returns a single affiliate when `id` or `email` is supplied, or every
        affiliate in the program when neither is. Looking up an affiliate that
        does not exist returns `null` with a 200, not a 404.


        Each affiliate includes an `affiliateLinks` array holding every referral
        link slug they own — this is the source of truth for links. The legacy
        `link` field is deprecated and is usually `null`; use the [affiliate
        link endpoints](/api-reference/links/get) to manage links.
      parameters:
        - name: id
          in: query
          description: >-
            Identifies one affiliate. Accepts the affiliate's UUID, one of their
            affiliate link slugs, or a numeric click ID (the click's affiliate
            is returned).
          schema:
            type: string
          example: 9f1c2f2e-1b3a-4f5c-8d7e-6a5b4c3d2e1f
        - name: email
          in: query
          description: >-
            The email address of the affiliate to retrieve. Ignored when `id` is
            set.
          schema:
            type: string
            format: email
          example: affiliate@example.com
      responses:
        '200':
          description: >-
            A single affiliate when filtering by `id` or `email` (`null` if no
            match), otherwise every affiliate in the program.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Affiliate'
                  - type: array
                    items:
                      $ref: '#/components/schemas/Affiliate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/ProgramNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Affiliate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The affiliate ID
        firstName:
          type: string
          description: First name of the affiliate
        lastName:
          type: string
          description: Last name of the affiliate
        name:
          type: string
          nullable: true
          description: Full name of the affiliate (optional)
        email:
          type: string
          format: email
          description: Email of the affiliate
        password:
          type: string
          nullable: true
          description: Hashed Password of the affiliate (optional)
          deprecated: true
        emailVerified:
          type: boolean
          nullable: true
          description: Flag to indicate if the email has been verified
        image:
          type: string
          nullable: true
          description: Profile image URL of the affiliate
        detailsComplete:
          type: boolean
          description: Flag to indicate if affiliate details are complete
        programId:
          type: string
          format: uuid
          description: The program ID that the affiliate is associated with
        payoutEmail:
          type: string
          format: email
          description: Email to be used for payouts
        paymentMethod:
          type: string
          description: Payment method for the affiliate (e.g., WISE)
        commissionRate:
          type: number
          format: float
          description: Commission rate for the affiliate (0 - 100)
        link:
          type: string
          nullable: true
          deprecated: true
          description: >-
            Deprecated legacy field and almost always `null`. Read
            `affiliateLinks` instead.
        affiliateLinks:
          type: array
          description: >-
            All affiliate link records for this affiliate. This is the source of
            truth for referral link slugs.
          items:
            $ref: '#/components/schemas/AffiliateLinkRecord'
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - INVITED
            - DECLINED
            - DEACTIVATED
            - BANNED
          description: >-
            Affiliate status. `INACTIVE` is shown as **Pending** in the
            dashboard and is kept for backwards compatibility.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the affiliate was created
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the affiliate was last updated
        numberOfReferredUsers:
          type: integer
          description: Number of users referred by the affiliate
        numberOfClicks:
          type: integer
          description: Number of clicks generated by the affiliate
        totalCommissionEarned:
          type: number
          format: float
          description: Total commission earned by the affiliate
        source:
          type: string
          nullable: true
          description: >-
            How the affiliate joined. Affiliates created through this API have
            `API`.
        commissionPlanId:
          type: string
          format: uuid
          nullable: true
          description: The commission plan assigned to this affiliate, if any
        affiliateGroupId:
          type: string
          format: uuid
          nullable: true
          description: The affiliate group this affiliate belongs to, if any
    AffiliateLinkRecord:
      type: object
      description: A single referral link belonging to an affiliate
      properties:
        id:
          type: string
          format: uuid
          description: Affiliate link record ID
        link:
          type: string
          description: Link slug (path segment) for this affiliate
        userId:
          type: string
          format: uuid
          nullable: true
          description: Affiliate user ID
        programId:
          type: string
          format: uuid
          nullable: true
          description: Affiliate program ID
        createdAt:
          type: string
          format: date-time
          description: When this link was created
        updatedAt:
          type: string
          format: date-time
          description: When this link was last updated
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human readable description of what went wrong
  responses:
    Unauthorized:
      description: >-
        The `Authorization` header is missing, is not a `Bearer` header, or the
        token is not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: API access is not enabled for this account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ProgramNotFound:
      description: The affiliate program this token belongs to no longer exists.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Too many requests for this token on this endpoint. Please slow down.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````