# Create a board

`POST https://evohub.io/api/v1/board/boards`

Part of the [Board API](https://docs.evohub.io/board.md) reference · operationId `createBoard`.

Creates a board and names the caller on it. `name` is required.
`visibility` defaults to `private`. A `team` board must carry the
`team_id` it belongs to, which must be a team the caller is in; any
other visibility must not carry one.

`template` is a template `id` from
*List board templates*; left out, the
board starts with no lists.

`card_prefix` is the front of every card reference on the board
(`PLT` in `PLT-42`): 2 to 6 letters, upper-cased for you, and it can
never be changed afterwards. Left out, one is derived from the name
and stepped until it is free. A prefix you choose that another board
already uses is refused, naming that board.

A new board archives cards that have sat in its done list for 365
days; change that with `auto_archive_days` on update.

Requires the `board:board:write` scope.

## Authorization

Any one of:

- `bearerKey`
- `headerKey`

Where:

- `bearerKey`: HTTP Bearer — An EvoHub API key (`evohub_…`) as a bearer token.
- `headerKey`: API key in the header `X-API-Key` — An EvoHub API key (`evohub_…`).

## Request body (required)

Content type: `application/json`

Type: `CreateBoardRequest`

- `name` (string, required, max length 120)
- `description` (string, max length 500)
- `visibility` (Visibility, one of `private`, `team`, `org`)
- `team_id` (string): Required with `visibility` `team`, refused with any other.
- `template` (string, example `kanban-review`): A template ID; empty or left out is `blank`.
- `card_prefix` (string, example `PLT`): 2 to 6 letters. Left out, one is derived from the name.
- `auto_archive_days` (integer): Ignored on create; a new board starts at 365.

## Responses

### 201 — The board was created.

Content type: `application/json`

Type: `BoardEnvelope`

- `data` (object)
  - `board` (Board)
    - `id` (string, example `brd_5b0c8e1a2f3d4c6b9a7e0d1f2c3b4a59`)
    - `name` (string, max length 120)
    - `description` (string, max length 500)
    - `visibility` (Visibility, one of `private`, `team`, `org`)
    - `team_id` (string): The team a `team` board belongs to; `""` for every other board.
    - `card_prefix` (string, example `PLT`): The front of every card reference on the board, as in `PLT-42`. Never changes.
    - `created_by` (string)
    - `created_at` (string (date-time))
    - `updated_at` (string (date-time))
    - `auto_archive_days` (integer, min 1, max 365): Days a card may sit in the done list before it is archived. `0` in the board list.

### 400 — The body is not JSON for this endpoint (`INVALID_BODY`), or a field breaks a rule (`VALIDATION_ERROR`; the message says which): a missing or over-long `name` (120 characters), a `description` over 500 characters, an unknown `visibility`, a `team` board without `team_id` or another board with one, an unknown `template`, or a `card_prefix` that is not 2 to 6 letters or is already used.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 401 — No API key was sent, or it is unknown, revoked or expired (`UNAUTHORIZED`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 403 — The key lacks `board:board:write`, or `team_id` names a team the caller is not in (`FORBIDDEN`).

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 409 — Another board took the chosen `card_prefix` at the same moment (`PREFIX_TAKEN`). Choose another.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 429 — Too many requests (`RATE_LIMITED`). Wait for `Retry-After` seconds.

Headers:

- `Retry-After` (integer): Seconds to wait before retrying.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

### 500 — Something went wrong on EvoHub's side (`INTERNAL_ERROR`). Retry later.

Content type: `application/json`

Type: `Error`

- `error` (object, required)
  - `code` (string, required, example `NOT_FOUND`)
  - `message` (string, required, example `not found`)
  - `request_id` (string)

## Example request

```bash
curl -X POST 'https://evohub.io/api/v1/board/boards' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "name": "Platform",
  "template": "kanban-review",
  "visibility": "org",
  "card_prefix": "PLT",
  "description": "Infrastructure and platform work."
}'
```
