/v2/extract) and Extract Jobs (/v2/extract/jobs).
Error Response Format
Every error from the v2 APIs returns a JSON body with two fields:code field is a stable identifier you can branch on, such as validation_error, unknown_model_version, invalid_url, invalid_api_key, or rate_limit_exceeded. The message field is a human-readable description; treat its exact wording as variable. The error messages quoted on this page are message values.
Common Status Codes
These status codes are handled at the account and gateway level and can apply to any request.Status Codes
Status 206: Partial Success
This status code indicates the extraction completed but not cleanly. The response body has the normal success shape, plus one or both of these signals:- The
schema_violation_errorfield is set whenoptions.strictisfalseand the schema contained fields the model could not extract. The extraction is partial: unsupported fields were skipped. - The
warningsarray lists non-fatal warnings emitted during extraction.
- Review the flagged fields and adjust your schema, or set
options.stricttotrueto fail the request with a 422 error instead. See Schema Fields Not Supported (Strict Mode). - For Extract Jobs, the poll response stays HTTP 200; check
warningsandschema_violation_errorinsideresultinstead of relying on the status code.
Status 422: Unprocessable Entity
This status code indicates input validation failures. Review the errormessage and adjust your request parameters.
Error: markdown_url Fetch Failed
This error occurs when the Markdown cannot be fetched from the providedmarkdown_url. The URL is validated and fetched when you submit the request, so an unusable URL fails immediately, before any processing starts.
Error message:
- Verify the URL is publicly accessible and serves the Markdown directly. A URL that responds with a redirect is rejected; supply the final URL.
- If the URL is presigned, confirm it has not expired.
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: Unknown Extract Version
This error occurs when an unsupported model version is specified. The errorcode is unknown_model_version.
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.
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.
Error: service_tier Is Only Valid on Extract Jobs
This error occurs when a request to the synchronous Extract endpoint (POST /v2/extract) includes the service_tier parameter. Service tiers only apply to asynchronous endpoints, like Extract Jobs. The parameter is rejected even when its value is empty.
Error message:
- Remove the
service_tierparameter from Extract requests. Extract always runs on theprioritytier. See Sync vs Async Processing. - To choose a service tier, create an Extract Job instead. See Choose a Service Tier.
Error: output_save_url Expired or Expires Too Soon
This error occurs when you create an Extract Job with anoutput_save_url whose presigned URL is already expired or does not stay valid long enough for the job to complete. The output is delivered when the job completes, so the URL must have at least 15 minutes of remaining validity at submission. The error code is invalid_url.
Error message:
- Sign a fresh presigned URL with a longer validity and create the job again. The job is rejected before processing starts, so no credits are consumed.
- For Azure SAS URLs, also confirm the token grants write (
w) or create (c) permission. A URL without write access is rejected with a similar 422 error. - Sign delivery URLs with long-lived credentials. A URL signed with temporary session credentials can pass this check but still fail at delivery if the session expires before the job completes.
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 (475 seconds). You are not billed for a request that times out. Error message:- 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.
- Use Extract Jobs instead. Jobs are not subject to the synchronous timeout. See Sync vs Async Processing.
- 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.
Get a Job
These status codes apply toGET /v2/extract/jobs/{job_id}.
When Are Credits Consumed?
Credits are consumed only when the API returns a 200 or 206 status code. Error responses 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.