Errors, by code.
Every refusal of the STARCO API has the same shape and a stable code you can branch on. This page lists each code with its HTTP status, its cause and what to do about it.
The shape of an error#
{ "success": false, "code": "version_conflict",
"error": "The measure is not at the expected version: nothing was changed.",
"current_version": 3 }code is stable: write your logic against it, never against the text of error, which is for people and can be reworded. Some codes add fields (expected, limit, current_version, errors…); the cause column names them. A 429 always carries Retry-After in seconds.
A batch of observations is different on purpose: each line is judged on its own, and the answer lists the rejected lines with a reason each (rejected[].reason). The batch is 200 when at least one line was accepted and 422 when none was. The reason codes of a line are among the ones below.
By HTTP status#
- 400, 413, 422
- The request itself is wrong: fix it before retrying. Retrying unchanged gives the same answer.
- 401
- The credential is missing, unknown, revoked or expired. Get a new one; do not retry in a loop (failed authentications are rate limited).
- 403
- The credential is fine but may not do this: a missing scope, a password that must be sent again, or something over the limits of the plan.
- 404
- No such resource for this credential. A resource of another project or account answers exactly the same.
- 409
- The request conflicts with the present state: a version that moved, or a limit reached. Read again, then decide.
- 429
- Too many requests: wait
Retry-Afterseconds. - 502, 503
- Something on our side or on a provider's. Nothing was changed; try again later.
When there is no answer at all#
Layer and measure names are lowercase, and a measure is written in a path exactly as layer.measure. A path that is not written that way (capital letters, as in /state/Room.Environment, or something after the name, as in /state/room.environment.bak) and that contains what looks like a probe for a file, such as .env, .git or .bak, is dropped at the network edge before it reaches the API: the connection is closed with no status, no error envelope and no row in your audit chain. Repeating such a request can get your address blocked for a time. If a request gets no answer at all, check how the path is written before you send it again. An ordinary mistake (an id that does not exist, a measure the twin does not have) is answered with a 404 and its code, as listed below.
117 codes, generated from the catalogue of the OpenAPI description (components.x-error-codes) when the site is built. Type in the box to filter by code, status or words.
Requests and fields#
| code | status | cause | fix |
|---|---|---|---|
validation_failed | 422 | Some fields or parameters are not valid; errors says which. | Read errors: it names each field and what is wrong with it. Fix those and send the request again. |
unknown_field | 422 | A field the operation does not accept; field names it. | Remove the field named in field, or check its spelling against the operation in the API reference. |
identifier_field_not_accepted | 422 | A field named like a real identifier (email, phone, ssn…); synthetic data only. | Do not send fields such as email, phone or ssn. Projects hold synthetic data only; use a neutral label. |
identifier_not_accepted | 422 | A text that looks like a real identifier; looks_like says what kind. | Replace the text with one that does not look like a real identifier (looks_like says what it resembled). |
not_found | 404 | No such resource in this account or project (another project's id is also not_found). | Check the id and that the key belongs to the same project: a resource of another project is also not_found. |
timestamp_invalid | 422 | A time that is not RFC 3339 or a date. | Send times as RFC 3339 with an offset (2026-11-18T21:00:00Z) or a date (2026-11-18). |
limit_invalid | 422 | limit out of its range. | Send limit within the range the operation documents. |
service_unavailable | 503 | GET /status: the database did not reply. | Try again shortly: the service could not reach its database. |
Accounts and sign-in#
| code | status | cause | fix |
|---|---|---|---|
terms_version_mismatch | 422 | accept_terms_version is not the version of GET /terms; expected has it. | Read GET /v1/terms and send its version as accept_terms_version (it is also in expected). |
link_invalid | 422 | The verification or recovery link or token is unknown, already used or expired. | Ask for a new link: sign up again with the same address, or call POST /v1/password/forgot. A link works once. |
invalid_credentials | 401 | Wrong address or password, or the address is not verified yet. | Check the address and the password. A new account must verify its address first; if you forgot the password, use POST /v1/password/forgot. |
too_many_sign_in_attempts | 429 | Too many failed sign-ins for this address, whatever the client address; wait Retry-After seconds. | Wait the seconds in Retry-After. If the password is lost, reset it with POST /v1/password/forgot. |
email_not_verified | 403 | The address of the account must be verified before subscribing. | Open the link of the verification message, then try again. |
password_required | 403 | Erasing the account or a project needs the account password. | Send the account password in the body: erasing an account or a project asks for it again. |
Tokens, keys and scopes#
| code | status | cause | fix |
|---|---|---|---|
auth_rate_limited | 429 | Too many failed authentications (unknown, revoked or expired key or console token) from this address or for this key; wait Retry-After seconds. | Stop retrying with the failing credential, wait Retry-After seconds, and fix the key or token. |
invalid_token | 401 | Missing or unknown console token. | Send Authorization: Bearer starco_dc_… with the token of POST /v1/sessions. A project key does not work on console endpoints: the message of the error says so when the request carried one. |
token_revoked | 401 | The console token was revoked. | Sign in again with POST /v1/sessions to get a new console token. |
token_expired | 401 | The console token expired; sign in again. | Sign in again: a console token lasts 12 hours. |
invalid_key | 401 | Missing or unknown project key. | Send Authorization: Bearer starco_dk_… with a key of the project. Check that the whole secret was copied. A console token (starco_dc_…) or an MCP token does not work on key endpoints: the message of the error says which one the request carried. |
key_revoked | 401 | The project key was revoked. | Create a new key in the project (POST /v1/projects/{project}/keys) and replace it where the old one was used. |
key_expired | 401 | The project key expired. | Create a new key. Keys last 30 days by default and 90 at most (ttl_days). |
insufficient_scope | 403 | The key lacks the scope the operation (or the command) needs; needs names it. | Use a key that has the scope in needs. write does not include read: ask for both when a key needs both. |
too_many_attempts | 429 | Rate limit of the bucket reached; wait Retry-After seconds. | Wait Retry-After seconds, then slow down. A project can raise its own rate up to the maximum of its plan with PATCH /v1/projects/{project}. |
Limits of the plan#
| code | status | cause | fix |
|---|---|---|---|
plan_limit_read_only | 403 | The project or twin is over the limits of the account's plan: readable, exportable and erasable, not writable; over and limit say why. | Erase what is over the limit (over and limit say what), or go back to a plan that covers it. Reading, exporting and erasing still work. |
project_limit_reached | 409 | The account has the maximum number of projects. | Erase a project you no longer need, or move to a plan with more projects. |
project_has_study | 409 | A Studio study is built on the project; it is not erased from the Dev API. | The project belongs to a Studio study: erase or archive the study in Studio first. |
key_limit_reached | 409 | The project has the maximum number of active keys and MCP tokens. | Revoke keys that are not in use (expired and revoked keys do not count), or wait for an MCP token to expire. |
twin_limit_reached | 409 | The project has the maximum number of twins. | Erase twins you no longer need (DELETE /v1/twins/{twin}), or move to a plan with more twins per project. |
schema_limit_reached | 409 | The project has the maximum number of layer schema versions. | Reuse an existing schema version, or move to a plan with more schema versions per project. |
webhook_limit_reached | 409 | The project has the maximum number of active webhooks. | Delete a webhook you no longer use (DELETE /v1/webhooks/{webhook}). |
Twins, templates and schemas#
| code | status | cause | fix |
|---|---|---|---|
unknown_template | 422 | Unknown template; expected lists them. | Use one of the ids in expected (they come from GET /v1/templates). |
template_missing | 422 | Built-in layers need a template. | Add template to the request: the built-in layers (wellness, biomarkers) need one. |
unknown_schema | 422 | No such layer schema in this project. | Check the schema id with GET /v1/schemas: it must be a schema of the same project. |
schema_layer_duplicate | 422 | Two schemas of the same layer for one twin. | Send one schema per layer. To use a newer version of a layer, send only that version. |
layer_not_enabled | 404 | The twin does not have this layer. | Read layers and custom_layers of the twin: the layer has to be switched on when the twin is created. |
unknown_kind | 422 | Unknown observation kind. | Use a kind listed by GET /v1/templates (kinds), in its exact spelling. |
batch_too_large | 413 | Too many observations or points in one request; limit says how many. | Split the batch: limit says how many lines or points one request takes. |
unknown_measure | 404 | The twin has no such measure (GET /twins/{twin}/measures). Cohort summaries (experimental): no twin of the selection has it. | List the measures of the twin with GET /v1/twins/{twin}/measures and use <layer>.<name>. |
Values of a measure#
| code | status | cause | fix |
|---|---|---|---|
measure_is_derived | 422 | A derived measure is computed, never written. | Write the measures its expression reads; the derived one is recomputed in the same transaction. |
measure_has_no_series | 422 | Only number and integer measures have a series. | Use the state endpoints for this measure: only number and integer measures keep a series. |
measure_has_no_value | 409 | incr on a measure without a value. | Set a first value with PUT …/state/{measure} before incrementing it. |
measure_not_numeric | 422 | incr on a measure that is not a number or an integer. | incr works on number and integer measures; set other types with PUT. |
increment_not_a_number | 422 | "by" is not a number. | Send by as a JSON number, not a string. |
increment_not_an_integer | 422 | "by" is not a whole number for an integer measure. | Send a whole number in by for an integer measure. |
value_missing | 422 | PUT without "value". | Send a body with value, for example {"value": 4}. To remove a value use DELETE. |
values_missing | 422 | PATCH /state without "values". | Send {"values": {"<layer>.<measure>": value}}. |
value_not_a_number | 422 | The value is not a number. | Send a JSON number (no quotes). |
value_not_an_integer | 422 | The value is not a whole number. | Send a whole number: the measure is an integer. |
value_not_a_boolean | 422 | The value is not true or false. | Send true or false without quotes. |
value_not_a_string | 422 | The value is not a string. | Send the value in quotes. |
value_not_in_enum | 422 | The value is not one of the measure's values. | Send one of the values of the measure's enum (see GET /v1/twins/{twin}/measures). |
value_not_json_object_or_array | 422 | A json measure takes an object or an array. | Send an object or an array; a single number or string needs a measure of that type. |
value_out_of_accepted_bounds | 422 | Outside the accepted bounds of the measure (what is recordable, never a reference range). | Check the unit and the value against accepted_min and accepted_max of the measure. The bounds say what can be recorded; they are not a reference range. |
value_too_long | 422 | A string longer than allowed. | Shorten the string (1,024 characters at most). |
value_too_large | 422 | A json value larger than allowed once encoded. | Make the JSON value smaller (16,384 bytes at most once encoded), or keep the bulk elsewhere and store a reference. |
value_too_deep | 422 | A json value nested deeper than allowed. | Flatten the JSON value: 8 levels of nesting at most. |
Versions, watch and transactions#
| code | status | cause | fix |
|---|---|---|---|
version_invalid | 422 | if_version or If-Match is not a strong version (e.g. "3"), or the two disagree. | Send the version as a whole number in if_version, or as If-Match: "3" (a strong ETag). If you send both, they must agree. |
version_conflict | 409 | The measure is not at the version you sent; current_version has it. | Read the measure again (current_version is in the answer), decide with the new value in hand, and retry with that version. |
watch_invalid | 422 | "watch" is not an object {"<layer>.<measure>": version}. | Send watch as an object: {"<layer>.<measure>": version}. |
watch_failed | 409 | A watched measure changed; nothing was written. | A watched measure changed, so nothing was written. Read the state again and build the request from the new versions. |
ops_missing | 422 | A transaction without "ops". | Send {"ops": [ … ]} with at least one operation. |
op_invalid | 422 | An operation that is not an object {op, measure, …}. | Each operation is an object: {"op": "set", "measure": "<layer>.<measure>", "value": …}. |
op_unknown | 422 | An operation other than set, incr, del or append. | Use set, incr, del or append. |
too_many_operations | 413 | More operations or measures than one transaction takes. | Split the transaction: 100 operations (or measures of one PATCH /state) at most. |
Series and ranges#
| code | status | cause | fix |
|---|---|---|---|
points_missing | 422 | An append without points. | Send {"points": [{"t": "…", "v": …}]} with at least one point. |
points_rejected | 422 | Every point of an append was rejected; the reasons come per point. | Read the reason of each point in the answer, fix them and send the append again; nothing was stored. |
range_invalid | 422 | from is not before to. | Make from earlier than to (to is exclusive). |
range_too_many_buckets | 422 | The range asks for more buckets than one answer gives. | Use a larger bucket or a shorter range. |
bucket_invalid | 422 | Unknown bucket; expected lists them. | Use one of the buckets in expected: 1m 5m 15m 1h 6h 1d 7d. |
agg_invalid | 422 | Unknown aggregation; expected lists them. | Use one of the aggregations in expected: avg min max sum count first last. |
agg_needs_bucket | 422 | An aggregation needs a bucket. | Add bucket to the query, or drop agg to read the raw points. |
fill_invalid | 422 | fill=null needs a bucket, from and to. | fill=null needs bucket, from and to, so that the empty buckets are known. |
declared_change_invalid | 422 | Scenarios (experimental): declared_change is missing or is not a plain decimal number. | Send declared_change as a plain decimal number in the unit of the measure, for example 0.5, -1000 or 0 for no change. |
window_days_invalid | 422 | Scenarios, fits and cohort summaries (experimental): window_days is not a whole number of days in its range; expected has the range. | Send window_days as a whole number from 14 to 90, or leave it out for 28 days. |
model_invalid | 422 | Fits (experimental): model is missing or is not one of the models; expected lists them. | Send model as one of linear, quadratic, cubic, exponential, logarithmic, power, or all to get the six side by side. The API never chooses a model for you. |
predictors_invalid | 422 | Fits (experimental): x is not one to three distinct measure names other than the measure fitted, or names more than one with a model other than linear. | Send in x one numeric measure of the same twin (layer.measure), or up to three separated by commas with model=linear; not the measure you are fitting, and none twice. Leave x out to fit over time. |
horizon_days_invalid | 422 | Fits (experimental): horizon_days is not a whole number of days from 0 to half the window, or was sent with x; expected has the range. | Send horizon_days as a whole number from 0 to half of window_days (14 for the default window), and only without x. To estimate at values of a predictor measure use at. |
at_invalid | 422 | Fits (experimental): at was sent without x, or is not up to 10 points of one plain decimal number per predictor. | Send at only together with x: up to 10 points separated by ;, each one plain decimal number per predictor separated by ,, for example at=6000;9500. |
bins_invalid | 422 | Cohort summaries (experimental): bins is not a whole number from 1 to 20; expected has the range. | Send bins as a whole number from 1 to 20, or leave it out for 8 bins. |
origin_invalid | 422 | Cohort summaries (experimental): origin is not one of the origins of a twin; expected lists them. | Send origin=api for the twins you created or origin=synthetic_cohort for the sample twins of the project, or leave it out for all of them. |
cohort_too_large | 422 | Cohort summaries (experimental): the selection has more than 200 twins; limit has the number. Nothing is computed over part of a selection. | A cohort summary reads at most 200 twins and never part of a selection. Narrow it with origin, or work in a project with fewer twins. |
Command mode#
| code | status | cause | fix |
|---|---|---|---|
command_unknown | 422 | Unknown command (POST /twins/{twin}/cmd). | Use a command of the command mode: GET SET MSET DEL INCRBY EXISTS MEASURES STATE SERIES.ADD SERIES.RANGE HISTORY. |
command_args_invalid | 422 | Wrong arguments for the command. | Check the arguments of the command in the API reference (POST /v1/twins/{twin}/cmd). |
Events and webhooks#
| code | status | cause | fix |
|---|---|---|---|
webhook_disabled | 409 | The webhook is disabled: it is never called, so its secret cannot be rotated. | A deleted webhook stays listed with active: false and is never called. Add a new one with POST /v1/webhooks; it comes with its own secret. |
cursor_invalid | 422 | "after" is not the seq of an event. | Send in after the seq of the last event you processed (0 to start from the beginning). |
wait_invalid | 422 | "wait" out of its range of seconds. | Send wait in seconds, from 0 to 10. |
types_invalid | 422 | Unknown event type. | Use event types the API emits (for example state.changed, series.appended), separated by commas. |
twin_id_invalid | 422 | twin_id is not a twin id. | Send the id of a twin (a UUID) in twin_id. |
event_types_invalid | 422 | event_types is not a list of event types. | Send event_types as a list of event types, for example ["state.changed"]. |
url_invalid | 422 | The webhook URL is missing or not a URL. | Send url with a full https address of your receiver. |
url_not_https | 422 | Webhooks only go to https URLs. | Serve your receiver over https. |
url_port_not_accepted | 422 | Webhooks only go to port 443. | Serve your receiver on port 443 (leave the port out of the URL). |
url_credentials_not_accepted | 422 | A webhook URL with user or password. | Remove user:password@ from the URL; authenticate deliveries by verifying X-Starco-Signature. |
url_fragment_not_accepted | 422 | A webhook URL with a #fragment. | Remove the #fragment from the URL. |
url_host_invalid | 422 | The host of the webhook URL is not valid. | Use a valid public host name. |
url_host_is_an_address | 422 | IP literals are not accepted; use a host name. | Use a host name instead of an IP address. |
url_host_local | 422 | Local host names are not accepted. | Use a public host name: localhost and local names are refused. To develop, read events with GET /v1/events instead. |
url_host_not_resolvable | 422 | The host name does not resolve. | Check the DNS record of the host; it has to resolve publicly. |
url_resolves_to_a_private_address | 422 | Some address of the host is not public. | Point the host name only at public addresses. |
MCP#
| code | status | cause | fix |
|---|---|---|---|
synthetic_project_required | 403 | MCP tokens only for a synthetic project. | Issue MCP tokens for a synthetic project (every Sandbox project is one). |
invalid_mcp_token | 401 | Missing, unknown, expired or revoked MCP token. | Issue a new token with POST /v1/projects/{project}/mcp-tokens: an MCP token lasts one hour. |
origin_not_allowed | 403 | MCP: an Origin that is not allowlisted. | Call the MCP endpoint from a server or a command-line client; browsers of other origins are refused. |
query_not_allowed | 400 | MCP: query strings are refused. | Remove the query string: MCP parameters go in the JSON-RPC body. |
request_too_large | 413 | MCP: the request is larger than 64 KiB. | Send a smaller JSON-RPC request (64 KiB at most). |
mcp_auth_rate_limited | 429 | MCP: too many attempts with unknown tokens. | Wait Retry-After seconds and use a valid token. |
Plans and billing#
| code | status | cause | fix |
|---|---|---|---|
billing_not_configured | 503 | Billing is on but a setting is missing on the server; missing names it. Nothing is charged. | Nothing was charged. This is on our side: write to us if it lasts. |
billing_provider_error | 502 | Stripe did not accept or did not answer the request; nothing changed. | Nothing changed. Try again in a moment. |
billing_cancel_failed | 502 | The subscription or an open checkout could not be closed in Stripe, so the account was not erased. | The account was not erased because its subscription could not be ended. Try again, or cancel the subscription in the billing portal first. |
plan_unknown | 422 | No such paid plan or period; plans and periods list them. | Use a plan and a period listed by GET /v1/billing/plans. |
plan_not_available | 409 | The price of the plan cannot be read from Stripe or does not fit; reason says which. | That plan cannot be bought right now (reason says why). Choose another period or try later. |
already_subscribed | 409 | The account has a subscription; change or cancel it in the portal. | Change or cancel the current subscription in the billing portal (POST /v1/billing/portal). |
no_billing_customer | 404 | The account has never subscribed: there is no portal for it. | There is nothing to manage yet: subscribe first with POST /v1/billing/checkout. |
no_subscription | 404 | The account has no subscription to cancel. | There is no subscription to cancel: the account is on the Sandbox plan. |
invalid_signature | 400 | Stripe webhook: the Stripe-Signature header does not verify the payload or is too old. | Only Stripe calls this endpoint; it is not part of the API you use. |
malformed_event | 400 | Stripe webhook: the payload is not a Stripe event. | Only Stripe calls this endpoint; it is not part of the API you use. |
Other codes#
| code | status | cause | fix |
|---|---|---|---|
conflict | 409 | The requested Cloud link conflicts with the current state. Refresh both sides and review before retrying; no intent is consumed by a refused confirmation. | Read the current Cloud–Dev link state. Refresh the organisations and projects, then obtain a new intent if the change is still needed. Do not retry blindly: another active link or an incompatible state may need to be resolved first. |
forbidden | 403 | The current account or Cloud intent creator no longer has the authority required for this operation. Check current membership; changing token type does not grant access. | Check the signed-in account and its current Cloud role and ownership. A different key cannot grant missing authority. Ask an organisation owner to review membership; never reuse another person’s credentials. |
Still stuck?#
If a code keeps coming back and its fix does not help, write to us with the code, the operation and the time of the request (never a key or a secret). The row of that request in your audit chain has all three.