Errors

Status codes, error bodies and what to do about them.

On this page

Most errors are JSON with an error message and the status. Validation errors and unique-value clashes also have issues.

Error
{
  "error": "Validation Error",
  "issues": [{ "path": "email", "message": "Enter a valid email" }],
  "status": 400
}

Decide what to do from the status code. Messages are written for people and can change.

StatusMeaningWhat to do
400Something in the request is invalid.Fix it. Read issues. Don't retry unchanged.
401No key, or the key is invalid, expired or revoked, its creator left, or it is for another workspace.Check the key and the base URL.
403The key's role doesn't allow this, or the path isn't one an API key can call (including a misspelt one).Check the path, then the creator's role.
404No such object or record, or your role can't view it.Check the ID or object slug.
409A unique value is already used by another record.Find that record, or use a different value.
413An inbound webhook body is too large.Send less.
429Too many requests.Wait. Use Retry-After when present.
500Something failed in Jemero.Retry reads later. Quote requestId if you report it.
502, 503, 504Jemero is temporarily unreachable.Retry reads with increasing delays.

Authentication errors#

Bad key
{ "error": "Invalid or expired API key", "status": 401 }
No key
{ "error": "Unauthorized", "status": 401 }

A POST, PATCH or DELETE without a key may answer 403 Forbidden instead of 401.

Exceptions to the format#

  • Invalid JSON in a request body answers 400 with the plain text Malformed JSON in request body, not JSON. Don't assume every error body can be parsed.
  • Errors from the network in front of Jemero, such as a gateway timeout, may not be JSON either.
  • Search answers 200 with no results for an invalid query.

Retrying safely#

RequestSafe to retry after a timeout or 5xx?
GETYes.
PATCH with plain values, or relation add and removeUsually: it sets the same values again. It can overwrite a change someone made in between.
DELETE recordYes. A 404 on the retry can mean the first attempt worked.
RestoreYes. Records already restored are skipped.
POST create recordNo, it can create a duplicate. Look for the record first.
POST /hooksNo, it can create a second subscription.
Inbound workflow webhookWith an Idempotency-Key, one at a time.

Use exponential backoff, add a little randomness, and give up after a few attempts.