# Error codes reference (https://docs.opensequence.dev/reference/error-codes)

Every stable error code OpenSequence returns, from definition validation problems to HTTP errors.

<Note>This page is generated from `the error helpers in packages/core, packages/engine, packages/auth and apps/server` by `pnpm generate`. Do not edit it by hand; change the source and regenerate.</Note>

A search for a code lands here. HTTP errors come in the [error envelope](/api/errors); validation problems come in a `problems` array with a JSON path.

## Validation problems [#validation-problems]

| Code | Severity | Example message |
| --- | --- | --- |
| `BAD_EVENT` | error | The event "…" is waited for but has no next step. |
| `BAD_OPERATOR` | error | "…" cannot be used on … (…). Use one of: …. |
| `BAD_TEMPLATE` | error | "\{\{ … \}\}" is not something a template can read. Use contact.*, attrs.*, sender.*, sequence.name or unsubscribe_url. |
| `BAD_VALUE` | error | "…" needs a value. |
| `CYCLE` | error | Steps … loop without a wait in between; the contact would never leave them. |
| `HEAVY_EMAIL` | warning | This email embeds … KB of base64 images (more than … KB). Heavy emails land in spam and get clipped; host large images over https. |
| `INVALID_DEFINITION` | error | The definition is … MB; the limit is … MB. Host large images over https instead of embedding them. |
| `MISSING_TRANSITION` | error | A … step must say where "…" goes. |
| `NO_BRIEF` | warning | This call turns on … but has no description. The agent only uses a skill when the description says when to. |
| `NO_UNSUBSCRIBE` | warning | This email has no \{\{ unsubscribe_url \}\}. Recipients cannot opt out with one click. |
| `TOO_LONG` | warning | LinkedIn takes notes of up to … characters; this one is …. It will be cut. |
| `UNKNOWN_ACTION` | error | "…" is not an action of …. Available: …. |
| `UNKNOWN_CHANNEL` | error | An outreach step needs a channel. |
| `UNKNOWN_FIELD` | error | "…" is not a field conditions can read. |
| `UNKNOWN_NODE` | error | The entry node "…" does not exist. |
| `UNKNOWN_NODE_TYPE` | error | "…" is not a node type. Available: …. |
| `UNREACHABLE_NODE` | error | "…" can never be reached from the entry step. |

## HTTP error codes [#http-error-codes]

| Code | HTTP | Message | What to do |
| --- | --- | --- | --- |
| `ALREADY_IN_SEQUENCE` | 409 | … of the … contacts are already in a sequence. Nobody was enrolled. Remove them from the selection or exit them from their current sequence first. | Remove the listed contacts (`details.conflicts`) from the selection, or exit them first with `POST /v1/enrollments/\{id\}/exit`. Nobody was enrolled. |
| `BAD_FLAG` | 422 | A flag is "global" or "channel:\<name\>". |  |
| `BAD_OUTCOME` | 422 | Give the outcome of the task, like "connected" or "no_answer". |  |
| `BAD_SCOPE` | 422 | Unknown scope: …. Use read, enroll or admin. |  |
| `BAD_TAG` | 422 | A tag is up to 24 letters, digits, dots and dashes, like v2. |  |
| `BATCH_TOO_LARGE` | 422 | At most … contacts per call. |  |
| `CONFLICT` | 409 | This owner already has a connection in another tenant. |  |
| `CREDENTIAL_INVALID` | 409 | The … credential was marked invalid by a health check. Register a new one. |  |
| `CREDENTIALS_NEEDED` | 409 | credentials_needed: connection … is …; set the channel again. |  |
| `ENDPOINT_DISABLED` | 409 | Enable the endpoint first; it is disabled. |  |
| `FROM_REQUIRED` | 422 | Say which address mail goes out from: set "from", or use the full mailbox address as the SMTP user. |  |
| `HAS_ACTIVE_ENROLLMENTS` | 409 | … contacts are still in this sequence. Exit them first, or send exit_active: true. | Exit them first, or send `exit_active: true` to exit them with reason `manual`. |
| `INSUFFICIENT_SCOPE` | 403 | This key cannot do that; it needs the "…" scope. | Use a key with the scope the route needs (`read` \< `enroll` \< `admin`). |
| `INTERNAL_ERROR` | 500 | Something went wrong on our side. Reference …. |  |
| `INVALID_DEFINITION` | 422 | The definition has errors; fix them before publishing. `details.problems` lists them. | Fix every problem in `details.problems` (each has a `path`, a `code` and a sentence) and publish again. Saving a draft with errors is allowed; publishing is not. |
| `INVALID_EVENT` | 422 | The event is not valid: … |  |
| `INVALID_SLUG` | 422 | A slug is 3 to 48 lowercase letters, digits and dashes. |  |
| `MISSING_SECRET` | 422 | An api_key credential needs api_key. |  |
| `NO_CONTACTS` | 422 | Give at least one contact. |  |
| `NO_PUBLISHED_VERSION` | 409 | This sequence has no published version yet. | Publish a version before enrolling. |
| `NOT_ACTIVE` | 409 | This enrollment is … (only active and waiting_limit enrollments can be paused). |  |
| `NOT_FOUND` | 404 | … "…" was not found. (Also: no route for this method and path.) |  |
| `NOT_PAUSED` | 409 | This enrollment is … (only paused and waiting_limit enrollments can be resumed). |  |
| `NUMBER_HAS_NO_SMS` | 422 | … cannot send SMS. |  |
| `REQUEST_ERROR` | 400, 413, 429 | A request-level error with its own message: malformed JSON (400), a body over 2 MB (413), or "Rate limit exceeded, retry in …" (429, 600 requests per minute per key, with a `Retry-After` header). |  |
| `SENDER_DISABLED` | 409 | … is disabled. |  |
| `SEQUENCE_NOT_ACTIVE` | 409 | The sequence is …. |  |
| `SLUG_TAKEN` | 409 | The slug "…" is already used. |  |
| `STALE_LOCK` | 409 | Someone else saved this draft after you loaded it. Reload and try again. | Reload the version, re-apply your change on the new `lock_version`, save again. |
| `TAG_TAKEN` | 409 | Version … already exists. |  |
| `UNAUTHORIZED` | 401 | Send a project API key as a Bearer token. / This API key is unknown or revoked. / This endpoint needs the operator token. | Send `Authorization: Bearer \<key\>`; the key must exist and not be revoked. `/v1/admin/*` wants the operator token instead. |
| `UNKNOWN_CHANNEL` | 422 | "…" is not a channel. |  |
| `UNKNOWN_EVENT_TYPE` | 422 | Unknown event type: …. Use "*" or one of …. | Use `"*"` or the types listed by `GET /v1/schema/events`. |
| `UNKNOWN_NUMBER` | 422 | … is not a number the Allo key can see. |  |
| `UNSAFE_URL` | 422 | The endpoint URL …. | Endpoint URLs must be `https`, carry no credentials, and resolve to a public address. |
| `UNSUBSCRIBE_TOKEN_EXPIRED` | 400 | This unsubscribe link has expired (links last 90 days). Ask the person to reply to the email instead, or report an opt_out with POST /v1/contacts/\{id\}/events. |  |
| `UNSUBSCRIBE_TOKEN_INVALID` | 400 | This unsubscribe token is not valid: it was not issued by this server for this project, it was altered, or its contact was deleted. |  |
| `VALIDATION_ERROR` | 400 | The request did not match the schema. `details` lists each path and message. |  |
| `VERSION_NOT_EDITABLE` | 409 | Version … is … and cannot be edited. Create a new version from it. (Also: only drafts can be deleted.) | Published and archived versions are frozen. Create a new draft from it: `POST /v1/sequences/\{id\}/versions` with `from_version`. |
| `VERSION_NOT_PUBLISHED` | 409 | Version … is …; only a published version can enroll. |  |
