The shape of an error
Every error from a route under/v1 has the same shape:
400 Bad Request
The token URL answers errors in a different shape.
Error codes
Treat a code you don’t recognize by its status alone.
Examples
A token without the scope a route needs:403 Forbidden
WWW-Authenticate: Bearer error="invalid_token" header:
401 Unauthorized
404 Not Found
Rate limits
Each service account can make a short burst of requests, then about one a second: 60 a minute, sustained. The limit is for each service account, so one busy system does not slow another. Past the limit, a request answers429 with a Retry-After header giving the seconds to wait:
429 Too Many Requests
- Honor
Retry-After. Wait at least that long before the next request. Don’t retry at once. - Send requests one after another, not many at a time.
- Ask for bigger pages.
limit=100reads a list in a fifth of the requests the default takes. - Reuse your access token. The token URL has a limit of its own, and one token works for an hour.