#Errors
The two public APIs shape an error differently.
The server API (/api/server/v1, secret keys) nests it:
{ "error": { "code": "workspace_forbidden", "message": "This key does not belong to workspace \"acme\"" }, "request_id": "REQUEST_ID"}Some codes add fields beside code and message: insufficient_scope
carries required_scope and scopes.
The visitor API (/api/public/v1, publishable keys and visitor tokens) keeps
it flat:
{ "error": "invalid_token", "error_description": "Publishable key is missing, invalid, or revoked", "request_id": "REQUEST_ID"}HTTP 401 means invalid credentials; 403 means missing permission or, with
origin_not_allowed, a public API call that names no origin (neither an
Origin nor a Referer header; see
Publishable keys); 404 means a missing resource. Validation commonly uses 422.
On the server API, a 403 with insufficient_scope means the secret key lacks
the scope that endpoint needs. The server API also answers
409 when a request conflicts with the workspace's state, such as a phone
another account verified (phone_taken).
Retain request_id when the response includes one.
An MCP tool that is refused returns the reason as its result, and
most refusals end with a Next: line: one sentence saying which tool to call
or what to change. Treat it as the recovery step rather than retrying the same
call. A refusal that says two-step verification is required means the
workspace's owner requires
two-step verification and the
account does not have it yet.