# Update a project

`PATCH /api/v1/projects/{projectId}`

Renames the project or gives it another escalation policy (project admin). Incidents already open keep the policy they started with. A token may change only the policy (`alerts:write`); renaming needs a signed-in session.

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

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

## Parameters

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `projectId` | path | yes | string (uuid) | The project's id. |

## Request body

Required: yes.

`application/json`: ProjectPatch

| Field | Type | Required | Description |
|---|---|---|---|
| `escalationPolicyId` | string (uuid) \| null | no | A policy of the workspace. |
| `name` | string \| null | no |  |

## Responses

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

### 200

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
- `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

### 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
- `escalation_policy.unknown`: `escalationPolicyId` is not a policy of this workspace

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

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