# Create a project

`POST /api/v1/workspaces/{workspaceId}/projects`

Creates an empty project. Workspace owner or admin; a token needs `projects:write` and cannot be one limited to a project.

Sign-in: a dashboard session, an API token with `projects:write` or the `monitorly` CLI's sign-in with `projects:write`.

Section: Projects. Operation id in openapi.json: `create_project`.

## Parameters

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `workspaceId` | path | yes | string (uuid) | The workspace's id. |
| `Idempotency-Key` | header | no | string | Any 1–255 characters, for example a UUID per intended action. A retry with the same key and the same request answers the stored response and creates nothing again; the same key with another request answers `422 request.idempotency_key_reused`. Keys are kept for 24 hours. |

## Request body

Required: yes.

`application/json`: ProjectInput

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes |  |

## Responses

Errors are `application/problem+json` (`Problem`); branch on `type`.

### 201

The project.

`application/json`: ProjectView

| Field | Type | Required | Description |
|---|---|---|---|
| `brokenChannels` | integer | yes | Broken Telegram chats and broken channels of every other kind. |
| `brokenChats` | integer | yes |  |
| `escalationPolicyId` | string (uuid) | yes | The escalation policy of the project's incidents (a check may use another, `CheckView.escalationPolicyId`). |
| `id` | string (uuid) | yes |  |
| `name` | string | yes |  |
| `role` | ProjectRole | yes | The caller's effective role. |
| `statusPublicBase` | string \| null | no | Where status pages are served (`MONITORLY_STATUS_PUBLIC_URL`, `https://status.example.com`): a page's address is `<this>/<slug>`, known before any page exists; null without the setting. Always sent; optional in the schema because it was added after the first clients (2026-11-15). |
| `workingChannels` | integer | yes | Alert channels that receive the project's alerts: the active Telegram chats and the confirmed channels of every other kind the project picked that are not broken (added 2026-11-12). 0: the project's alerts go nowhere. |
| `workingChats` | integer | yes | Telegram chats the project picked that are not broken; 0 shows the "alerts are not delivered" banner. |
| `workspaceId` | string (uuid) | yes |  |

### 400

Bad Request.

- `request.malformed`: the body or a parameter is not of the expected shape
- `request.idempotency_key_invalid`: the key is empty or longer than 255 characters
- `auth.credentials_conflict`: the request carries both a session cookie and a token

### 401

Unauthorized.

- `auth.unauthenticated`, `auth.session_expired`: no session, or it ended
- `token.invalid`: the token is malformed, unknown, revoked or expired, or its creator left the workspace

### 403

Forbidden.

- `auth.forbidden`: your role is too low for this
- `token.scope_missing`: the token lacks the scope this needs; `detail` names it
- `request.origin_mismatch`, `request.header_required`: a changing request with a session comes from another site or lacks `X-Monitorly-Request: 1`

### 404

Not Found.

- `request.not_found`: it does not exist, or you cannot see it

### 409

Conflict.

- `quota.projects_reached`: the workspace has as many projects as its plan allows

### 413

Payload Too Large.

- `request.too_large`: the body is larger than 256 KiB

### 422

Unprocessable Entity.

- `field.required`, `field.too_long`, `field.invalid`: a field breaks a rule; `errors` points at it

### 429

Too Many Requests.

- `token.rate_limited`: more than 10 requests a second with this token
- `session.rate_limited`: more than 5 changes a second from your sessions
- `token.create_limited`: more than 30 resources created within an hour from one token; `Retry-After` in seconds

Schemas named above are listed with their fields in [the schema list](https://docs.monitorly.cloud/api/reference/schemas.md).
