Error envelope
Every error response uses the same JSON shape:Error types
Full code reference
Handling
Always branch on type first, then code
type is stable, code is more specific. Pattern:
Never pattern-match message
The text is subject to change. Use type and code.
Retry policy
429 rate_limit_errorwithRetry-After: wait the indicated seconds, then retry.500 server_error: exponential backoff with jitter, max 3 retries.400,401,404,409,429 quota_exceeded: do NOT retry. Surface to your caller.
Privacy: 404 instead of 403
If you request a course ID that exists but belongs to a different account, the API returns404 not_found_error / course_not_found, not 403. This is intentional, to avoid leaking the existence of resources you do not own.