Errors
Errors are RFC 9457 problem documents with a stable code. Branch on the code; the title is for people and follows your Accept-Language.
The problem document#
Every error answers with Content-Type: application/problem+json:
HTTP/1.1 409 Conflict
Content-Type: application/problem+json
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.10",
"title": "This idempotency key was already used with a different request.",
"status": 409,
"code": "idempotency_conflict",
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}codeis stable: branch on it, never ontitleor the status alone.titleis a readable message in the language of yourAccept-Languageheader:en,pt-PT,fr,deorit, English otherwise.statusrepeats the HTTP status.typeandtraceIdmay appear; quote thetraceIdwhen you ask us about a request.- Some codes add data:
featureandavailable_from,reason,limitandmax,stateandaction(see the table). - Validation problems add
errors: each field with a list of{code, message}. Payload fields are namedpayload.<key>, and values are never repeated, because they may be sensitive.
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "Some fields need your attention.",
"status": 400,
"code": "validation_failed",
"errors": {
"payload.amount": [
{
"code": "field_invalid",
"message": "This value doesn't match the field's type."
}
]
},
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}Codes#
| Status | code | When |
|---|---|---|
| 400 | validation_failed | One or more fields are missing, invalid or unknown. errors names each one; see the field codes below. |
| 400 | bad_request | The body of POST /v1/tasks isn't valid JSON. |
| 400 | request_body_invalid | The body isn't a JSON object, or a known property of POST /v1/tasks has the wrong type. |
| 400 | https_required | The request used plain HTTP. |
| 401 | unauthorized | The API key is missing, malformed, unknown or revoked. Comes with WWW-Authenticate: Bearer. |
| 402 | task_limit_reached | Your monthly tasks are used up (reason: "plan_limit", with the allowance's max and, when a plan allows more, available_from), or a cap the owner set is reached (hard_cap, spend_cap). Not counted. The Free plan never charges for extra tasks: it stops here until the next month or an upgrade. |
| 402 | not_enough_credits | The organization's free credits can't cover the most this task could cost, and automatic buying didn't cover it. With needed, available, held, reason and auto_buy (below). Not created; nothing is stored, so a retry with the same Idempotency-Key works once credits are there. |
| 402 | test_task_limit_reached | A test key's request when this calendar month's test tasks are used up. With limit, max and available_from. Not created. |
| 403 | feature_not_in_plan | Your plan doesn't include this door: intake.api, intake.webhook, or intake.test_mode for test keys; or the task type has a consensus step and your plan no longer includes routing.quorum; or it has an open step and your plan no longer includes routing.approver_at_creation or routing.human_groups; or the request sends its own chain and your plan doesn't include routing.chain_override (or that chain needs routing.backup or routing.quorum). With feature and available_from. |
| 403 | plan_limit_reached | The request sends its own chain with more steps than your plan's limit.chain_steps. With limit, max and, when a plan allows more, available_from. |
| 403 | open_steps_not_available | The task type has an open step, and open steps aren't switched on in TaskToHuman yet (your plan includes them). Not created; a task type without an open step works now. Don't retry. Also from GET /v1/task-types and GET /v1/humans. |
| 403 | quorum_not_available | The task type has a consensus step, and consensus steps aren't switched on in TaskToHuman yet (your plan includes them). Not created; a task type without a consensus step works now. Don't retry. |
| 403 | organization_on_hold | The organization is on hold and can't create tasks. |
| 403 | organization_suspended | The organization is suspended. |
| 403 | organization_pending_deletion | The organization is being deleted. |
| 403 | workspace_inactive | The workspace is over your plan's workspace limit. |
| 404 | not_found | No such task for this key (another workspace or mode, or older than your plan's history), or an unknown webhook URL. |
| 409 | idempotency_conflict | The Idempotency-Key was already used with a different body. |
| 409 | task_already_finished | Cancelling a task that is resolved, expired or cancelled. With state and action. |
| 410 | attachment_removed | Downloading a file that was removed to fit the organization's storage allowance (removed files). The task and its decision are kept. Don't retry. |
| 422 | no_owner_available | Nobody in the chain can be notified and the default action is to expire. Not counted. |
| 429 | rate_limited | Too many requests. Wait for the seconds in Retry-After. |
| 5xx | server_error | Something failed on our side. Retry with the same Idempotency-Key. |
Field codes#
Inside errors of a validation_failed:
| Field | code | When |
|---|---|---|
| any | unknown_property | POST /v1/tasks got a property it doesn't know. |
task_type | task_type_unknown | No task type with this key in the key's workspace (or it is archived). |
title | text_too_long | Over 200 characters. |
payload | payload_not_object | Not a JSON object. |
payload | payload_too_large_bytes | Over 64 KB. |
payload.<key> | field_required | A required field is missing or null. |
payload.<key> | field_invalid | The value doesn't match the field's type. |
payload.<key> | field_too_long | A text over its limit. |
payload.<key> | field_unknown | The task type has no field with this key. |
deadline_minutes | deadline_invalid | Outside 1 to 525600. |
owner | human_invalid | Not an active human of the workspace. |
owner | owner_not_allowed_on_quorum | The task type's first step is a consensus step: its people can't be replaced per task. |
owner | owner_not_allowed_on_open_step | The task type's first step is an open step: name its human in approvers. |
owner | owner_not_allowed_with_chain | The request sends its own chain: its first step is who gets the task first. |
chain | chain_override_not_allowed | The task type doesn't let a task replace its chain. The other chain codes are listed under Send your own chain. |
approvers | approver_required | An open step has no approver, or an open consensus step has fewer valid people than it needs; the message names the steps and how many people they need. Also from the webhook URL, when a step has no mapping or its path finds nothing; there every approver code is keyed approver.<step> instead. |
approvers | approver_group_empty | The group an open step chooses from has fewer people who can be asked than the step needs (one, or its approvals needed). |
approvers | approvers_too_many | More than 100 entries. |
approvers.<n> | approvers_too_many | More people for an open consensus step than its max_approvers (at the first one too many). |
approvers.<n> | approver_not_allowed | The step is not open or doesn't exist (also on a task type without open steps). |
approvers.<n> | approver_duplicate | A single open step is named more than once, or the same person is named twice for an open consensus step. |
approvers.<n> | approver_unknown | Not exactly one human of this workspace who can be asked, by id or by email address (for a group step by address: also when not in the group). The same answer whatever the reason. |
approvers.<n> | approver_not_in_group | The human, named by id, isn't a member of the step's group. |
callback_url | callback_url_invalid | Not an absolute URL. |
callback_url | callback_url_https_required | Not https. |
callback_url | callback_url_credentials | Contains a user name or password. |
callback_url | callback_url_blocked | Points at a private, internal or reserved address, a local or reserved name (.local, .internal, .test, .example…), or a host name with an underscore, a trailing dot or a last part that does not start with a letter. |
callback_url | callback_url_port_not_allowed | Uses a port other than 443 or 8443 (support can allow another port for your organization). |
callback_url | callback_url_own_host | Points at TaskToHuman itself. |
callback_url | callback_url_ip_not_allowed | The host is an IP address while callbacks are sent through Cloudflare's network (Where callbacks come from): use a host name. |
idempotency_key | idempotency_key_invalid | The Idempotency-Key header is over 255 characters. |
state | bad_request | GET /v1/tasks got an unknown state. |
Task type settings#
Task types are set up in the app, not through the API, so your code never meets these codes; the app shows them next to the setting. They are listed here so you can look one up. A save that is refused answers 400 validation_failed with the codes below under errors, or one of the problem codes in the second table.
| Field | code | When |
|---|---|---|
callbackPayload.template | payload_template_too_long | The custom payload template is over 16,000 characters (max). |
callbackPayload.template | payload_template_syntax | The template can't be read (line, column). |
callbackPayload.template | payload_template_variable_not_allowed | A variable that doesn't exist, or a field the task type doesn't have (name). |
callbackPayload.template | payload_template_sensitive_field | A sensitive field (name): they never leave in a callback. |
callbackPayload.template | payload_template_tag_not_allowed | A tag outside the allowed set (name). |
callbackPayload.template | payload_template_filter_not_allowed | A filter outside the allowed set (name). |
callbackPayload.template | payload_template_invalid_json | A sample task renders to text that isn't valid JSON (sample, position). |
callbackPayload.template | payload_template_not_object | A sample task renders to JSON that isn't an object (sample). |
callbackPayload.template | payload_template_too_large | A sample task renders to more than 256 KB (sample, max). |
github.repository | github_repository_invalid | Not a valid owner/repo. |
github.workflow | github_workflow_invalid | Neither a workflow file name ending in .yml or .yaml nor a numeric id. |
github.ref | github_ref_invalid | Not a valid branch or tag name. |
github.eventType | github_event_type_invalid | Empty, over 100 characters, or not plain printable text. |
github.inputs | github_inputs_invalid | More than 25 inputs, a name that is invalid or repeated, or a value that can't be mapped (index, reason). |
github.template | github_inputs_not_flat | An inputs template renders values that aren't text, numbers, yes or no, or null. |
github.template | github_client_payload_too_many | A client_payload template renders more than 10 top-level properties. |
github.template | github_payload_too_large | A template renders inputs over 65,535 characters, or a client_payload of 60,000 bytes or more. |
github | github_mode_incomplete | A workflow without its file or branch, or a repository event without its event type (or with inputs). |
token | github_token_invalid | The token isn't a GitHub personal access token (github_pat_… or ghp_…, 20 to 255 characters, no spaces). |
| Status | code | When |
|---|---|---|
| 403 | feature_not_in_plan | Saving a custom payload template without callback.custom_payload, or a GitHub destination without callback.github. Keeping or removing one needs no plan. |
| 409 | github_destination_missing | Adding a token before the task type's GitHub destination is saved. |
| 409 | github_token_missing | Checking the connection before a token is added. |
| 429 | rate_limited | Checking the connection more than 10 times an hour for one task type, or 30 times for the organization. |
A delivery that fails is shown on the task, with its own codes: see Callbacks and GitHub Actions.
Not enough credits#
When credits are on, a new task sets aside the most it could cost. If the organization's free credits can't cover that, the task is refused:
HTTP/1.1 402 Payment Required
Content-Type: application/problem+json
{
"title": "Not enough credits for this task.",
"status": 402,
"code": "not_enough_credits",
"needed": 4,
"available": 2,
"held": 196,
"reason": "auto_buy_off",
"auto_buy": false,
"traceId": "00-7d3e1c2b9a8f4e6d5c4b3a2918071625-1a2b3c4d5e6f7081-01"
}neededis what the task would set aside,availablethe free credits, andheldthe credits open tasks have set aside, which come back as those tasks end. The numbers are the organization's, whichever workspace the key belongs to.reasonsays what to do:auto_buy_off(an owner can turn on automatic buying in Plan › Credits),spending_cap(automatic buying reached this month's limit),top_up_failed(the automatic purchase failed, for example because the bank wants the payment confirmed: buy a pack once in Plan › Credits),purchase_limit(too many purchases today),no_credits(automatic buying can't help, for example without a paid subscription; buy a pack) orpurchases_disabled(purchases aren't open, or automatic buying is paused by TaskToHuman).auto_buyis whether the organization has automatic buying on.- What uses credits, how much a task sets aside and how to avoid this refusal: Credits.
- Tasks created through MCP never buy automatically: create the task through the API, or buy credits first.
Handling them#
- Fix and resend:
400,404,409 idempotency_conflict. Sending the same request again fails the same way. - Tell a person:
402,403,422. These need a change in the app or the plan, not in your code. - Retry later, unchanged:
429afterRetry-After,5xxwith backoff, always with the sameIdempotency-Key.