Skip to content

Errors

A failed request returns an error code and a message. Over HTTP, the body is JSON and the HTTP status matches the code:

{
"code": "invalid_argument",
"message": "validation error: project_id: must be a valid project ID (e.g. proj-01kmyy3t719crcnrrvk1mgyjd0)"
}

Over gRPC, the same code comes back as the gRPC status, such as InvalidArgument.

CodeHTTP statusMeaning
invalid_argument400A field is missing or invalid. The message names the field.
failed_precondition400The resource does not allow this right now, such as deleting a protected zone or a bucket that is not empty.
unauthenticated401The token is missing, invalid, or expired.
permission_denied403The token has no access to the project or method.
not_found404The resource does not exist.
already_exists409A resource with that name already exists.
resource_exhausted429A quota or rate limit is reached.
unimplemented501The method is not available yet.
internal500Something failed on our side.
  • Validation stops at the first invalid field. Fix it and send the request again to see the next one.
  • Messages for not_found, already_exists, and permission_denied are always generic, such as resource not found.
  • Only internal and rate limit exceeded (resource_exhausted with a Retry-After header) are worth retrying without changing the request. Quota errors need a free slot or a quota increase.