Skip to main content

API error format and codes

Check the HTTP status and error body when an API request fails. Authentication and authorization failures return 401.

Error envelope​

{"code":401,"message":"Not authenticated","result":"error"}
FieldMeaning
codeNumeric response code
resultError marker where included by the response wrapper
messageHuman-readable explanation
errorsValidation-dependent details
error_detailsAdditional validation details, including bad values where provided
bad_fieldsResource-authorization-dependent field details

Optional details vary by operation. Do not assume every error contains every field.

Status codes​

CodeMeaning and action
400Invalid arguments or rejected configuration; correct the reported fields
401Authentication or permission denied; check credential, context, expiry and grants
404Resource or authorized parent is unavailable; check the resource and context
409Conflict, including domain or configuration conflicts; inspect the operation's message
412Version precondition failed; read, reconcile and retry with the current version
500Server error; retry as appropriate and contact your account manager if it persists
503Operation temporarily unavailable; inspect the error message before retrying

These codes are operation-dependent. See versions and concurrency. Do not substitute 403 for the API's 401 authentication response.

TODO(verify): Confirm whether a stable machine-readable error identifier exists beyond numeric code and operation-specific validation details.