REST from your database catalog
    DocumentationCheat sheetQuestionsDownloadSource
    Questions
    • How do I...?
    Start here
    • Getting started
    • What a table becomes
    • Compared with PostgREST
    Setting up
    • Tables, columns and relations
    • Security and hooks
    • Writes and procedures
    • Prefer: return=representation
    • Node, Fastify, Express
    Reading
    • select
    • /{key}
    • relation(...)
    • order
    • limit, offset
    • relation.order, .limit
    • count
    • count(), sum(), avg()...
    • "name"
    Filtering
    • eq, neq
    • gt, gte, lt, lte
    • in
    • like, ilike
    • match, imatch
    • is
    • ov, cs, cd
    • not
    • relation.column
    • or, and
    Databases
    • Supported databases
    • Adding a database
    Reference
    • Cheat sheet
    • Errors
    Reference

    Errors

    Every error code, its status, and what to change.

    Every error is a JSON object with a stable code, and a message naming the part of the request at fault when there is one:

    { "error": "unknown_column", "message": "password_hash" }

    A message never contains SQL or database text.

    The request

    CodeStatusMeans
    not_found404no such resource, or no such row, or a row you may not see
    method_not_allowed405the resource does not allow this method, or a procedure was called with another method than its own
    unknown_column400the column does not exist or is hidden
    unknown_relation400the relation does not exist
    unknown_operator400the operator is not one of eq neq gt gte lt lte in like ilike match imatch is ov cs cd
    bad_operator400the operator does not apply to the column's type
    invalid_value400the value does not fit the column's type
    bad_filter400a filter is not operator.value
    bad_logic400an or or and is not (term,term)
    bad_list400an in list is malformed, empty, or too long
    bad_name400a dotted or quoted name is malformed
    bad_syntax400unbalanced quotes or parentheses
    bad_select400a select item is malformed
    duplicate_select400a name is selected twice
    unknown_aggregate400not one of count sum avg min max
    bad_aggregate400the aggregate does not apply to the column's type
    aggregate_with_embed400a grouped read cannot embed relations
    aggregate_in_embed400an embed cannot hold aggregates
    bad_order400an order term names a to-many column, an unorderable type, or, in a grouped read, an unselected column
    not_embedded400relation.order, .limit or .offset names a relation that is not embedded
    too_deep400a path or an embed walks more relations than limits.depth
    too_many_filters400more filters than limits.filters
    bad_limit, bad_offset400not a whole number
    limit_exceeded400a limit over limits.maxPage
    bad_count400count is not exact or estimated
    unsupported400the database cannot do what was asked, e.g. a regular expression on SQLite

    Writes and procedures

    CodeStatusMeans
    bad_body400the body is not an object or a list of objects within limits.bodyRows
    body_too_large413the body is over the adapter's size limit
    mixed_columns400the rows of a body name different columns
    not_writable400the column cannot be written by this method
    filter_required400a bulk update or delete has no filter
    out_of_scope403a value contradicts the host's scope
    unknown_argument400the procedure's function takes no argument of that name
    missing_argument400an argument without a default is missing
    bad_argument400a GET procedure's argument is given twice

    The database

    CodeStatusMeans
    duplicate409a unique constraint refused the row
    reference_missing409a foreign key points to a row that does not exist
    still_referenced409the row is still referenced by another
    value_required400a required column has no value
    value_rejected400a check constraint refused the value
    forbidden403the database refused the session's role
    timeout503the statement ran past limits.timeoutMs
    internal500anything else; your onError hook receives it
    PreviousCheat sheet
    restloom - a REST API generated from your database catalog
    DocumentationDownloadSource