---
title: Errors
description: The format of an error, what to do with each kind, and every error code the API answers.
sidebar:
  icon: circle-alert
---

Every error the API answers has the same shape, so you can handle them all in one place. Branch on the `code`, and you'll know whether to fix the request, wait or retry.

## Errors [#errors]

Every error is a JSON object with the same four fields, then the error's own:

| Field       | What it holds                                                                                                                                    |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `code`      | The error's name for programs, in snake case, such as `post_not_found`. It never changes once published, so branch on it.                        |
| `_tag`      | The same name as clients generated from the contract match on it, such as `PostNotFound`. It never changes either.                               |
| `message`   | One or two sentences in English, for the person reading a log or a terminal. Its wording may change, so never parse it.                          |
| `requestId` | The request's id, as its `X-Request-Id` header gives it.                                                                                         |
| others      | What the error says of itself, as the reference lists for each: the `status` a post has, the `limit` a plan reached, the `violations` of a post. |

> **Sign-in and MCP answer in their own format**
>
> Two families of routes answer the way their own clients expect: the sign-in
> service's routes under `/api/auth`, and the [MCP endpoint](/developers/mcp),
> which answers JSON-RPC errors. Their answers carry `X-Request-Id` too.

### What to do with an error [#handling]

The status tells you whether to fix the request, tell someone, wait or retry:

| Answer                         | What it means                                                                                              | What a client does                                                                                                                                              |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400                            | The request is wrong.                                                                                      | Fix it as `issues` or `message` say. Sending it again unchanged fails again.                                                                                    |
| 401                            | The credential does not work.                                                                              | Renew the access token with the refresh token, or use a key that works.                                                                                         |
| 402 `plan_limit_reached`       | The workspace's plan has no room.                                                                          | Tell the person: `planWithRoom` and `billingUrl` say where to go. Do not retry.                                                                                 |
| 402 `usage_allowance_reached`  | A meter of the billing account is used for the month.                                                      | Tell the person: `reason` and `billingUrl` say what to do. Otherwise, wait for `resetsAt`. Do not retry before.                                                 |
| 403                            | The credential does not allow it.                                                                          | Read `reason`. Do not retry until the scope or the permission is given.                                                                                         |
| 404                            | Nothing there for this caller.                                                                             | Check the ids and the workspace. Do not retry.                                                                                                                  |
| 409                            | What the request acts on is not in a state that allows it.                                                 | Read it again, then decide: a post already scheduled needs no second request.                                                                                   |
| 413, 422                       | The content was refused.                                                                                   | Fix it as the error's fields say: `violations`, `channelIds`, `mediaIds`, `reason`.                                                                             |
| 415 `unsupported_content_type` | The body isn't JSON, by its `Content-Type`.                                                                | Send it as JSON, with `Content-Type: application/json`.                                                                                                         |
| 429 `too_many_requests`        | The credential passed its [rate limit](/developers/conventions/rate-limits#rate-limits). Nothing was done. | Wait as `Retry-After` says, then send the request again.                                                                                                        |
| 429, another code              | A limit of one feature, such as the assistant's daily requests.                                            | Wait as the error says (`resetsAt`), or a moment for `media_import_busy`.                                                                                       |
| 500 `internal_error`           | The server failed, and recorded it.                                                                        | Retry a read. For a write, read what it acts on first: it may have been applied. Resend `posts.create` only with the same `Idempotency-Key`. Quote `requestId`. |
| 502, 503                       | The server, or a service it needs, cannot answer for now.                                                  | Retry with a growing delay, a few times, under the same `Idempotency-Key` where the endpoint takes one.                                                         |

### A request that cannot be read [#invalid-request]

A request that doesn't match what its endpoint takes answers 400 `invalid_request`, and nothing was done. The error says where:

- `issues` lists what was found wrong, 20 problems at most. Each has a `path`, which starts with the part of the request (`path`, `query`, `headers` or `body`) and goes down to the value, and a `message`. Each part is checked in turn, and the answer lists every problem in the first part found wrong: a body without three of its fields names all three. A value outside a fixed set gets a `message` that lists the values it may take, and an object whose `_tag` is none of a list's gets those `_tag` values. A list that is too short is named itself, with how many items it takes at least.
- `field` is the first problem's path, dotted.
- Reading may stop at the first problem, so fixing what's listed can reveal another.
- A query parameter the endpoint doesn't take is refused too, never ignored, so a misspelled filter can't answer as if it applied. The health checks, `/api/health` and `/api/ready`, take any query.

This request asks for more media than a page holds:

```bash
curl -i "https://api.example.com/api/v1/media?limit=500" \
  -H "Authorization: Bearer $PEAL_API_KEY"
```

It answers:

```http
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Request-Id: 019a7b2e-5c1d-7f3a-9e42-8b6d0c1a2f37
```

```json
{
  "_tag": "InvalidRequest",
  "code": "invalid_request",
  "message": "The request does not match what the endpoint takes: `issues` says what and where. Nothing was done.",
  "requestId": "019a7b2e-5c1d-7f3a-9e42-8b6d0c1a2f37",
  "field": "query.limit",
  "issues": [
    {
      "path": ["query", "limit"],
      "message": "Expected a value between 1 and 100"
    }
  ]
}
```

A value of the right shape that can't be used where it was sent, such as a cursor taken from another list, answers 400 `bad_request`.

A body in a content type the endpoint doesn't read, such as a form or plain text, answers 415 `unsupported_content_type`, and nothing was done. Send JSON, with `Content-Type: application/json`. A body sent without `Content-Type` is read as JSON.

### A request that is not allowed [#forbidden]

A 403 says why in `reason`. When a permission is missing, it names the `permission` the request takes, and the `scope` to ask for when an OAuth application lacks it. Its `message` says how to get what's missing:

| `reason`            | Why                                                                                                                                                   | What to do                                                                                                                                                      |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `missingScope`      | The member may do this, but did not give the application the scope it takes (`scope`).                                                                | The member connects the application again and allows it, or runs `peal login` for the command line.                                                             |
| `missingPermission` | The member's role, or the API key, lacks `permission`.                                                                                                | An owner or an admin changes the role, or creates a key that has it.                                                                                            |
| `personRequired`    | Only a person in their own session does this, in the web app.                                                                                         | Nothing a key or an application can do.                                                                                                                         |
| `wrongWorkspace`    | The key or the token belongs to another workspace.                                                                                                    | Use it there, or use a credential of this workspace.                                                                                                            |
| `suspended`         | The account is suspended.                                                                                                                             | Write to the people who run the server.                                                                                                                         |
| `untrustedOrigin`   | A browser sent the session's cookie from another site.                                                                                                | Send an API key or an OAuth token instead.                                                                                                                      |
| `twoStepRequired`   | The workspace requires two-step verification, and the member's account doesn't have it on. Or, on the staff console, the server requires it of staff. | The person turns it on in their [account settings](/guides/workspace/account#two-step), and the same token then works again. API keys are never refused for it. |

A token that lacks a scope also gets the challenge OAuth clients read, in `WWW-Authenticate`. Here an application without `workspace:publish` tries to cancel a post:

```bash
curl -i -X POST https://api.example.com/api/v1/posts/019a6c3f-1b72-7d3c-8e90-4f5a6b7c8d02/cancel \
  -H "Authorization: Bearer $PEAL_ACCESS_TOKEN" \
  -H "Peal-Workspace: $WORKSPACE_ID"
```

It answers:

```http
HTTP/1.1 403 Forbidden
Content-Type: application/json
WWW-Authenticate: Bearer error="insufficient_scope", scope="workspace:publish"
X-Request-Id: 019a7b2f-9a04-7b61-8c3d-2e5f7a1b4c68
```

```json
{
  "_tag": "Forbidden",
  "code": "forbidden",
  "message": "This application was not given the scope workspace:publish (schedule and publish posts), which this request takes (permission post:schedule). Its user connects it to Peal again and allows it; for Peal's command line, run peal login again and approve it.",
  "requestId": "019a7b2f-9a04-7b61-8c3d-2e5f7a1b4c68",
  "reason": "missingScope",
  "permission": "post:schedule",
  "scope": "workspace:publish"
}
```

## Error codes [#error-codes]

Here's every code the API answers, with the status it comes with. The reference lists, for each endpoint, the errors it declares and their fields. Two kinds of code can come from anywhere:

- Any endpoint can also answer the general ones: `invalid_request`, `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `gone`, `payload_too_large`, `unsupported_content_type`, `internal_error` and `service_unavailable`.
- An answer of any other status that carries no error of its own has the code `http_` followed by the status, such as `http_408`.

The codes, in alphabetical order:

| Code                               | Status | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ad_account_busy`                  | 409    | The ad account has `boosts` boosts that are running, may run or are being made, or that are paused when it's disconnected. Stop them first, then disconnect the account or turn its spending off.                                                                                                                                                                                                                                                                              |
| `ad_account_not_found`             | 404    | The workspace has no ad account with this id, or the sign-in doesn't reach the account you asked for. Check the id.                                                                                                                                                                                                                                                                                                                                                            |
| `ad_account_spend_cap_exceeded`    | 409    | The ad account's own spend cap, set at its network, leaves `room`, and the boost would commit `requested`, in minor units of `currency`. Nothing was reserved or sent. Lower the budget, or raise the cap at the network.                                                                                                                                                                                                                                                      |
| `ad_account_unusable`              | 409    | The ad account can't take a boost right now. `reason` says why: its status at the network, a sign-in to renew, or a sign-in that didn't allow running ads.                                                                                                                                                                                                                                                                                                                     |
| `ad_connection_not_found`          | 404    | The workspace has no ad network sign-in with this id, or it's another member's. Only the person who signed in picks the ad accounts it connects.                                                                                                                                                                                                                                                                                                                               |
| `ad_network_unavailable`           | 503    | The ad network didn't answer, asked Peal to slow down, or couldn't confirm a change. Nothing is known to have changed, so you can safely try again later. When the network said how long to wait, `retryAfterSeconds` gives it.                                                                                                                                                                                                                                                |
| `ad_sign_in_failed`                | 422    | A sign-in to an ad network didn't end in a connection. `reason` says why.                                                                                                                                                                                                                                                                                                                                                                                                      |
| `ad_spending_not_enabled`          | 409    | No owner of the workspace has allowed this ad account to spend through Peal. An owner turns spending on, with a monthly ceiling, in the web app.                                                                                                                                                                                                                                                                                                                               |
| `ad_spending_unavailable`          | 409    | This server offers ads for reading only, because its operator hasn't turned spending on. Nothing was spent or changed.                                                                                                                                                                                                                                                                                                                                                         |
| `ads_unavailable`                  | 404    | Ads are off on this server, or the ad network you asked for isn't set up on it. Its operator can turn them on.                                                                                                                                                                                                                                                                                                                                                                 |
| `ai_capability_not_offered`        | 422    | The provider doesn't offer this use (images, for one, come only from the providers Peal makes images with). Nothing was changed.                                                                                                                                                                                                                                                                                                                                               |
| `ai_model_required`                | 422    | Peal knows no model of this provider to test it with. Send `model`. Nothing was sent.                                                                                                                                                                                                                                                                                                                                                                                          |
| `ai_provider_address_refused`      | 422    | Peal sends a key only to a public HTTPS address on the default port, without credentials, a query or a fragment: `reason` says what this one isn't. Nothing was saved.                                                                                                                                                                                                                                                                                                         |
| `ai_provider_key_required`         | 422    | The workspace has no readable key stored for this provider, or the new address isn't the one the key was given for. Send `apiKey` again.                                                                                                                                                                                                                                                                                                                                       |
| `ai_provider_not_connected`        | 404    | The workspace hasn't connected this provider. Connect it first.                                                                                                                                                                                                                                                                                                                                                                                                                |
| `already_member`                   | 409    | The address you invited already belongs to a member of the workspace.                                                                                                                                                                                                                                                                                                                                                                                                          |
| `article_change_refused`           | 422    | The site refused to change the article's post. `code` is the site's own, or Peal's (`tokenExpired` when the website has to be reconnected). Nothing changed.                                                                                                                                                                                                                                                                                                                   |
| `article_not_found`                | 404    | The workspace has no article with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `article_rejected`                 | 422    | The article was refused, and nothing was saved. `violations` lists every reason at once, so fix them all before you send it again.                                                                                                                                                                                                                                                                                                                                             |
| `article_state_conflict`           | 409    | The article's state doesn't allow this. `state` is the one it has.                                                                                                                                                                                                                                                                                                                                                                                                             |
| `alt_text_too_long`                | 422    | The media's description is longer than Peal keeps. Shorten it.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `api_key_not_found`                | 404    | The workspace has no API key with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `approval_changed`                 | 409    | The post is waiting for an approval, but not the one this decision names. Read the post again, then decide.                                                                                                                                                                                                                                                                                                                                                                    |
| `approval_not_pending`             | 409    | The post isn't waiting for an approval.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `assistant_failed`                 | 502    | The language model gave no answer the writing assistant can offer. `reason` says why.                                                                                                                                                                                                                                                                                                                                                                                          |
| `assistant_input_rejected`         | 422    | The text you sent to the assistant is blank, or longer than `maxLength`.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `assistant_quota_exceeded`         | 429    | The workspace has used all its assistant requests for the day. `resetsAt` says when they come back.                                                                                                                                                                                                                                                                                                                                                                            |
| `assistant_secrets_not_configured` | 503    | This server can't keep a workspace's image provider key, because `PEAL_TOKEN_KEYS` isn't set. Nothing was saved.                                                                                                                                                                                                                                                                                                                                                               |
| `assistant_unavailable`            | 503    | The writing assistant is off on this server.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `audio_allowance_reached`          | 429    | The workspace has asked for as many voice-overs (`capability` `speech`) or transcripts (`transcription`) as a day allows (UTC), whatever each ended with. `dailyLimit` says how many, `resetsAt` when it can again. Nothing was asked.                                                                                                                                                                                                                                         |
| `audio_provider_failed`            | 502    | The provider the workspace chose for voice-overs or transcripts (`capability`) gave none. `reason` says why: `settingsRefused`, `addressRefused`, `redirected`, `unreachable`, `refused`, `timedOut` or `unusableAnswer`. The request counts toward the day's allowance; nothing was kept.                                                                                                                                                                                     |
| `audio_unavailable`                | 409    | The workspace makes no voice-over (`capability` `speech`) or no transcript (`transcription`). `reason` says why: `notSet` (choose a provider and a model with `PUT .../assistant/models/{capability}`) or `keyUnreadable` (connect the provider again with its key). Nothing was asked or counted.                                                                                                                                                                             |
| `bad_request`                      | 400    | A value can't be used here, such as a cursor taken from another list. Sending it again unchanged fails again.                                                                                                                                                                                                                                                                                                                                                                  |
| `billing_unavailable`              | 503    | Stripe couldn't be reached, so nothing was changed or deleted. Try again later.                                                                                                                                                                                                                                                                                                                                                                                                |
| `boost_invalid`                    | 422    | The boost breaks Peal's own rules, which are checked before anything is reserved or sent. `violations` lists every one.                                                                                                                                                                                                                                                                                                                                                        |
| `boost_key_reused`                 | 409    | The `Idempotency-Key` already names a boost of the workspace that asked for something else, and nothing was made. Send a new boost with a new key.                                                                                                                                                                                                                                                                                                                             |
| `boost_not_found`                  | 404    | The workspace has no boost with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `boost_state_conflict`             | 409    | The boost's state doesn't allow this, and `state` gives it. A boost that failed, ended or was stopped doesn't run again, and only a paused one resumes.                                                                                                                                                                                                                                                                                                                        |
| `ceiling_currency_mismatch`        | 422    | The ceiling is in a different currency from the ad account's, which `accountCurrency` gives. Nothing was changed.                                                                                                                                                                                                                                                                                                                                                              |
| `channel_account_taken`            | 409    | The workspace you're moving the channel to already has a channel for the same account, or is the workspace it's already in.                                                                                                                                                                                                                                                                                                                                                    |
| `channel_cannot_post`              | 409    | The channel is turned off, or its account has to be reconnected.                                                                                                                                                                                                                                                                                                                                                                                                               |
| `channel_not_found`                | 404    | The workspace has no channel with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `channel_set_name_taken`           | 409    | The workspace already has a channel set with this name, whatever its case. Pick another name.                                                                                                                                                                                                                                                                                                                                                                                  |
| `channel_set_not_found`            | 404    | The workspace has no channel set with this id, or with this name where the request names one.                                                                                                                                                                                                                                                                                                                                                                                  |
| `chat_connect_limited`             | 429    | The workspace tried to connect chats more than 30 times in the last hour. Try again later.                                                                                                                                                                                                                                                                                                                                                                                     |
| `chat_not_connected`               | 422    | Peal didn't connect the chat, and saved nothing. `reason` says why: `addressNotAWebhook` (the address isn't a Discord webhook's), `webhookNotFound` (Discord has no such webhook), `webhookKindNotSupported` (the webhook doesn't post messages), `credentialsRefused` (Telegram refused the bot's token), `chatNotFound` (no such chat, or the bot isn't in it), `chatKindNotSupported` (a private chat with a person) or `cannotPost` (the bot isn't allowed to post there). |
| `comment_invalid`                  | 422    | The comment can't be kept as it was sent. `problem` says what's wrong with it.                                                                                                                                                                                                                                                                                                                                                                                                 |
| `comment_not_found`                | 404    | The post has no such comment.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `comment_rule_ended`               | 409    | The comment rule has ended (`reason`), and it can't be changed any more.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `comment_rule_not_found`           | 404    | The workspace has no comment rule with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `comment_rule_not_possible`        | 422    | The comment rule can't answer. `reason` says why, and `channels` says what each channel can carry.                                                                                                                                                                                                                                                                                                                                                                             |
| `composition_allowance_reached`    | 429    | The workspace has asked for as many slide videos as a day allows (UTC), whatever each ended with. `dailyLimit` says how many, `resetsAt` when it can again. Nothing was asked.                                                                                                                                                                                                                                                                                                 |
| `composition_busy`                 | 429    | The workspace already has a slide video queued or being composed (`slideshowId`), and composes one at a time. Nothing was asked or counted: ask again once it has ended.                                                                                                                                                                                                                                                                                                       |
| `composition_needs_payment`        | 402    | Slide videos need a payment method on the workspace's billing account: an owner or an admin adds one on the billing page (`billingUrl`). Peal bills nothing for them, as the workspace's own Shotstack account pays each render. A server that doesn't bill never answers it.                                                                                                                                                                                                  |
| `composition_unavailable`          | 409    | The workspace composes no slide video. `reason` says why: `notSet` (connect Shotstack, then choose it with `PUT .../assistant/models/composition`) or `keyUnreadable` (connect it again with its key). Nothing was asked or counted.                                                                                                                                                                                                                                           |
| `connect_failed`                   | 422    | The account wasn't connected. `reason` says why.                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `connect_link_not_found`           | 404    | The workspace has no connect link with this id, or no link answers at this address.                                                                                                                                                                                                                                                                                                                                                                                            |
| `database_unavailable`             | 503    | The server can't reach its database. Try again later.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `deletion_incomplete`              | 500    | Subscriptions were cancelled at Stripe, then the deletion failed, and nothing was deleted. Send the request again.                                                                                                                                                                                                                                                                                                                                                             |
| `duplicate_post`                   | 409    | Another post sends the same content to some of the same channels less than 23 hours from this one's time, and `duplicates` names them. If you mean it, send `allowDuplicate: true`.                                                                                                                                                                                                                                                                                            |
| `external_id_taken`                | 409    | Another workspace of the partner already has this external id. `workspaceId` is that workspace.                                                                                                                                                                                                                                                                                                                                                                                |
| `feed_address_refused`             | 422    | Peal reads feeds only at public HTTPS addresses, without credentials, on the default port. `reason` says which of those this address isn't.                                                                                                                                                                                                                                                                                                                                    |
| `feed_not_found`                   | 404    | The workspace follows no feed with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `feed_reads_limited`               | 429    | The workspace's members had Peal read 30 addresses within the hour. Try again in `retryAfterSeconds` seconds.                                                                                                                                                                                                                                                                                                                                                                  |
| `feed_template_invalid`            | 422    | The template is empty, too long, or names a placeholder other than `{title}`, `{link}` and `{summary}`.                                                                                                                                                                                                                                                                                                                                                                        |
| `feed_unreadable`                  | 422    | The address couldn't be read as a feed. `reason` says why.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `follow_up_not_possible`           | 422    | The follow-up rule can't act. `reason` says why, and `channels` says what each channel can carry, kind by kind.                                                                                                                                                                                                                                                                                                                                                                |
| `follow_up_rule_ended`             | 409    | The follow-up rule has ended (`reason`), and it can't be changed any more.                                                                                                                                                                                                                                                                                                                                                                                                     |
| `follow_up_rule_not_found`         | 404    | The workspace has no follow-up rule with this id.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `follow_up_rule_taken`             | 409    | The post, or the channel, already has a follow-up rule going on, and `ruleId` names it.                                                                                                                                                                                                                                                                                                                                                                                        |
| `forbidden`                        | 403    | Your credentials work, but they don't allow this request. `reason` says why. Don't retry until the scope or the permission is given.                                                                                                                                                                                                                                                                                                                                           |
| `gone`                             | 410    | What the short link led to was turned off, and the link doesn't answer any more.                                                                                                                                                                                                                                                                                                                                                                                               |
| `idempotency_key_reused`           | 409    | You sent an `Idempotency-Key` that was used in the last 24 hours with a different body. Retrying won't help: send a new key, or the original body.                                                                                                                                                                                                                                                                                                                             |
| `image_provider_address_refused`   | 422    | Peal sends a workspace's prompts and key only to a public HTTPS address on the default port, without credentials, a query or a fragment. `reason` says which of those this address isn't.                                                                                                                                                                                                                                                                                      |
| `image_provider_key_required`      | 422    | The workspace's image provider has no stored key that can be read, or the new address isn't the one the key was given for. Send `apiKey` again.                                                                                                                                                                                                                                                                                                                                |
| `image_provider_refused`           | 502    | The workspace's own image provider refused its settings, or its key has to be typed again (`reason`, `status`). None of Peal's requests were spent.                                                                                                                                                                                                                                                                                                                            |
| `import_unreadable`                | 422    | The CSV file can't be read as posts. `problem` says why, and `column` says which column.                                                                                                                                                                                                                                                                                                                                                                                       |
| `inbox_action_failed`              | 502    | The platform didn't do what you asked about a comment, and nothing changed in Peal, so you can safely ask again. `reason` says why.                                                                                                                                                                                                                                                                                                                                            |
| `inbox_action_unavailable`         | 409    | The channel can't do this about a comment. Either its platform doesn't offer it to the account (`unsupported`), or the account has to be connected again to allow it (`reconnect`). Nothing was asked of the platform.                                                                                                                                                                                                                                                         |
| `inbox_comment_gone`               | 409    | The comment isn't on its platform any more, so you can't answer or moderate it.                                                                                                                                                                                                                                                                                                                                                                                                |
| `inbox_comment_not_found`          | 404    | The workspace has no such comment under its posts.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `inbox_conversation_not_found`     | 404    | The workspace has no such conversation. It may have gone with its channel, or be older than Peal keeps one.                                                                                                                                                                                                                                                                                                                                                                    |
| `inbox_message_not_found`          | 404    | The workspace sent no such message from Peal, or it went with its conversation.                                                                                                                                                                                                                                                                                                                                                                                                |
| `inbox_private_reply_not_found`    | 404    | The workspace sent no such private reply, or it went with its comment.                                                                                                                                                                                                                                                                                                                                                                                                         |
| `inbox_reply_not_found`            | 404    | The workspace has no such reply to a comment.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `inbox_review_not_found`           | 404    | The workspace has no such review. It may have gone from the platform, or be older than Peal keeps one.                                                                                                                                                                                                                                                                                                                                                                         |
| `inbox_review_thread_not_found`    | 404    | The workspace has no reviews for such a location.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `inbox_thread_not_found`           | 404    | The workspace has no such thread of comments.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `internal_error`                   | 500    | The server failed. A write may or may not have been applied, so read what it acts on before you send it again.                                                                                                                                                                                                                                                                                                                                                                 |
| `invalid_date_range`               | 400    | The range of days ends before it starts, or spans more days than the endpoint takes: 366, or 92 for a workspace's usage.                                                                                                                                                                                                                                                                                                                                                       |
| `invalid_request`                  | 400    | The request doesn't match what the endpoint takes, and nothing was done. `issues` says what's wrong and where.                                                                                                                                                                                                                                                                                                                                                                 |
| `invalid_time_range`               | 400    | The range of instants ends before it starts, or spans more than 62 days.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `invalid_time_zone`                | 422    | The time zone isn't an IANA zone such as `Europe/Paris`.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `invitation_not_found`             | 404    | The workspace has no pending invitation with this id.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `last_target_left`                 | 409    | The channel is the last one the post still goes out on. Cancel the post instead.                                                                                                                                                                                                                                                                                                                                                                                               |
| `live_post_not_changeable`         | 409    | The post can't be changed on that channel right now. `reason` says why: `notPublished`, `alreadyRemoved`, `noPlatformId`, `notSupported`, `changeInProgress`, `channelUnavailable`, `boostRunning`, `approvalRequired` or `deletionWindowPassed`.                                                                                                                                                                                                                              |
| `lookup_input_invalid`             | 422    | The lookup refused its input: a field it doesn't take, or a value outside what its description allows.                                                                                                                                                                                                                                                                                                                                                                         |
| `lookup_not_found`                 | 404    | The channel's platform has no lookup with this name.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `media_import_busy`                | 429    | Too many imports, or reads of uploaded files, are running at once. Ask again in a moment.                                                                                                                                                                                                                                                                                                                                                                                      |
| `media_in_use`                     | 409    | Scheduled or publishing posts or articles show the media. `postIds` lists the posts, and `articleIds` the articles.                                                                                                                                                                                                                                                                                                                                                            |
| `media_not_found`                  | 404    | The workspace has no media with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `media_source_not_public`          | 422    | Peal doesn't fetch this address, because it isn't public HTTPS on the default port.                                                                                                                                                                                                                                                                                                                                                                                            |
| `media_source_unreachable`         | 422    | The file couldn't be fetched from its address. `reason` says why.                                                                                                                                                                                                                                                                                                                                                                                                              |
| `media_store_unavailable`          | 503    | The server can't reach its media store right now. Try again later.                                                                                                                                                                                                                                                                                                                                                                                                             |
| `media_too_large`                  | 422    | The file is larger than Peal stores: 16 MiB for an image, 1 GiB for a video.                                                                                                                                                                                                                                                                                                                                                                                                   |
| `message_mentions_outside`         | 422    | The message mentions accounts outside the conversation, which a Mastodon direct status would reach too. Nothing was sent. Take out the mentions that `mentions` lists.                                                                                                                                                                                                                                                                                                         |
| `message_pending`                  | 409    | A message to this conversation is on its way, or may have gone out, and `messageId` names it. Settle it before you write another.                                                                                                                                                                                                                                                                                                                                              |
| `method_not_allowed`               | 405    | This address doesn't take this method.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `not_found`                        | 404    | Nothing answers at this address for this caller. Check the ids and the workspace.                                                                                                                                                                                                                                                                                                                                                                                              |
| `own_image_limit_reached`          | 429    | The workspace has asked its own image provider for as many images as a day allows. `resetsAt` says when it can again. None of Peal's requests were spent.                                                                                                                                                                                                                                                                                                                      |
| `own_text_limit_reached`           | 429    | The workspace has sent its own text provider as many requests as a day allows. `resetsAt` says when it can again. None of Peal's requests were spent.                                                                                                                                                                                                                                                                                                                          |
| `partner_accounts_closed`          | 403    | This server opens partner accounts only through its staff.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `partner_details_invalid`          | 422    | The partner account's name, logo address or return origins can't be used.                                                                                                                                                                                                                                                                                                                                                                                                      |
| `partner_key_not_found`            | 404    | The partner account has no key with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `partner_not_found`                | 404    | The workspace has no partner account.                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `partner_owns_workspaces`          | 409    | The workspace's partner account still owns `owned` workspaces. Delete each one through the partner API first.                                                                                                                                                                                                                                                                                                                                                                  |
| `payload_too_large`                | 413    | The request's body is larger than the endpoint takes: 8 MiB for posts, articles and the MCP endpoint, 1 MiB elsewhere, less where an endpoint says so.                                                                                                                                                                                                                                                                                                                         |
| `plan_limit_reached`               | 402    | The workspace's plan has no room for this, and `limit`, `allowed` and `used` say which limit. Don't retry. Tell the person, and `planWithRoom` and `billingUrl` say where to go.                                                                                                                                                                                                                                                                                               |
| `platform_rate_limited`            | 429    | The platform asked Peal to slow down, or one of the day's allowances is spent. When the platform said how long to wait, `retryAfterSeconds` gives it.                                                                                                                                                                                                                                                                                                                          |
| `platform_unreachable`             | 502    | The platform didn't answer, or failed, while an account was being connected.                                                                                                                                                                                                                                                                                                                                                                                                   |
| `post_content_invalid`             | 422    | The post breaks the rules of its channels' platforms. `violations` lists every one, so fix them all before you send it again.                                                                                                                                                                                                                                                                                                                                                  |
| `post_not_found`                   | 404    | The workspace has no post with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `post_not_promotable`              | 422    | The post can't be boosted there. `reason` says why: it isn't published on that channel, Peal doesn't boost on that platform, or the Instagram account was connected through Instagram Login.                                                                                                                                                                                                                                                                                   |
| `post_not_recyclable`              | 409    | The post can't repeat, and `reason` says why: it's a draft, awaiting approval or cancelled, another rule repeats it, a rule made it, or it has no channel left.                                                                                                                                                                                                                                                                                                                |
| `post_not_reviewable`              | 409    | The post is past reviewing, because it went out, is going out or was cancelled.                                                                                                                                                                                                                                                                                                                                                                                                |
| `post_status_conflict`             | 409    | The post's status doesn't allow this. `status` is the one it has, so read the post again before you decide.                                                                                                                                                                                                                                                                                                                                                                    |
| `private_reply_not_possible`       | 409    | The comment can't get a private reply. `reason` says why: the channel's own account wrote it (`ownComment`), the platform no longer shows it (`gone`), or it's older than the platform's seven days, less the hour Peal keeps in hand (`tooOld`).                                                                                                                                                                                                                              |
| `private_reply_pending`            | 409    | The comment already has its one private reply, on its way, unconfirmed or sent, and `privateReplyId` names it. If that reply failed, you can send another.                                                                                                                                                                                                                                                                                                                     |
| `queue_has_no_room`                | 409    | The queue `queueId` has no slot for the post: none at all (`noSlots`), or none free in the next 366 days (`full`).                                                                                                                                                                                                                                                                                                                                                             |
| `queue_name_taken`                 | 409    | The workspace already has a queue with this name, whatever its case. Pick another name.                                                                                                                                                                                                                                                                                                                                                                                        |
| `queue_not_found`                  | 404    | The workspace has no queue with this id. Where you add a post to its default queue, it means the workspace has no default queue.                                                                                                                                                                                                                                                                                                                                               |
| `recycling_ends_too_soon`          | 422    | The rule's `until` or `count` leaves no post to make, because the next one would be due at `firstDueAt`.                                                                                                                                                                                                                                                                                                                                                                       |
| `recycling_rule_ended`             | 409    | The rule has ended (`reason`), and it can't be changed any more. Resume it when its reason allows.                                                                                                                                                                                                                                                                                                                                                                             |
| `recycling_rule_not_found`         | 404    | The workspace has no recycling rule with this id.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `recycling_variants_invalid`       | 422    | Some text variants break the rules of the source's channels. `variants` names each one, counting from 1, with its violations.                                                                                                                                                                                                                                                                                                                                                  |
| `reply_invalid`                    | 422    | The reply to a comment is empty, or longer than its platform takes, counted the way the platform counts. Nothing was sent.                                                                                                                                                                                                                                                                                                                                                     |
| `reply_pending`                    | 409    | A reply to this comment is on its way, or may have gone out, and `replyId` names it. Settle it before you write another.                                                                                                                                                                                                                                                                                                                                                       |
| `reply_status_conflict`            | 409    | The reply isn't in a state that allows this. Only an unconfirmed reply can be confirmed, and only a sent one whose address Peal knows can be taken back.                                                                                                                                                                                                                                                                                                                       |
| `return_url_not_allowed`           | 422    | The return address isn't on an origin that the workspace's partner account registered.                                                                                                                                                                                                                                                                                                                                                                                         |
| `review_link_not_found`            | 404    | No review link has this token, or the workspace has no such review link.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `schedule_in_past`                 | 422    | The time you asked for passed more than a minute ago. Pick a time that's still ahead.                                                                                                                                                                                                                                                                                                                                                                                          |
| `service_unavailable`              | 503    | The server can't answer right now. Try again shortly.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `short_link_not_found`             | 404    | The workspace has no short link with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `signature_name_taken`             | 409    | The workspace already has a signature with this name, whatever its case. Pick another name.                                                                                                                                                                                                                                                                                                                                                                                    |
| `site_connect_limited`             | 429    | The workspace tried to connect websites too many times in the last hour (30). Try again later.                                                                                                                                                                                                                                                                                                                                                                                 |
| `site_not_connected`               | 422    | The website wasn't connected. `reason` says why: `notWordPress` (the address leads to no WordPress REST API), `addressNotAllowed` (not on HTTPS at a public address, or the home page names a REST API on another site), `credentialsRefused` (the site refused the user name and the application password) or `cannotPublish` (the user can't publish posts or upload files). Nothing was saved.                                                                              |
| `slideshow_not_found`              | 404    | The workspace asked for no slide video with this id.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `slideshow_request_rejected`       | 422    | The slide video can't be composed as asked. `reason` says why: `imageNotFound` (a slide names no ready image of the library), `imageNotSupported` (not a JPEG or a PNG), `voiceoverNotFound` (no ready audio file whose length is known), `tooLong` (over 90 seconds), or, fitted to the voice-over, `voiceoverTooLong` or `voiceoverTooShort` (each slide would last more than 10 or less than 2 seconds). Nothing was asked or counted.                                      |
| `signature_not_found`              | 404    | The workspace has no signature with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `spend_ceiling_exceeded`           | 409    | The boost would go past the monthly ceiling an owner set. The account's boosts already commit `committed`, this one would add `requested`, and the ceiling is `ceiling`, in minor units of `currency`. Nothing was reserved or sent.                                                                                                                                                                                                                                           |
| `tag_name_taken`                   | 409    | The workspace already has a tag with this name, whatever its case. Pick another name.                                                                                                                                                                                                                                                                                                                                                                                          |
| `tag_not_found`                    | 404    | The workspace has no tag with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `target_status_conflict`           | 409    | The post's status on that channel doesn't allow this. `status` is the one it has.                                                                                                                                                                                                                                                                                                                                                                                              |
| `text_provider_address_refused`    | 422    | Peal sends a workspace's drafts and key only to a public HTTPS address on the default port, without credentials, a query or a fragment. `reason` says which of those this address isn't.                                                                                                                                                                                                                                                                                       |
| `text_provider_busy`               | 429    | The workspace already has four requests under way to its own text provider, or the server has as many as it takes. Nothing was sent or counted, so ask again in a moment.                                                                                                                                                                                                                                                                                                      |
| `text_provider_key_required`       | 422    | The workspace's text provider has no stored key that can be read, or the new address isn't the one the key was given for. Send `apiKey` again.                                                                                                                                                                                                                                                                                                                                 |
| `text_provider_not_found`          | 404    | The workspace has no text provider of its own to test.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `text_provider_refused`            | 502    | The workspace's own text provider refused its settings, answered with a redirect, is at an address Peal sends nothing to, or its key has to be typed again (`reason`, `status`). None of Peal's requests were spent.                                                                                                                                                                                                                                                           |
| `too_many_channel_sets`            | 409    | The workspace already has `allowed` channel sets, the most it can keep.                                                                                                                                                                                                                                                                                                                                                                                                        |
| `too_many_comment_rules`           | 409    | The workspace already has `allowed` comment rules active or paused, the most it can keep.                                                                                                                                                                                                                                                                                                                                                                                      |
| `too_many_connect_links`           | 429    | The workspace has as many pending connect links as it can have.                                                                                                                                                                                                                                                                                                                                                                                                                |
| `too_many_feeds`                   | 409    | The workspace already follows `allowed` feeds, the most it can.                                                                                                                                                                                                                                                                                                                                                                                                                |
| `too_many_follow_up_rules`         | 409    | The workspace already has `allowed` follow-up rules active or paused, the most it can keep.                                                                                                                                                                                                                                                                                                                                                                                    |
| `too_many_invitations`             | 409    | The workspace has 100 pending invitations, the most it can have, or you, the workspace or the address invited had as many invitation emails today as a day allows.                                                                                                                                                                                                                                                                                                             |
| `too_many_queues`                  | 409    | The workspace already has `allowed` queues, the most it can keep.                                                                                                                                                                                                                                                                                                                                                                                                              |
| `too_many_recycling_rules`         | 409    | The workspace already has `allowed` recycling rules active or paused, the most it can keep.                                                                                                                                                                                                                                                                                                                                                                                    |
| `too_many_requests`                | 429    | The key or the application sent more requests than the [rate limit](/developers/conventions/rate-limits#rate-limits) allows, and nothing was done. Wait as `Retry-After` says, then send the request again.                                                                                                                                                                                                                                                                    |
| `too_many_review_links`            | 409    | The post has as many working review links as it can have. `limit` says how many.                                                                                                                                                                                                                                                                                                                                                                                               |
| `too_many_signatures`              | 409    | The workspace already has `allowed` signatures, the most it can keep.                                                                                                                                                                                                                                                                                                                                                                                                          |
| `too_many_tags`                    | 409    | The workspace already has `allowed` tags, the most it can keep.                                                                                                                                                                                                                                                                                                                                                                                                                |
| `too_many_webhook_endpoints`       | 409    | The workspace has as many webhook endpoints as it can have.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `too_many_webhook_sends`           | 429    | The workspace has sent as many test events and resends as it can in an hour.                                                                                                                                                                                                                                                                                                                                                                                                   |
| `transcription_rejected`           | 422    | The file can't be transcribed. `reason` says why: `notAudio` (only audio and video files are), `notReady` (wait until it is) or `tooLarge` (at most `maxBytes`). Nothing was asked or counted.                                                                                                                                                                                                                                                                                 |
| `unauthenticated`                  | 401    | The request has no credentials, or credentials that don't work any more. Renew the access token, or use a key that works.                                                                                                                                                                                                                                                                                                                                                      |
| `unknown_channels`                 | 422    | Some of the channels you asked for aren't the workspace's. `channelIds` lists them.                                                                                                                                                                                                                                                                                                                                                                                            |
| `unknown_media`                    | 422    | Some of the media you attached aren't the workspace's, or aren't ready. `mediaIds` lists them.                                                                                                                                                                                                                                                                                                                                                                                 |
| `unknown_tags`                     | 422    | Some of the tags you asked for aren't the workspace's. `tagIds` lists them.                                                                                                                                                                                                                                                                                                                                                                                                    |
| `unsupported_content_type`         | 415    | The request's body is in a content type the endpoint doesn't read. Send it as JSON, with `Content-Type: application/json`. Nothing was done.                                                                                                                                                                                                                                                                                                                                   |
| `unsupported_media_type`           | 422    | Peal doesn't store files of this type.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `upload_incomplete`                | 409    | The file, or one of its parts, hasn't reached the store yet.                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `upload_rejected`                  | 422    | The stored file doesn't have the size or type you declared, so it was deleted.                                                                                                                                                                                                                                                                                                                                                                                                 |
| `usage_allowance_reached`          | 402    | The billing account has used what a meter allows it this calendar month (UTC). `meter`, `allowed`, `used`, `resetsAt` and `reason` say which meter and why: `paymentMethodRequired` (add one at `billingUrl`), `ceilingReached` (raise the ceiling there, and until a first invoice is paid the meters' spend is capped), `planAllowance` (a legacy plan, so move to per-account pricing there), `paymentFailed` (update the payment method) or `notEnabled`.                  |
| `video_allowance_reached`          | 429    | The workspace has asked for as many videos as a day allows (UTC), whatever each ended with. `dailyLimit` says how many, `resetsAt` when it can again. Nothing was asked.                                                                                                                                                                                                                                                                                                       |
| `video_busy`                       | 429    | The workspace already has a video queued or being made (`generationId`), and makes one at a time. Nothing was asked or counted: ask again once it has ended.                                                                                                                                                                                                                                                                                                                   |
| `video_generation_not_found`       | 404    | The workspace asked for no video with this id.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `video_request_rejected`           | 422    | The provider chosen for videos can't make this one. `reason` says why: `aspectNotOffered`, `durationNotOffered` or `imageNotOffered` (what each provider takes is in `peal-contract/ai-providers`), or `imageNotFound` (`imageMediaId` names no ready image of the library). Nothing was asked or counted.                                                                                                                                                                     |
| `video_unavailable`                | 409    | The workspace makes no video. `reason` says why: `notSet` (choose a provider and a model with `PUT .../assistant/models/video`) or `keyUnreadable` (connect the provider again with its key). Nothing was asked or counted.                                                                                                                                                                                                                                                    |
| `voice_not_offered`                | 422    | A `voice` was named, but the provider chosen for voice-overs takes none: leave it out. Nothing was asked or counted.                                                                                                                                                                                                                                                                                                                                                           |
| `webhook_delivery_not_found`       | 404    | The endpoint has no delivery with this id, or its log doesn't keep it any more.                                                                                                                                                                                                                                                                                                                                                                                                |
| `webhook_endpoint_disabled`        | 409    | The webhook endpoint is off, so nothing is sent to it.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `webhook_endpoint_not_found`       | 404    | The workspace has no webhook endpoint with this id.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `webhook_filter_refused`           | 422    | The endpoint can't take one of its filters. `field` says which.                                                                                                                                                                                                                                                                                                                                                                                                                |
| `webhook_header_values_required`   | 422    | The new address is on another origin and the endpoint has headers. Give every header again with its value, or remove them.                                                                                                                                                                                                                                                                                                                                                     |
| `webhook_headers_refused`          | 422    | You gave a header without its value, and the endpoint has no header under that name. Give the value.                                                                                                                                                                                                                                                                                                                                                                           |
| `webhook_url_refused`              | 422    | Peal doesn't deliver to this address. `reason` says why.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `webhooks_not_configured`          | 503    | This server can't keep a signing secret, because `PEAL_TOKEN_KEYS` isn't set.                                                                                                                                                                                                                                                                                                                                                                                                  |
| `workspace_busy`                   | 409    | A post of the workspace is being published. Try again in a few minutes.                                                                                                                                                                                                                                                                                                                                                                                                        |
| `workspace_not_found`              | 404    | No workspace with this id is open to the caller.                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `workspace_required`               | 400    | The request names no workspace, and its credential belongs to none. Send the workspace's id in the `Peal-Workspace` header ([The workspace of a request](/developers/conventions#workspace)).                                                                                                                                                                                                                                                                                  |
