Errors
A failed request returns an error status with a JSON body whose error field holds the message. Most errors the request itself can fix also carry:
code: a stable, machine readable reason, such asunknown_field,invalid_operator_value,invalid_valueornot_null_violation. Match oncoderather than on the message.path: the part of the request at fault, such aswhere.stage.$in,fields.nmeorworkspaceId.hint: how to fix the request, such as the value shape an operator expects or a "did you mean" suggestion.
{
"error": "Field or relation nme doesn't exist on model companies",
"code": "unknown_field",
"path": "where.nme",
"hint": "Did you mean \"name\"?"
}400
The request cannot run as sent: an unknown field in fields, where or orderBy, an operator given a value of the wrong shape, a value the request sent that does not match its field's type (such as an id that is not a UUID), or a required field the request left out or set to null.
403
The request filters on, sorts or groups by, aggregates, or reads inside a field the token may not access (private_field, masked_field), or writes to a workspace the token is not a member of. A private field named on its own in fields answers 400 unknown_field instead, as if it did not exist.
409
A record in the same workspace already has the value the request wrote to a field that is unique within the workspace (unique_violation). A value that must be unique across all workspaces, such as a user's email address, answers 500 instead, and so does a duplicate in a model whose records only some members of the workspace can read, such as chats.
500
Something failed on Zero's side, including a database error the request did not cause. Such a body can still carry a code.
503
The database schema is briefly behind the API, usually during a deploy (schema_out_of_date). The request is fine as sent: retry it shortly.
504
The query timed out (query_timeout). Narrow where, request fewer fields, or lower limit.
Database errors answer 400 or 409 only on the record endpoints (/api/{model}), where the query runs on exactly what the request sent. Other endpoints answer such an error with 500. 503 and 504 apply on every endpoint.
A list response can also carry a warnings array next to data, naming parts of the request the API ignored or changed instead of rejecting. Each warning has a code, a path and a message.
Last updated

