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

# Get Affiliate(s)

> Returns an Affiliate By ID or Email. If none is specified, all Affiliates from the Affiliate Program are returned.



## OpenAPI

````yaml GET /affiliates
openapi: 3.0.1
info:
  title: Referly API
  description: API for managing affiliates, referrals, and sales for SaaS businesses
  version: 1.0.0
servers:
  - url: https://www.referly.so/api/v1
security:
  - bearerAuth: []
paths:
  /affiliates:
    get:
      summary: Get all affiliates or by ID/email
      description: >-
        Returns an Affiliate By ID or Email. If none is specified, all
        Affiliates from the Affiliate Program are returned.
      parameters:
        - name: id
          in: query
          description: The ID of the affiliate to retrieve
          schema:
            type: string
            format: uuid
        - name: email
          in: query
          description: The email of the affiliate to retrieve
          schema:
            type: string
            format: email
      responses:
        '200':
          description: A list of affiliates or a single affiliate
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Affiliate'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
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
          description: Affiliate's custom referral link
        status:
          type: string
          description: Status of the affiliate (active/inactive)
        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
    Error:
      type: object
      properties:
        error:
          type: integer
          description: Error code
        message:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````