/v2/extract) and Extract Jobs (/v2/extract/jobs).
Common Status Codes
These status codes are handled at the account and gateway level and can apply to any request.| Status Code | Name | Description | What to Do |
|---|---|---|---|
| 401 | Unauthorized | Missing or invalid API key. | Check that your Authorization header is present and contains a valid API key. |
| 402 | Payment Required | Your account does not have enough credits to complete processing. | If you have multiple accounts, make sure you’re using the correct API key. Add more credits to your account. |
| 429 | Too Many Requests | Rate limit exceeded. | Wait before retrying. Reduce request frequency and implement exponential backoff. See Rate Limits. |
Status Codes
| Status Code | Name | Description | What to Do |
|---|---|---|---|
| 200 | Success | Extraction completed successfully. | Continue with normal operations. |
| 400 | Bad Request | Invalid request due to malformed input, unsupported version, or client-side extraction errors. | Review the error message for the specific issue. See Status 400: Bad Request. |
| 413 | Payload Too Large | The request payload exceeds the maximum allowed size. | Reduce the size of the Markdown you send. |
| 422 | Unprocessable Entity | Input validation failed. | Review your request parameters. See Status 422: Unprocessable Entity. |
| 500 | Internal Server Error | Server error during processing. | Retry. If the issue persists, contact support@landing.ai. See Status 500: Internal Server Error. |
| 504 | Gateway Timeout | Request processing exceeded the timeout limit. | Reduce document size or simplify the extraction schema. See Status 504: Gateway Timeout. |
Status 400: Bad Request
This status code indicates invalid request parameters or client-side errors. Review the specific error message to identify the issue.Error: Failed to download document from URL
This error occurs when the API cannot download the Markdown file from the providedmarkdown_url.
Error message:
- Verify the URL is accessible and returns valid content.
- Check network connectivity and URL permissions.
- Ensure the URL points to a Markdown file (.md extension).
Error: Field extraction invalid
This error occurs when the extraction process fails due to issues with the extraction schema or the extracted data. Error message:- Review the error details in the response.
- Verify the JSON schema follows the guidelines described in Extraction Schema (JSON). Update your JSON schema if needed.
- Ensure all required fields are properly defined in the schema.
- Check if the document contains data that matches the schema structure.
Error: Invalid extract version
This error occurs when an unsupported model version is specified. Error message:- Use one of the supported versions listed in the error message.
- Use
extract-latestto automatically use the latest version. - If you don’t specify a version, the API uses the latest version by default.
- For more information, go to Model Version.
Status 422: Unprocessable Entity
This status code indicates input validation failures. Review the error message and adjust your request parameters.Error: The provided schema is not valid JSON
This error occurs when theschema parameter cannot be parsed as JSON.
Error message:
- Verify your extraction schema is valid JSON.
- Check for syntax errors such as missing commas, quotes, or brackets.
- See Extraction Schema (JSON) for the required structure.
Error: The provided schema must have “type”: “object” for the root
This error occurs when theschema is a valid JSON object, but its type keyword is not set to "object". The extraction engine requires the root schema to explicitly declare "type": "object".
Error message:
"type": "object" at the root of your schema.
Correct:
Error: The provided JSON must parse to an object at the root
This error occurs when theschema parameter is valid JSON, but the root value is not a JSON object. For example, the root is a JSON array ([...]), a string, or a number rather than {...}.
Error message:
{...}).
Correct:
Error: The provided JSON object was not a valid JSON schema
This error occurs when theschema parameter contains a JSON object that does not conform to the JSON Schema specification.
Error message:
- Review the error details to identify the specific schema issue.
- Check that every
typevalue is a JSON Schema type (string,number,integer,boolean,object,array, ornull). A custom type such as"money"fails validation, and the error details report that the valueis not valid under any of the given schemas. - Verify your schema follows the guidelines described in Extraction Schema (JSON).
Error: The provided schema contains recursive local $ref cycles
This error occurs when the extraction schema contains circular$ref references (for example, a schema that references itself).
Error message:
$ref references from your schema. Restructure nested types to avoid self-referencing definitions.
Error: Fields the model cannot extract (strict mode)
This error occurs whenstrict is true and the schema contains one or more fields the model cannot extract. When strict is false (default), those fields are skipped and extraction continues.
What to do:
- Confirm the document actually contains the data for the fields that could not be extracted.
- Refine each field’s
descriptionandx-alternativeNamesto help the model locate the data. See Field Descriptions and Alternative Names. - To skip fields that cannot be extracted instead of returning an error, set
stricttofalse.
Error: Schema fields not supported (strict mode)
This error occurs whenstrict is true and the schema contains keywords the extraction engine does not support. When strict is false (default), unsupported keywords are ignored and extraction continues.
Error message:
- Remove the listed keywords from your schema. See Extraction Schema (JSON) for the supported schema features.
- To ignore unsupported keywords instead of returning an error, set
stricttofalse.
Error: Cannot provide both ‘markdown’ and ‘markdown_url’
This error occurs when both a Markdown file and a URL to a Markdown file are provided in the same request. Error message:- Provide a Markdown file using the
markdownparameter, OR - Provide a URL to a Markdown file using the
markdown_urlparameter.
Error: Provide exactly one Markdown source
This error occurs when your request does not include a Markdown source. Error message:- Use the
markdownparameter to upload a Markdown file, OR - Use the
markdown_urlparameter to provide a URL to a Markdown file.
Error: No markdown file or URL provided
This error occurs when you include amarkdown or markdown_url parameter in your request, but the value is empty or blank.
Error message:
- If using
markdown: Ensure you are uploading a valid Markdown file (not an empty file or blank value). - If using
markdown_url: Ensure the parameter contains a valid URL (not an empty string or blank value). - Verify that your request properly includes the file or URL value.
Error: Invalid URL format
This error occurs when themarkdown_url parameter contains a value that is not a valid URL.
Error message:
- Verify the URL is properly formatted with a valid protocol (http:// or https://).
- Check for typos or missing characters in the URL.
- Ensure the URL is properly encoded if it contains special characters.
Error: Multiple Markdown files detected
This error occurs when multiple Markdown files are included in the request. Error message:Error: Unsupported format
This error occurs when you provide a file other than Markdown (.md) to the extract endpoint, such as PDF, DOCX, XLSX, or image files. Error message:- The extract endpoint only accepts Markdown files with a .md extension.
- If you have a PDF, DOCX, or other document format, use the Parse API to convert your document to Markdown first.
- Ensure your file has a .md extension and contains valid UTF-8 encoded Markdown content.
Status 500: Internal Server Error
This error indicates an unexpected server error occurred during processing. What to do:- Retry the request.
- If the error persists, contact support@landing.ai.
Status 504: Gateway Timeout
This error occurs when the extraction process exceeds the timeout limit. What to do:- Reduce the size of your Markdown document.
- Simplify your extraction schema and verify it follows the guidelines described in Extraction Schema (JSON). Update your JSON schema if needed.
- If the error persists, contact support@landing.ai.
Extract Jobs
These status codes apply to the asynchronous Extract Jobs v2 endpoints.Create a Job
These status codes apply toPOST /v2/extract/jobs.
| Status Code | Name | Description | What to Do |
|---|---|---|---|
| 202 | Accepted | The job was queued successfully. The response contains the job_id. | Poll GET /v2/extract/jobs/{job_id} to track status and retrieve the result. |
| 409 | Conflict | A job with the same identifier already exists. | Retry the request. |
| 422 | Unprocessable Entity | Input validation failed. | The causes and fixes match the synchronous Extract API. See Status 422. |
| 429 | Too Many Requests | Rate limit exceeded. | Wait before retrying. Reduce request frequency and implement exponential backoff. See Rate Limits. |
| 500 | Internal Server Error | Server error while creating the job. | Retry. If the issue persists, contact support@landing.ai. |
Get a Job
These status codes apply toGET /v2/extract/jobs/{job_id}.
| Status Code | Name | Description | What to Do |
|---|---|---|---|
| 200 | Success | The job was retrieved. When status is completed, the response includes the result. When status is failed, the error field describes what went wrong. | Read the status field. |
| 404 | Not Found | No job with the given ID exists for your API key. | Verify the job_id matches the value returned when you created the job, and that you are using the same API key. |
| 500 | Internal Server Error | Server error while retrieving the job. | Retry. If the issue persists, contact support@landing.ai. |
When Are Credits Consumed?
Credits are consumed only when the API returns a 200 status code. All other responses, including errors, do not consume credits. For Extract Jobs, credits are consumed only when a job reaches thecompleted status; failed jobs do not consume credits. For more information, see Credit Consumption.