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

> Permanently delete a company from your workspace

## Request

### Path Parameters

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

### Headers

```
Authorization: Bearer wbk_your_api_key_here
```

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

<Warning>
  Deletion is **permanent** and cannot be undone. Linked contacts and deals are **not** deleted but have their `related_company_id` / `company_id` references set to null (orphaning them). Fires the `company.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 company
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://data.leadlex.com/functions/v1/api-gateway/v1/companies/c1b2a3d4-e5f6-7890-abcd-ef1234567890 \
    -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"
  COMPANY_ID = "c1b2a3d4-e5f6-7890-abcd-ef1234567890"

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

  ```javascript JavaScript theme={null}
  const COMPANY_ID = 'c1b2a3d4-e5f6-7890-abcd-ef1234567890';

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

### Example Response

```json theme={null}
{
  "data": {
    "deleted": true,
    "id": "c1b2a3d4-e5f6-7890-abcd-ef1234567890"
  }
}
```

<Tip>
  If you want to preserve linked records, reassign contacts and deals to another company (via `PATCH /v1/contacts/{id}` and `PATCH /v1/deals/{id}`) before deleting.
</Tip>

## Errors

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