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

# Update Affiliate

> Updates an Affiliate based on their ID



## OpenAPI

````yaml PUT /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:
    put:
      summary: Update an Affiliate by ID
      description: Updates an Affiliate based on their ID
      requestBody:
        description: Affiliate update details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AffiliateUpdate'
        required: true
      responses:
        '200':
          description: Affiliate updated successfully
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AffiliateUpdate:
      type: object
      required:
        - affiliateId
      properties:
        affiliateId:
          type: string
          description: The ID of the affiliate
        firstName:
          type: string
          description: First name of the affiliate
        lastName:
          type: string
          description: Last name of the affiliate
        email:
          type: string
          format: email
          description: Email of the affiliate
        commissionRate:
          type: number
          format: float
          description: Commission rate for the affiliate
        affiliateStatus:
          type: string
          description: Status of the affiliate (active/inactive)
        affiliateLink:
          type: string
          description: Custom affiliate link for the affiliate
    Error:
      type: object
      properties:
        error:
          type: integer
          description: Error code
        message:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````