Cancel a batch
POST /v1/batch/{batch_id}/cancel stops a batch from starting new pages. It returns 202 with status: "cancelling". Pages already in progress finish, then the batch becomes cancelled. Pages that never started stay in progress.pending and get no result records.
cancelled. Cancelling a batch that’s already final returns 409 BATCH_NOT_CANCELLABLE.
Delete a batch
DELETE /v1/batch/{batch_id} permanently deletes a finished batch and its result files, and returns {"id": "batch_9f2c8a", "deleted": true}.
- While the batch is active, and briefly after it finishes while its usage settles, delete returns
409 BATCH_NOT_COMPLETED. Cancel it if needed, wait for a final status, and retry. - Its webhook delivery can no longer be retried or replayed.
- Its
Idempotency-Keycan be used for a new batch.
Limits
Above the active-batch limit, submit returns
403 BATCH_LIMIT_EXCEEDED. Wait for a batch to finish, or cancel one. Your organization may have a custom limit. See Rate limits for how rate limits apply across the API.
Submit also needs enough credits to cover every page the batch accepts, or up to maxUrls pages for a crawl. When it can’t, it returns 401 USAGE_EXCEEDED and no batch is created. See credits.
Errors
A
500 from submit can mean two things. If the batch was never created, retrying with the same Idempotency-Key is safe. If it was created but its work couldn’t be queued, the same key returns that batch with status: "failed" and failure.code: "enqueue_failed", so submit again with a new key.
Failures of individual pages don’t produce HTTP errors. They appear as result records with status: "error"; see page error codes.
Related
- Status and results: progress, results, and retention.
- Submit a batch: idempotency and submission rules.
- Cancel a batch reference and Delete a batch reference