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

# Delete a contact

> Delete a contact by id.

Remove a contact from your workspace.

## Endpoint

```
DELETE /api/v1/{subdomain}/contacts/{id}
```

Required ability: `contacts.delete`.

## Headers

| Header          | Value                        |
| --------------- | ---------------------------- |
| `Authorization` | `Bearer <your-64-hex-token>` |
| `Accept`        | `application/json`           |

## Path parameters

<ParamField path="subdomain" type="string" required={true}>
  Your workspace subdomain.
</ParamField>

<ParamField path="id" type="integer" required={true}>
  Contact id.
</ParamField>

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://dash.xobito.com/api/v1/acme/contacts/451 \
    -H "Authorization: Bearer <your_token>" \
    -H "Accept: application/json"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    "https://dash.xobito.com/api/v1/acme/contacts/451",
    {
      method: "DELETE",
      headers: {
        Authorization: "Bearer <your_token>",
        Accept: "application/json",
      },
    }
  );
  const body = await res.json();
  ```

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

  r = requests.delete(
      "https://dash.xobito.com/api/v1/acme/contacts/451",
      headers={
          "Authorization": "Bearer <your_token>",
          "Accept": "application/json",
      },
  )
  body = r.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://dash.xobito.com/api/v1/acme/contacts/451');
  curl_setopt_array($ch, [
      CURLOPT_CUSTOMREQUEST => 'DELETE',
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer <your_token>',
          'Accept: application/json',
      ],
  ]);
  $body = json_decode(curl_exec($ch), true);
  curl_close($ch);
  ```
</CodeGroup>

## Example response

```json 200 OK theme={null}
{
  "status": "success",
  "message": "Contact deleted successfully",
  "data": null
}
```

## Error responses

| Status | When                    | Example body                                                                               |
| ------ | ----------------------- | ------------------------------------------------------------------------------------------ |
| `401`  | Missing / invalid token | `{"status":"error","message":"Invalid API token"}`                                         |
| `403`  | Missing ability         | `{"status":"error","message":"Token does not have the required ability: contacts.delete"}` |
| `404`  | Contact not found       | `{"status":"error","message":"Contact not found"}`                                         |
| `429`  | Rate limit              | `{"message":"Too many requests","retry_after":45}`                                         |
| `500`  | Server error            | `{"status":"error","message":"Failed to delete contact"}`                                  |

<Warning>
  Delete is permanent. A `deleted` webhook fires for subscribers of `contacts_actions.delete` — see [Webhook Events](/developers/webhook-events#contact-deleted).
</Warning>
