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

# Delete Affiliate Link

> Deletes an affiliate link based on the ID or link string provided



## OpenAPI

````yaml DELETE /links
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:
  /links:
    delete:
      summary: Delete an affiliate link
      description: Deletes an affiliate link based on the ID or link string provided
      requestBody:
        description: Affiliate link delete details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AffiliateLinkDelete'
        required: true
      responses:
        '200':
          description: Affiliate link deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Success message
                  deletedLink:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      link:
                        type: string
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Affiliate link not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AffiliateLinkDelete:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The affiliate link ID (required if link not provided)
        link:
          type: string
          description: The affiliate link string (required if id not provided)
    Error:
      type: object
      properties:
        error:
          type: integer
          description: Error code
        message:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````