API v3 error codes
Every v3 error is a Problem Details answer (RFC 9457) with a stable code. Switch on code, not on the title text.
HTTP/1.1 404 Not Found
Content-Type: application/problem+json
{
"type": "https://www.gorest.co.in/docs/api/errors#not_found",
"title": "Not Found",
"status": 404,
"code": "not_found",
"detail": "No such path in the v3 API.",
"instance": "/public/v3/nothing"
}- invalid_parameter400A query or header parameter is wrong, unknown or out of range.Read detail for the parameter; check its type and range in the reference.
- forbidden403The token lacks the scope this call needs, or the item is read only.Make a token with the scope the operation lists.
- not_found404No such path or item, or not one this token may see.Check the path and the id. Items other people own look the same as missing ones.
- method_not_allowed405The path exists, but not with this method.Use one of the methods in the Allow header.
- conflict409The change clashes with the item as it is now, or a request with the same Idempotency-Key, or a reset, is still running.Read the item again and send a change that fits it. With Retry-After, wait that many seconds and send the same request again.
- precondition_failed412The item changed since the ETag sent in If-Match.Read the item again for its new ETag, then send the change.
- unsupported_media_type415The body is not application/json, or application/merge-patch+json on PATCH.Set Content-Type to a type the operation takes.
- validation_failed422Some fields in the body fail their rules.errors lists each field as a JSON Pointer with its own code; fix those fields.
- cap_reached422Your account has as many items of this kind as it may, such as 100 users.Delete some of your items, or reset your data, then create again.
- idempotency_key_mismatch422This Idempotency-Key was used in the last 24 hours with another body.Use a new key for a new request; reuse a key only to retry the same one.
- rate_limited429Too many calls in this minute.Wait the seconds in Retry-After, then call again.
- internal_error500Something failed on the server.Try again later. If it keeps failing, tell us through the contact page.
- requested_status400The status you asked /http/status/{code} for, any 4xx or 5xx. Nothing went wrong.Nothing to fix: use it to test how your client handles that status.
The full contract, with every error each operation can send, is on the v3 reference.