code is stable; branch on it. message is for people and can change. details is present when there is something to add: usually an array of { field, message } for a validation error, or an object such as { "id": "..." } or { "retryAfterSec": 5, "retryable": true }.
A task that is accepted and later fails does not produce an HTTP error. It reports a task failure code instead.
Request error codes
Prefer
error.code over the status: VALIDATION_ERROR appears as both 400 and 422. A 429 means you reached one of your own limits; a 503 means we are short of capacity for the moment.
Retry-After
OnPOST /v1/async/task, POST /v1/async/task/batch and POST /v1/async/task/grid, every 429 and 503 carries a Retry-After header in seconds. Most of these codes also carry details.retryAfterSec and details.retryable: true. 429s from the edge request limit carry neither. See Credits and limits.
Payload size limits
Region rejection
REGION_UNSUPPORTED is decided before the task is queued, so you learn at once instead of waiting for the task to fail:
Batch and grid per-item errors
OnPOST /v1/async/task/batch, a well-formed request returns 200 even when items fail. The status describes the request; results[].success describes each task, and a failed item carries the same { code, message, details, timestamp } object as a request error:
QUEUE_BACKPRESSURE or SERVER_OVERLOADED carries its wait in details.retryAfterSec. The request itself fails with 400, 413, 429 or 503 only when the whole batch is refused.
POST /v1/async/task/grid reports refused points the same way in points[]. POST /v1/batches rejects the whole batch with 400 if any item is invalid, and later marks items it cannot run as REJECTED, including API_KEY_INACTIVE when the batch’s key is revoked or expired. See Batches and grids.
Task failure codes
A task that fails after it was queued ends inFAILED. Polling returns a top-level error string, not the request-error object:
response.error. The string starts with a code; branch on it.
WEB_CRAWL fails with PAGE_UNAVAILABLE when its start page cannot be read, and WEB_MAP when it finds no address on the site. Other pages a crawl could not read are listed in its failed field. A failed task is not charged.