Errors & request IDs
Handle predictable failures and retain a request ID for support.
Problem details#
Resource errors use RFC 9457 application/problem+json. Read type, title and status; requestId, instance and detail are included when available. Token authentication errors use OAuth JSON error identifiers such as invalid_client and invalid_scope. Keep the returned x-request-id for troubleshooting. Do not rely on human-readable error text as a stable programmatic identifier.
| Status | Action |
|---|---|
| 400 | Correct parameters, malformed cursors, or invalid windows. |
| 401 | Obtain one fresh token and retry once. |
| 403 | Check the application’s approved scopes and your plan (problems/plan-scope). |
| 404 | Check identity and current publication state. |
| 429 / 503 | Honor Retry-After when present; use bounded backoff with jitter for transient failures. For problems/quota-exceeded, wait until x-quota-reset rather than retrying immediately. See Plans & limits. |
Retry safely#
Retry transient 429 and 503 responses with a bounded wait and jitter. Stop on problems/quota-exceeded and problems/spend-cap-reached; waiting a few seconds will not restore a period allowance or spending cap.
# Inspect Retry-After and the problem type before retrying.
# Do not retry quota-exceeded or spend-cap-reached.
curl --include --fail-with-body \
"$COLLECTALES_BASE_URL/v1/games" \
--header "authorization: Bearer $COLLECTALES_ACCESS_TOKEN"async function getWithRetry(url, token, attempts = 3) {
for (let attempt = 1; ; attempt += 1) {
const response = await fetch(url, { headers: { authorization: `Bearer ${token}` } });
if (response.status !== 429 && response.status !== 503) return response;
const problem = await response.clone().json().catch(() => ({}));
if (problem.type?.endsWith("/quota-exceeded") || attempt >= attempts) return response;
if (problem.type?.endsWith("/spend-cap-reached")) return response;
const wait = Number(response.headers.get("retry-after") ?? 1) * 1000;
if (!Number.isFinite(wait) || wait < 0 || wait > 30_000) return response;
await new Promise((resolve) => setTimeout(resolve, wait + Math.random() * 250));
}
}import random
import time
def get_with_retry(url, token, attempts=3):
for attempt in range(1, attempts + 1):
response = requests.get(url, headers={"authorization": f"Bearer {token}"}, timeout=10)
if response.status_code not in (429, 503):
return response
try:
problem = response.json() if response.content else {}
except ValueError:
problem = {}
if str(problem.get("type", "")).endswith("/quota-exceeded") or attempt == attempts:
return response
if str(problem.get("type", "")).endswith("/spend-cap-reached"):
return response
try:
wait = float(response.headers.get("retry-after", 1))
except (TypeError, ValueError):
return response
if not 0 <= wait <= 30:
return response
time.sleep(wait + random.random() / 4)Report an integration failure#
Provide the endpoint, UTC time, HTTP status, and request ID through your existing staging partner contact. Exclude access tokens, secrets, private keys, and personal collection exports. A public support channel will be published with the external beta.