Skip to content

Errors

The API uses conventional HTTP status codes and returns a structured error envelope on every failure, so you can branch on machine-readable fields rather than parsing prose.

{
"error": {
"type": "invalid_request_error",
"code": "bad_request",
"message": "limit must be a positive integer.",
"param": "limit",
"doc_url": "https://docs.useservice.app/api/errors#bad_request"
}
}
FieldDescription
typeBroad category of the error (see below). Always present.
codeA specific, stable machine code for the failure. Always present.
messageA human-readable explanation. For logging/debugging — do not show it directly to end users, and do not match on it.
paramThe offending request parameter — present only when a specific parameter caused the error (for example a bad limit, status, or expand value). Omitted otherwise (it is not sent as null).
doc_urlA deep link to the reference entry for this code (https://docs.useservice.app/api/errors#<code>). Always present.

Every response — successes and errors alike — also echoes the Service-Version header that served it.

typeMeaning
invalid_request_errorThe request was malformed — a bad parameter, value, or filter.
authentication_errorThe API key is missing, malformed, or not valid.
rate_limit_errorYou have exceeded the rate limit.
api_errorAn unexpected error on our side. Safe to retry with backoff.

Every code the API can return, with its type, HTTP status, and when it occurs. Branch on code for precise handling; fall back to type for broad categories. The doc_url on every error links straight to its entry below (https://docs.useservice.app/api/errors#<code>).

codetypeHTTPWhen it occurs
auth_header_missingauthentication_error401No Authorization: Bearer … header was sent.
invalid_tokenauthentication_error401The API key is invalid, revoked, expired, or unknown.
bad_requestinvalid_request_error400A query parameter, filter, cursor, expand, or Service-Version value is malformed. The offending input is named in param.
not_foundinvalid_request_error404The resource does not exist for this key’s restaurant (see below).
rate_limitedrate_limit_error429You exceeded the rate limit. Honour Retry-After.
internal_errorapi_error500An unexpected error on our side. Safe to retry with backoff.

authentication_error · 401 Unauthorized. No Authorization: Bearer … header was sent. Add the header — see Authentication.

authentication_error · 401 Unauthorized. A key was supplied but is invalid, revoked, expired, or unknown. Provision a new key if yours no longer works.

invalid_request_error · 400 Bad Request. A query parameter, filter, pagination cursor, expand, or Service-Version value is malformed. The offending input is named in param. Fix the request — retrying it unchanged will fail the same way.

invalid_request_error · 404 Not Found. The resource does not exist for this key’s restaurant. See 404, not 403, across restaurants.

rate_limit_error · 429 Too Many Requests. You exceeded the rate limit. Wait for the Retry-After interval, then retry — see Rate limits.

api_error · 500. An unexpected error on our side. Safe to retry with exponential backoff; contact support if it persists.

StatusMeaning
200 OKThe request succeeded.
304 Not ModifiedReturned on a conditional GET when your If-None-Match matches. See Expanding objects for caching.
400 Bad RequestA malformed request — a bad parameter or value. Check param.
401 UnauthorizedMissing or invalid API key. See Authentication.
404 Not FoundThe resource does not exist for this key’s restaurant.
429 Too Many RequestsRate limited. See Rate limits.
500 / 503Something went wrong on our side. Retry with exponential backoff.

If you request a resource that exists but belongs to another restaurant, the API returns 404 Not Found, not 403 Forbidden. From your key’s point of view the resource simply does not exist. This avoids leaking the existence of other restaurants’ data. A valid id you “expect” to work but that returns 404 almost always means it belongs to a different restaurant (or a different key).

  • Branch on type and code, never on message.
  • Retry only 429 (after Retry-After) and 5xx (with exponential backoff).
  • Never retry 400/401/404 — they will fail again until you change the request or the key.