# Create a help collection (https://notert.io/docs/api/reference/create-a-help-collection)

`POST /api/v1/help-collections`

Adds a collection to the help center, last in the team's order, its address taken from its name. Then start drafts in it, or move articles into it. A help center holds at most 50 collections.

Access: A token with help:write.

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | No | A key of your own for this call, such as a UUID, sent again with a call made again after its answer was lost, so it stores and sends once and answers what the first stored. The same key with other words names another record. Send it or an id in the body, not both. At least 1 character. At most 255 characters. |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | uuid | No | An id of your own, a UUID, so a call sent again after its answer was lost answers the same collection rather than adding a second. The same id with another name, description or icon is ALREADY_ADDED. Or send an Idempotency-Key header instead, not both. |
| `name` | string | Yes | The collection's name, such as Billing or Getting started. At least 1 character. At most 60 characters. |
| `description` | string | No | One line under its name saying what its articles cover. Empty for none. At most 200 characters. |
| `icon` | string | No | The icon its card shows on the board. A folder when left out. One of: `folder`, `rocket`, `settings`, `database`, `message-circle`, `book-open`, `credit-card`, `users`, `code`, `zap`, `shield`, `globe`, `plug`, `bell`, `chart-column`, `life-buoy`, `sparkles`, `layout-dashboard`, `wrench`, `key-round`, `mail`, `smartphone`, `palette`, `lightbulb`. Default "folder". |

## Response 201

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The collection's id. |
| `name` | string | The collection's name. |
| `description` | string | The line under its name. |
| `slug` | string | The part of its address on the help center that names it. |

## Errors

| Status | Code | Message |
| --- | --- | --- |
| 400 | `BAD_REQUEST` | Input validation failed. |
| 400 | `IDEMPOTENCY_KEY_REFUSED` | Send an Idempotency-Key of 1 to 255 visible characters, or an id of your own in the body, not both. |
| 401 | `UNAUTHORIZED` | Send a valid API token as a Bearer token. |
| 403 | `HOLDER_NOT_ALLOWED` | The teammate who holds this API token's secret can't do this in the workspace now. A teammate who can should roll it in the workspace's settings. |
| 403 | `INSUFFICIENT_SCOPE` | This API token can't draft and change help articles. Create one that may in the workspace's settings. |
| 403 | `NETWORK_NOT_ALLOWED` | This API token works only from the networks it was made for. Call from one of them, or create a token for this one in the workspace's settings. |
| 403 | `NO_SEAT` | This workspace's plan has no seat for you. |
| 403 | `WORKSPACE_SUSPENDED` | This workspace is suspended. |
| 409 | `ALREADY_ADDED` | Another collection already has that id. Send a new one, or leave it out. |
| 409 | `CHANGED_MEANWHILE` | Something changed meanwhile. Try again. |
| 409 | `LIMIT_REACHED` | The help center holds 50 collections, as many as it may. Put the article in one of them. Its data holds `limit`. |
| 429 | `TOO_MANY_REQUESTS` | Too Many Requests. Its data holds `retryAfter`. |

## Example request

```sh
curl -X POST https://app.notert.io/api/v1/help-collections \
  -H "Authorization: Bearer $NOTERT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "c3a8e5f1-2b7d-4c9a-8e6f-1a3b5c7d9e02",
  "name": "Getting started",
  "description": "Set up your workspace",
  "icon": "rocket"
}'
```

## Example response 201

```json
{
  "id": "c3a8e5f1-2b7d-4c9a-8e6f-1a3b5c7d9e02",
  "name": "Getting started",
  "description": "Set up your workspace",
  "slug": "getting-started"
}
```
