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

# Create Collection

> Create a face collection to group enrolled faces for 1:1 authentication and 1:N search.

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

Create a named collection that holds enrolled faces. Use the returned `collection_id` when you enroll, authenticate, or search users.

## Headers

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

## Body parameters

| Parameter | Type   | Required | Description                      |
| --------- | ------ | -------- | -------------------------------- |
| `name`    | string | Yes      | Display name for the collection. |

## Response

Returns an `entity` with the new collection’s `collection_id`, `name`, and `created_at`.

| Field           | Type   | Description                                                                      |
| --------------- | ------ | -------------------------------------------------------------------------------- |
| `collection_id` | string | Unique ID of the collection. Pass this when you enroll, authenticate, or search. |
| `name`          | string | Display name of the collection. Echoes the `name` you sent.                      |
| `created_at`    | string | ISO 8601 timestamp of when the collection was created.                           |

## Errors

| Code  | Meaning                                                                                       |
| ----- | --------------------------------------------------------------------------------------------- |
| `400` | Bad request — `name` is missing or invalid.                                                   |
| `401` | Unauthorized — check your key and `AppId` (no `Bearer` prefix).                               |
| `402` | Insufficient wallet balance. [Fund your wallet](/api-reference/core-concepts/wallet-billing). |
| `429` | Too many requests — back off and retry.                                                       |

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.dojah.io/api/v1/face/collection" \
    -H "Authorization: {{secret_key}}" \
    -H "AppId: {{app_id}}" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Second C"
    }'
  ```

  ```js Node.js theme={null}
  const res = await fetch("https://api.dojah.io/api/v1/face/collection", {
    method: "POST",
    headers: {
      Authorization: process.env.DOJAH_SECRET_KEY,
      AppId: process.env.DOJAH_APP_ID,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "Second C"
    }),
  });
  const data = await res.json();
  ```

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

  res = requests.post(
      "https://api.dojah.io/api/v1/face/collection",
      headers={
          "Authorization": os.environ["DOJAH_SECRET_KEY"],
          "AppId": os.environ["DOJAH_APP_ID"],
      },
      json={
          "name": "Second C"
      },
  )
  data = res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json POST /api/v1/face/collection theme={null}
  {
    "entity": {
      "collection_id": "a1b2c3d4-e5f6-4789-abcd-ef1234567890",
      "name": "Second C",
      "created_at": "2026-08-27T10:24:44.054Z"
    }
  }
  ```
</ResponseExample>
