Error Codes

The Extralt API returns standard HTTP status codes with JSON error bodies.

Error response format

{
  "error": "ErrorType",
  "message": "Human-readable description of the error"
}

Authentication errors

CodeErrorDescriptionSolution
401UnauthorizedMissing or invalid API keyCheck your Authorization: Bearer <key> header
403ForbiddenAPI key does not have access to this resourceVerify the key belongs to the correct organization

Validation errors

CodeErrorDescriptionSolution
400Bad RequestRequest body is malformed or missing required fieldsCheck the request body against the API docs
404Not FoundThe requested resource does not existVerify the resource ID is correct
422Unprocessable EntityRequest is valid JSON but contains invalid valuesCheck field types and constraints

Rate limit errors

CodeErrorDescriptionSolution
429Too Many RequestsRate limit exceededWait 15 seconds and retry. See Rate Limits

Resource errors

CodeErrorDescriptionSolution
402Payment RequiredInsufficient credits to perform the operationCheck your credit balance and upgrade if needed
409ConflictResource already exists (e.g., duplicate robot build)Use the existing resource instead

Server errors

CodeErrorDescriptionSolution
500Internal Server ErrorUnexpected server errorRetry the request. If persistent, contact support
503Service UnavailableService temporarily unavailableWait and retry with exponential backoff

Handling errors in code

HTTP_STATUS=$(curl -s -o response.json -w "%{http_code}" \
  -X POST "$BASE_URL/runs" \
  -H "Authorization: Bearer $EXTRALT_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"robotId\": \"$ROBOT_ID\", \"urls\": [\"$URL\"]}")

case $HTTP_STATUS in
  401) echo "Check your API key" ;;
  402) echo "Insufficient credits" ;;
  429) echo "Rate limited, retrying in 15s..."; sleep 15 ;;
  4*) jq '.message' response.json ;;
  *) jq '.' response.json ;;
esac