Status codes
Statuses here are never collapsed. An authentication failure is 401, a
permission failure 403, an exhausted balance 402, a limit 429 and a
dependency 503 — none of them is reported as a generic 400, because the
action each one needs is different and a single status would hide it.
Which codes arrive under each status
400 Bad Request — IDEMPOTENCY_KEY_REQUIRED, INVALID_CURSOR, INVALID_IDEMPOTENCY_KEY, INVALID_REQUEST, INVALID_USAGE_RANGE
401 Unauthorized — INVALID_API_KEY
402 Payment Required — INSUFFICIENT_CREDITS
403 Forbidden — API_KEY_IP_NOT_ALLOWED, INSUFFICIENT_SCOPE
404 Not Found — ASSET_CONTENT_UNAVAILABLE, ASSET_NOT_FOUND, JOB_NOT_FOUND
409 Conflict — ASSET_OWNED_BY_JOB, IDEMPOTENCY_IN_PROGRESS, IDEMPOTENCY_KEY_REUSED, JOB_IN_PROGRESS, JOB_NOT_CANCELLABLE
410 Gone — ASSET_EXPIRED, JOB_DELETED
413 Content Too Large — PAYLOAD_TOO_LARGE
415 Unsupported Media Type — UNSUPPORTED_MEDIA_TYPE
422 Unprocessable Content — UNPROCESSABLE_IMAGE
429 Too Many Requests — QUOTA_EXCEEDED, RATE_LIMITED, TENANT_QUEUE_LIMIT_EXCEEDED
500 Internal Server Error — INTERNAL_ERROR
503 Service Unavailable — MAINTENANCE_MODE, QUEUE_CAPACITY_EXCEEDED, SERVICE_UNAVAILABLE
Statuses that are not errors
The 200 row is the one that costs people a day. A failed analysis is a
successful request — the HTTP layer did its job and the work did not.
Asynchronous jobs, Error reference.
What a status never tells you
It does not tell you whether you were charged: an accepted submission that
fails during analysis is a 202 followed by a 200, and
Credits and usage is where that is written down. It also
does not tell you whether the job survived — a 503 on a poll is about the
poll, never about the job.