Errors and cookies
How the API refuses a request, and which changes the session cookie may make.
Changes made with the session cookie
Every change under the authenticated routes that carries the session cookie must come
from the dashboard: any other Origin answers 403 invalid_request. Tenant apps live
under the dashboard's own site, so the cookie's SameSite=Lax does not stop their pages,
and CORS hides only the answer. A client with a bearer token, such as the CLI, is not
asked.
Error Responses
A refusal carries a machine code, one of a fixed set, beside today's words in error and whatever the next step needs (needs, missing, suggestion, install_url, ...). The dashboard leads on from the code and never prints the words; the CLI reads error. The staff and machine routes answer with error alone.
All errors return JSON:
{
"code": "project_stopped",
"error": "description of what went wrong"
}Common status codes:
400: bad request, an input that is not valid401: unauthorized, a token that is missing or not valid403: forbidden, a role that does not allow it404: not found500: internal server error