Errors

Every error has the same shape, a code to branch on and a message that says what to change.

Reference

At a glance

Every error answers with an HTTP status and the same body:

json
{ "error": { "code": "missing_permission", "message": "This API key may not do this. Give it the \"registers:rows:change\" permission in Settings → API keys." } }

Branch on code. Log message: it says what to change. When an error comes back, nothing was changed.

Error codes

StatusCodeWhat it means
400invalid_bodyThe body is not JSON, has a field the action does not know, or a value is wrong
400ambiguous_registerTwo registers share that name; send the id
400unknown_columnA where or sortBy names no column; the message lists them
400removal_not_allowedA delete was sent as a change; use write_record/delete
400refusedAlchex could not make the change; the message says why
400The action's own codeSuch as structure_differs or create_with_name_only; see each tool's page
401missing_keyNo key was sent
401invalid_keyThe key is wrong, revoked or expired
402AI_ALLOWANCE_EXCEEDEDThe workspace has no AI credit left
403missing_permissionThe key lacks a permission; the message names it
403not_allowed_for_api_keyNo key may do this, or the body is not the action you called
403refusedA key is not allowed this change, such as deleting a document
403no_teamThe workspace has no active team
404tool_not_foundNo action has that name, or none is open to keys
404not_foundNothing with that name or id is in reach: a read, or a write to a finding, project, task, milestone or folder
404register_not_foundA write found no register with that name or code
404row_not_foundNo row has that id in this register
413body_too_largeThe body is over 200 KB
413answer_too_largeThe answer would be too large; ask for less
429rate_limitedOver 60 requests a minute; wait Retry-After seconds
503unavailableAlchex cannot check keys right now; try again shortly

What to retry

StatusDo
429Wait the Retry-After seconds, then send it again
503Wait a few seconds, then send it again
402Add AI credit, then send it again
400, 401, 403, 404, 413Fix what the message says first; the same request fails again

When you retry an add, send the same idempotency key, so no row is added twice.