Crawl

Handling Crawl API Errors

The Crawl API uses standard HTTP status codes together with structured JSON error responses.

The exact response depends on the endpoint and the reason the request could not be completed.


Standard Error Response

Most Crawl endpoints return the following error format:

{
  "code": "string",
  "message": "string",
  "correlation_id": "string",
  "retryable": false
}

Fields

FieldDescription
codeMachine-readable error code.
messageHuman-readable description of the error.
correlation_idRequest correlation identifier when available.
retryableIndicates whether retrying the request may succeed.

HTTP Status Codes

POST /v1/crawl

Status CodeDescription
202 AcceptedCrawl job accepted successfully.
401 UnauthorizedAuthentication failed.
402 Payment RequiredInsufficient balance.
422 Validation ErrorThe request failed validation.
429 Too Many RequestsRequest rate limit exceeded.
503 Service UnavailableService is temporarily unavailable.

GET /v1/crawl/jobs

Status CodeDescription
200 OKCrawl jobs retrieved successfully.
401 UnauthorizedAuthentication failed.
422 Validation ErrorInvalid query parameters.

GET /v1/crawl/{job_id}

Status CodeDescription
200 OKCrawl job retrieved successfully.
401 UnauthorizedAuthentication failed.
404 Not FoundCrawl job was not found.
422 Validation ErrorInvalid request parameters.

DELETE /v1/crawl/{job_id}

Status CodeDescription
202 AcceptedCancellation request accepted.
401 UnauthorizedAuthentication failed.
404 Not FoundCrawl job was not found.
409 ConflictThe crawl job cannot be cancelled in its current state.
422 Validation ErrorInvalid request parameters.

Validation Errors

Requests that fail validation return an HTTPValidationError response.

The response contains a detail array describing one or more validation issues.

{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Validation Fields

FieldDescription
locLocation of the validation error.
msgDescription of the validation error.
typeValidation error type.

Example: Invalid Job State

If a crawl job cannot be cancelled because of its current state, the API returns a 409 Conflict response.

Example:

{
  "code": "INVALID_STATE",
  "message": "Crawl job 9293f045-0523-409e-a4e9-874abc663a9e is already completed and cannot be cancelled",
  "retryable": false
}

Error Fields

FieldDescription
codeMachine-readable error code.
messageExplains why the request could not be completed.
retryableIndicates whether retrying the request may succeed.

Summary

The Crawl API returns structured error responses together with standard HTTP status codes. Validation errors include additional details about invalid request parameters, while endpoint-specific errors provide information about why an operation could not be completed. Reviewing both the HTTP status code and the response body can help identify and resolve issues more efficiently.

On this page