Skip to main content
Cloud API error responses use Content-Type: application/problem+json. Branch on type. title, detail, and hint are the human-readable text. A missing token on GET /iam/clients/me is a different body, Content-Type: application/json:

Error response fields

Every Cloud API error body in this article includes these fields: Some bodies also include the fields below. type, errors[].code, and loc stay the same in every language. exception_class stays the same as well.

unauthorized

A request with no Authorization header returns HTTP 401:
detail identifies which credential failure this is: Create an API token when the account has none. Send it on later calls as Authorization: APIKey $GCORE_API_KEY.

validation-error

HTTP 400. errors lists each invalid input. loc is the path to that input. In the responses below it starts with body. code names the failed check. A create-volume call with "source": "new-volume" and no size returns:
invalid_fields on this response is grouped under new-volume, the source value. errors[].loc is the path to read. Correct size, then send the call again. The same body sent again returns the same 400. A body that is not JSON is also validation-error. The item then has "code": "json_invalid" and "loc": ["body"]. Another validation item can include ctx. An empty object sent to the same endpoint returned "code": "union_tag_not_found" and "ctx": {"discriminator": "'source'"}.

not-found

HTTP 404. A volume id that does not exist returns:
context.resource_type and context.resource_id name the missing resource. Check the id, the project, and the region, then list that resource. A path that matches no endpoint is also not-found, with no context, exception_class, or message:

method-not-allowed

HTTP 405. PATCH on the volume collection returns:
This response has no exception_class or message. The Allow header on the same response is GET, POST, matching context.allowed_methods.

Language

Send Accept-Language to select the language of title, detail, and hint. The response sets Content-Language to that language and sends Vary: Accept-Language. With no Accept-Language, Content-Language is en. ru, de, zh, and az each returned translated title, detail, and hint for an unknown URL. The same create-volume validation with Accept-Language: ru returns:
errors[].detail and message are Russian. invalid_fields stays English (Field required). type, code, and loc are unchanged.

Next step

Include request_id when contacting Gcore support.