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

# Delete Deal

> Permanently delete a deal from your workspace

## Request

### Path Parameters

<ParamField path="id" type="string" required>
  The deal's unique ID (UUID)
</ParamField>

### Headers

```
Authorization: Bearer wbk_your_api_key_here
```

<Note>
  Requires an API key with the `deals:write` permission.
</Note>

<Warning>
  Deletion is **permanent** and cannot be undone. Activities, tasks, and notes linked to this deal become orphaned (their `deal_id` is set to null) but are not deleted. Fires the `deal.deleted` webhook event.
</Warning>

## Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="deleted" type="boolean">
      Always `true` on success
    </ResponseField>

    <ResponseField name="id" type="string">
      ID of the deleted deal
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://data.leadlex.com/functions/v1/api-gateway/v1/deals/3f8e1d2c-4b5a-6d7e-8f9a-0b1c2d3e4f5a \
    -H "Authorization: Bearer wbk_your_api_key_here"
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "wbk_your_api_key_here"
  BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
  DEAL_ID = "3f8e1d2c-4b5a-6d7e-8f9a-0b1c2d3e4f5a"

  response = requests.delete(
      f"{BASE_URL}/v1/deals/{DEAL_ID}",
      headers={"Authorization": f"Bearer {API_KEY}"},
  )
  assert response.json()["data"]["deleted"] is True
  ```

  ```javascript JavaScript theme={null}
  const DEAL_ID = '3f8e1d2c-4b5a-6d7e-8f9a-0b1c2d3e4f5a';

  const response = await fetch(
    `https://data.leadlex.com/functions/v1/api-gateway/v1/deals/${DEAL_ID}`,
    {
      method: 'DELETE',
      headers: { 'Authorization': 'Bearer wbk_your_api_key_here' },
    }
  );
  const { data } = await response.json();
  console.log(data.deleted); // true
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "data": {
    "deleted": true,
    "id": "3f8e1d2c-4b5a-6d7e-8f9a-0b1c2d3e4f5a"
  }
}
```

## Errors

| Status | Code                       | Description                            |
| ------ | -------------------------- | -------------------------------------- |
| 401    | `invalid_key`              | Invalid or expired API key             |
| 403    | `insufficient_permissions` | Missing `deals:write` permission       |
| 404    | `deal_not_found`           | No deal with this ID in your workspace |
| 429    | `rate_limited`             | Rate limit exceeded                    |
