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

# Delete Collection

> Delete a face collection and the faces enrolled in it.

<div className="dj-endpoint">
  <span className={`dj-method dj-method-delete`}>DELETE</span>
  <code>/api/v1/face/collection</code>
</div>

Permanently delete a face collection by `collection_id`. Enrolled faces in that collection are removed with it.

## Headers

| Header          | Required | Description                                         |
| --------------- | -------- | --------------------------------------------------- |
| `Authorization` | Yes      | Your app's secret key, sent as-is — *not* `Bearer`. |
| `AppId`         | Yes      | The App ID from your dashboard.                     |

## Query parameters

| Parameter       | Type   | Required | Description               |
| --------------- | ------ | -------- | ------------------------- |
| `collection_id` | string | Yes      | The collection to delete. |

## Response

Returns an `entity` confirming the collection was deleted.

## Errors

| Code  | Meaning                                                         |
| ----- | --------------------------------------------------------------- |
| `400` | Bad request — `collection_id` is missing or invalid.            |
| `401` | Unauthorized — check your key and `AppId` (no `Bearer` prefix). |
| `404` | No collection found for the supplied id.                        |
| `429` | Too many requests — back off and retry.                         |

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.dojah.io/api/v1/face/collection?collection_id=b3b838de-9c2d-4e61-ac08-4716731436db" \
    -H "Authorization: {{secret_key}}" \
    -H "AppId: {{app_id}}"
  ```

  ```js Node.js theme={null}
  const params = new URLSearchParams({
    collection_id: "b3b838de-9c2d-4e61-ac08-4716731436db",
  });

  const url = "https://api.dojah.io/api/v1/face/collection?" + params;
  const res = await fetch(url, {
    method: "DELETE",
    headers: {
      Authorization: process.env.DOJAH_SECRET_KEY,
      AppId: process.env.DOJAH_APP_ID,
    },
  });
  const data = await res.json();
  ```

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

  res = requests.delete(
      "https://api.dojah.io/api/v1/face/collection",
      headers={
          "Authorization": os.environ["DOJAH_SECRET_KEY"],
          "AppId": os.environ["DOJAH_APP_ID"],
      },
      params={ "collection_id": "b3b838de-9c2d-4e61-ac08-4716731436db" },
  )
  data = res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json DELETE /api/v1/face/collection theme={null}
  {
    "entity": {
      "collection_id": "b3b838de-9c2d-4e61-ac08-4716731436db",
      "deleted": true
    }
  }
  ```
</ResponseExample>
