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

# Delete Referrals

> Permanently deletes a referral and the sales that cascade from it. This cannot be undone.

`referralId` accepts either the referral's UUID or the referred user's email address. The request succeeds with the same response even when nothing matched. Fires the `referral.deleted` webhook.



## OpenAPI

````yaml DELETE /referrals
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:
  /referrals:
    delete:
      summary: Delete referrals
      description: >-
        Permanently deletes a referral and the sales that cascade from it. This
        cannot be undone.


        `referralId` accepts either the referral's UUID or the referred user's
        email address. The request succeeds with the same response even when
        nothing matched. Fires the `referral.deleted` webhook.
      requestBody:
        description: The referral to delete
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReferralDelete'
        required: true
      responses:
        '200':
          description: The referral was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteMessage'
        '400':
          description: '`referralId` was not supplied, or the delete failed.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/ProgramNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    ReferralDelete:
      type: object
      required:
        - referralId
      properties:
        referralId:
          type: string
          description: >-
            The referral to delete. Accepts the referral's UUID or the referred
            user's email address.
    DeleteMessage:
      type: object
      properties:
        message:
          type: string
          description: Confirmation message
    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

````