This document identifies some of the error codes and messages that Google APIs return. Specifically, the errors listed here are in the global, or default, domain for Google APIs. Many APIs also define their own domains, which identify API-specific errors that are not in the global domain. For those errors, the value of the domain property in the JSON response will be an API-specific value, such as youtube.parameter.
This page lists errors by their HTTP status codes as defined in RFC 7231.
The sample JSON response below demonstrates how a global error is communicated:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidParameter",
"message": "Invalid string value: 'asdf'. Allowed values: [mostpopular]",
"locationType": "parameter",
"location": "chart"
}
],
"code": 400,
"message": "Invalid string value: 'asdf'. Allowed values: [mostpopular]"
}
}
Errors
- MOVED_PERMANENTLY (301)
- SEE_OTHER (303)
- NOT_MODIFIED (304)
- TEMPORARY_REDIRECT (307)
- BAD_REQUEST (400)
- UNAUTHORIZED (401)
- PAYMENT_REQUIRED (402)
- FORBIDDEN (403)
- NOT_FOUND (404)
- METHOD_NOT_ALLOWED (405)
- CONFLICT (409)
- GONE (410)
- PRECONDITION_FAILED (412)
- REQUEST_ENTITY_TOO_LARGE (413)
- REQUESTED_RANGE_NOT_SATISFIABLE (416)
- EXPECTATION_FAILED (417)
- PRECONDITION_REQUIRED (428)
- TOO_MANY_REQUESTS (429)
- INTERNAL_SERVER_ERROR (500)
- NOT_IMPLEMENTED (501)
- SERVICE_UNAVAILABLE (503)
MOVED_PERMANENTLY (301)
| Error code |
Description |
movedPermanently |
This request and future requests for the same operation have to be sent to the URL specified in the Location header of this response instead of to the URL to which this request was sent. |
SEE_OTHER (303)
| Error code |
Description |
seeOther |
Your request was processed successfully. To obtain your response, send a GET request to the URL specified in the Location header. |
mediaDownloadRedirect |
Your request was processed successfully. To obtain your response, send a GET request to the URL specified in the Location header. |
NOT_MODIFIED (304)
| Error code |
Description |
notModified |
The condition set for an If-None-Match header was not met. This response indicates that the requested document has not been modified and that a cached response should be retrieved. Check the value of the If-None-Match HTTP request header. |
TEMPORARY_REDIRECT (307)
| Error code |
Description |
temporaryRedirect |
To have your request processed, resend it to the URL specified in the Location header of this response. |
BAD_REQUEST (400)
| Error code |
Description |
badRequest |
The API request is invalid or improperly formed. Consequently, the API server could not understand the request. |
badBinaryDomainRequest |
The binary domain request is invalid. |
badContent |
The content type of the request data or the content type of a part of a multipart request is not supported. |
badLockedDomainRequest |
The locked domain request is invalid. |
corsRequestWithXOrigin |
The CORS request contains an XD3 X-Origin header, which is indicative of a bad CORS request. |
endpointConstraintMismatch |
The request failed because it did not match the specified API. Check the value of the URL path to make sure it is correct. |
invalid |
The request failed because it contained an invalid value. The value could be a parameter value, a header value, or a property value. |
invalidAltValue |
The alt parameter value specifies an unknown output format. |
invalidParameter |
The request failed because it contained an invalid parameter or parameter value. Review the API documentation to determine which parameters are valid for your request. |
invalidQuery |
The request is invalid. Check the API documentation to determine what parameters are supported for the request and to see if the request contains an invalid combination of parameters or an invalid parameter value. Check the value of the q request parameter. |
keyExpired |
The API key provided in the request expired, which means the API server is unable to check the quota limit for the application making the request. Check the Google Developers Console for more information or to obtain a new key. |
keyInvalid |
The API key provided in the request is invalid, which means the API server is unable to check the quota limit for the application making the request. Use the Google Developers Console to find your API key or to obtain one. |
lockedDomainCreationFailure |
The OAuth token was received in the query string, which this API forbids for response formats other than JSON or XML. If possible, try sending the OAuth token in the Authorization header instead. |
notDownload |
Only media downloads requests can be sent to /download/* URL paths. Resend the request to the same path, but without the /download prefix. |
notUpload |
The request failed because it is not an upload request, and only upload requests can be sent to /upload/* URIs. Try resending the request to the same path, but without the /upload prefix. |
parseError |
The API server cannot parse the request body. |
required |
The API request is missing required information. The required information could be a parameter or resource property. |
tooManyParts |
The multipart request failed because it contains too many parts |
unknownApi |
The API that the request is calling is not recognized. |
unsupportedMediaProtocol |
The client is using an unsupported media protocol. |
unsupportedOutputFormat |
The alt parameter value specifies an output format that is not supported for this service. Check the value of the alt request parameter. |
wrongUrlForUpload |
The request is an upload request, but it failed because it was not sent to the proper URI. Upload requests must be sent to URIs that contain the /upload/* prefix. Try resending the request to the same path, but with the /upload prefix. |
UNAUTHORIZED (401)
| Error code |
Description |
unauthorized |
The user is not authorized to make the request. |
authError |
The authorization credentials provided for the request are invalid. Check the value of the Authorization HTTP request header. |
expired |
Session Expired. Check the value of the Authorization HTTP request header. |
lockedDomainExpired |
The request failed because a previously valid locked domain has expired. |
required |
The user must be logged in to make this API request. Check the value of the Authorization HTTP request header. |
PAYMENT_REQUIRED (402)
| Error code |
Description |
dailyLimitExceeded402 |
A daily budget limit set by the developer has been reached. |
quotaExceeded402 |
The requested operation requires more resources than the quota allows. Payment is required to complete the operation. |
user402 |
The requested operation requires some kind of payment from the authenticated user. |
FORBIDDEN (403)
| Error code |
Description |
forbidden |
The requested operation is forbidden and cannot be completed. |
accessNotConfigured |
Your project is not configured to access this API. Please use the Google Developers Console to activate the API for your project. |
accessNotConfigured |
The project has been blocked due to abuse. See |