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

# Delete Affiliate

> Delete an affiliate user and optionally their associated user account

<Warning>
  This action is irreversible. All associated data including referrals, commissions, and partnerships will be permanently deleted. A webhook event will be emitted before deletion.
</Warning>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the affiliate to delete
</ParamField>

## Response

The response confirms successful deletion.

<ResponseField name="success" type="boolean">
  Always `true` for successful deletions
</ResponseField>

<ResponseField name="message" type="string">
  Confirmation message: `"Affiliate deleted successfully"`
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak" \
    -H "Authorization: Bearer sk_live_your_api_key"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Affiliate deleted successfully"
  }
  ```
</ResponseExample>

**Note:** The associated user account will only be deleted if:

* The user has no other affiliate accounts
* The user does not own any teams
* The user is not a member of any teams

Otherwise, only the affiliate account is deleted and the user account remains.
