Skip to content
gist.link ↗

Errors & rate limits

POST /oauth/token failures follow RFC 6749 §5.2: a non-200 status with a JSON body:

{
"error": "invalid_scope",
"error_description": "This key has no operation scopes for \"pay\"."
}
error Meaning Fix
invalid_request Malformed request or missing parameter. Check grant_type and parameter names.
invalid_client Unknown key id, wrong secret, or the key is revoked / expired / its IAM user is disabled. Verify credentials; rotate if the secret is lost; check the key’s status in Settings.
invalid_target Missing/unknown audience, or an IAM credential requested suite/auth. Pass one product key, e.g. audience=support.
invalid_scope Requested scope exceeds the key’s grants, or the key holds no grants for the requested audience. Narrow the scope request or extend the IAM user’s grants.
unsupported_grant_type grant_type isn’t one the endpoint supports. Use client_credentials for IAM keys.

Token responses are sent with Cache-Control: no-store — never cache them beyond expires_in.

GraphQL requests generally return HTTP 200 even on failure; check the errors array:

{
"errors": [
{
"message": "Access denied: missing permission \"pay:mutation:createInvoice\".",
"extensions": { "category": "authorization" }
}
],
"data": null
}

Categories you’ll encounter:

Category Cause Fix
Authentication (or HTTP 401) Missing/expired/invalid Bearer token, or token minted for a different audience. Re-exchange your key; confirm audience matches the API you’re calling.
Authorization Token lacks the operation’s required permission. Grant the permission shown on the operation’s reference page to the IAM user/key, then re-exchange.
User input Invalid arguments — bad ids, malformed dates, constraint violations. The message states the offending field; correct and retry.
Internal Unexpected server error. Safe to retry with backoff; contact support if persistent.

Partial data is possible: a response can carry both data and errors when only part of a query failed.

Every organization has suite-wide API request budgets, measured in GraphQL requests per minute across all product APIs combined. Two separate budgets apply, and they never share a counter:

Budget Applies to How it’s sized
Machine IAM API keys and service clients An org-wide requests/minute value defined by your plan.
User Human (browser-session) traffic A per-seat requests/minute value defined by your plan, multiplied by your organization’s seat count.

Every plan’s limits are finite — there is no unlimited tier. Enterprise customers can have custom per-organization budgets negotiated with sales, which override the plan values.

Exceeding a budget returns HTTP 429 with a Retry-After header (seconds until the current one-minute window resets) and a GraphQL-style body:

{
"errors": [
{
"message": "Rate limited: this organization's machine (IAM/service) API budget (300 requests/minute across the suite) is exhausted. Retry after 23 seconds.",
"extensions": { "code": "RATE_LIMITED", "retry_after_seconds": 23 }
}
]
}

Notes:

  • Budgets ride inside your access token, so plan changes and enterprise overrides take effect as tokens refresh (within ~20 minutes).
  • The token endpoint (/oauth/token) is additionally rate-limited per IP with a sliding window. Exceeding it returns HTTP 429 with the OAuth error code slow_down and no Retry-After header. Don’t mint a token per request — cache each token and reuse it until shortly before expires_in elapses. One token per audience per ~15 minutes is the intended pattern.
  • Repeated failed credential exchanges are throttled separately and can temporarily lock out further attempts — treat slow_down as a signal to back off, not retry.
  1. Cache tokens per audience; refresh when less than ~60 seconds of lifetime remains.
  2. On authentication errors, re-exchange once, then fail loudly (the key may be revoked).
  3. On 429 with extensions.code = RATE_LIMITED, wait Retry-After seconds before retrying. On other 429s and internal errors, back off exponentially with jitter; never retry user-input errors.
  4. Use idempotency keys wherever a mutation offers them, so retries are safe.