This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dws-data-extraction/errors.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Error handling

When a request fails, the Nutrient DWS Data Extraction API returns an error response with an HTTP status code and a human-readable message. The response includes structured details when available.

Error response format

The API uses this response shape for most errors:

interface ParseErrorResponse {
/** HTTP status code (4xx or 5xx) */
status: number;
/** Unique request identifier for debugging / support */
requestId: string;
/** Human-readable error summary */
errorMessage: string;
/** Structured error details (present on validation and processing errors) */
errorDetails?: {
/** Error origin: "request", "processing", etc. */
source: string;
/** Stable machine-readable error code for client branching. */
code?: string;
/** List of invalid fields */
failingPaths?: { path: string; details: string }[];
};
}

The response can include these fields:

  • requestId — Always present. Include this value when you contact Support. For support details, refer to the support guide.
  • errorMessage — Short summary of the error.
  • errorDetails.source — Error origin, such as request for validation errors, processing, or maestro for backend failures.
  • errorDetails.code — Machine-readable error code for client branching, such as invalid_request or maestro_error.
  • errorDetails.failingPaths — Invalid fields with JSON paths and descriptions.

HTTP status codes

Use the HTTP status code to decide how your client should handle an error.

StatusMeaningDescription
400Bad requestMalformed or empty input, unsupported file format, password-protected PDF, invalid parameters, missing file or URL, or schema error.
401UnauthorizedMissing, invalid, or expired API token.
402Payment requiredThe account’s balance can’t cover the requested operation.
408Request timeoutData Extraction API request exceeded the five-minute processing limit.
409ConflictAn Idempotency-Key reused with a different request, or a run operation that its current state doesn’t allow.
410GoneThe stored run has passed its retention window.
413Payload too largeFile exceeds the maximum supported size.
422Unprocessable entityRemote URL couldn’t be downloaded or was rejected by the extract endpoint.
429Too many requestsRate limit exceeded for your subscription.
500Internal server errorBackend processing failure. Retry or contact Support.
503Service unavailableProcessing backend is temporarily unavailable. Retry later.

Error examples

The following examples show the response format for common error categories.

Validation or input error (400)

The API returns this error when the request has invalid parameters or the input document can’t be processed as provided. This includes malformed or empty files, unsupported file formats, and password-protected PDFs:

{
"status": 400,
"requestId": "req_err_001",
"errorMessage": "The request is malformed",
"errorDetails": {
"source": "request",
"code": "invalid_request",
"failingPaths": [
{
"path": "$.file",
"details": "unsupported file format: video/mp4"
},
{
"path": "$.mode",
"details": "invalid mode: 'turbo'. Expected: text, structure, understand, agentic"
}
]
}
}

Insufficient balance (402)

The API returns this error when the account can’t fund the request. The parse and extract endpoints return the same 402 body, which differs from the shape of other errors:

{
"error": "wallet_depleted",
"message": "Your organization cannot fund this operation.",
"currency": "USD",
"balance": "0.00",
"requestId": "<request-id>"
}
  • error — Machine-readable reason, such as wallet_depleted or monthly_limit_reached. More reasons can be added, so treat unknown values as a generic insufficient balance error.
  • message — Human-readable summary. Its wording can change, so don’t branch on it.
  • currency — Currency of balance. Always USD.
  • balance — The account’s remaining balance, as a decimal string. It can be missing if the balance couldn’t be read.
  • requestId — Include this value when you contact Support.

Requests use your plan’s included monthly usage first. Once that runs out, they’re charged to your wallet. The API returns this error when neither can cover the request — for example, once your wallet reaches the monthly limit you set. To fund more usage, add to your wallet or raise its limit in the dashboard.

Accounts still on a credits plan get the earlier 402 body. Branch on the HTTP status code, 402, so your error handling works for both.

Processing error (500)

The API returns this error when the backend encounters an internal service error during extraction. Input-specific failures — such as malformed, empty, unsupported, or password-protected PDFs — return 400 instead:

{
"status": 500,
"requestId": "req_err_003",
"errorMessage": "Processing failed. Please retry or contact support with the requestId.",
"errorDetails": {
"source": "maestro",
"code": "maestro_error"
}
}

Extract endpoint errors

The extract endpoint uses the same error shape as parse, plus cases specific to schema-driven extraction. For endpoint details, refer to the extract endpoint guide.

Schema validation errors (400)

The API rejects a request when the schema is missing or uses an unsupported structure. The failingPaths entry points to $.schema:

{
"status": 400,
"requestId": "req_err_002",
"errorMessage": "The request is malformed",
"errorDetails": {
"source": "request",
"failingPaths": [
{
"path": "$.schema",
"details": "root schema type must be \"object\", got \"array\""
}
]
}
}

Common causes include a missing schema; a root type other than object; or unsupported keywords, such as external or circular $ref references, composition keywords other than a nullable anyOf, and validation keywords such as maxLength. For the supported subset and limits, refer to the define a schema guide.

Remote URL rejected (422)

The API returns this error when it can’t download a url input or rejects the URL:

{
"status": 422,
"requestId": "req_err_url",
"errorMessage": "The request is malformed",
"errorDetails": {
"source": "request",
"failingPaths": [{ "path": "$.url", "details": "URL is not allowed" }]
}
}

Run endpoint errors

The stored run and asynchronous endpoints add a few cases of their own. For endpoint details, refer to the processing runs and run asynchronously guides.

Idempotency key reused (409)

A submit with an Idempotency-Key that an earlier, different request already used answers with the processing error shape:

{
"status": 409,
"requestId": "req_err_idem",
"errorMessage": "Idempotency-Key was already used with a different request",
"errorDetails": {
"source": "processing",
"code": "idempotency_key_reused"
}
}

Send the retry with the same request, or use a new key for a new one.

Run state conflicts (409)

Canceling a finished run, or deleting a run that’s still queued or running, answers with the run error shape:

{
"status": 409,
"requestId": "req_err_run",
"errorCode": "run_in_flight",
"errorMessage": "Cancel the run before deleting it.",
"errorDetails": {
"source": "processing_runs",
"code": "run_in_flight"
}
}

The codes are run_not_cancelable for a cancel on a done or error run, and run_in_flight for a delete on a queued or running run.

Run expired (410)

Reading a run or one of its assets after its retention window answers 410 with the code run_expired. The API removes the run and its files shortly after. Submit the document again if you still need the result.

Run couldn’t be queued (503)

If the asynchronous submit can’t enqueue the run, it answers 503 with the code run_enqueue_failed. Nothing was stored or charged. Submit the request again; with the same Idempotency-Key, a retry that lands is safe.

Handle errors in code

The following examples show how to read error fields from a response.

import requests
response = requests.post(
"https://api.nutrient.io/extraction/parse",
headers={"Authorization": "Bearer your_api_key_goes_here"},
files={"file": open("document.pdf", "rb")},
)
result = response.json()
if result.get("status") != 200:
print(f"Error {result['status']}: {result['errorMessage']}")
print(f"Request ID: {result['requestId']}")
if "errorDetails" in result:
if result["errorDetails"].get("code"):
print(f"Error code: {result['errorDetails']['code']}")
for path in result["errorDetails"].get("failingPaths", []):
print(f" {path['path']}: {path['details']}")
else:
print(f"Extracted {len(result['output'].get('elements', []))} elements")

Troubleshooting

Diagnose common request failures by status code and symptom.

Request returns 401

Verify that the Authorization header uses the format Bearer pdf_live_....

Request returns 400

Check the request parameters and input document. The API reports malformed, empty, unsupported, and password-protected PDFs as 400 responses. Treat them as bad input rather than transient service failures, and fix or replace the input before retrying.

Request returns 413

A direct upload exceeded the 150 MB limit for the whole request on a live key. Reduce the file size or split multipage documents before uploading. For file requirements, refer to the supported file types guide.

Request returns 408

The request exceeded the maximum processing time of five minutes. Sending the same request again usually times out again. Submit it to the endpoint’s asynchronous route instead, where each run has a 15-minute processing limit. For details, refer to the run asynchronously guide. For documents that take longer, split them or submit smaller page ranges.

Request returns 422

The API rejected the url input if it exceeded the 50 MB size limit, or the download failed if it exceeded the 30-second response timeout. A file larger than 50 MB returns file at URL exceeds maximum size on $.url. A download that fails or times out returns a failure on the same path. Upload the file directly for anything larger than 50 MB.

Request returns 429

You exceeded the rate limit. Wait and retry with exponential backoff. Check your plan limits in the Data Extraction API dashboard(opens in a new tab).

Request returns 500 or 503

These are server-side errors, not document validation failures. Retry the request after a short delay. If the error persists, contact Support and include the requestId from the response. For support details, refer to the support guide.