Most errors are JSON with an error message and the status. Validation errors and unique-value clashes also have issues.
{
"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.
| Status | Meaning | What to do |
|---|---|---|
400 | Something in the request is invalid. | Fix it. Read issues. Don't retry unchanged. |
401 | No 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. |
403 | The 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. |
404 | No such object or record, or your role can't view it. | Check the ID or object slug. |
409 | A unique value is already used by another record. | Find that record, or use a different value. |
413 | An inbound webhook body is too large. | Send less. |
429 | Too many requests. | Wait. Use Retry-After when present. |
500 | Something failed in Jemero. | Retry reads later. Quote requestId if you report it. |
502, 503, 504 | Jemero is temporarily unreachable. | Retry reads with increasing delays. |
Authentication errors#
{ "error": "Invalid or expired API key", "status": 401 }{ "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
400with the plain textMalformed 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
200with no results for an invalid query.
Retrying safely#
| Request | Safe to retry after a timeout or 5xx? |
|---|---|
GET | Yes. |
PATCH with plain values, or relation add and remove | Usually: it sets the same values again. It can overwrite a change someone made in between. |
DELETE record | Yes. A 404 on the retry can mean the first attempt worked. |
| Restore | Yes. Records already restored are skipped. |
POST create record | No, it can create a duplicate. Look for the record first. |
POST /hooks | No, it can create a second subscription. |
| Inbound workflow webhook | With an Idempotency-Key, one at a time. |
Use exponential backoff, add a little randomness, and give up after a few attempts.