The Parse endpoint allows you to convert documents into structured, machine-readable formats with fine-grained control over the parsing process. This endpoint is ideal for extracting cleaned document content to be used as context for downstream processing, e.g. RAG pipelines, custom ingestion pipelines, embeddings classification, etc.Unlike processor and workflow runs, parsing is a synchronous endpoint and returns the parsed content in the response. Expected latency depends primarily on file size. This makes it suitable for workflows where you need immediate access to document content without waiting for asynchronous processing.For a deeper guide on how to use the output of this endpoint, jump to Using Parsed Output.
Body
object
required
A file object containing either a URL or base64 encoded content. Must contain
either fileUrl or fileId.
Hide properties
string
The name of the file. If not set, the file name is taken from the url or generated in case of raw upload.
string
A URL for the file. For production use cases, we recommend using presigned URLs with
a 5-15 minute expiration time.
string
If you already have an Extend file id (for instance from running a workflow or a previous file upload) then you can
use that file id when running the parse endpoint so that it leverage any cached data that might be available.
object
required
Configuration options for the parsing process.
Show properties
string
default:"markdown"
The target format for the parsed content. Supported values:
markdown: Convert document to Markdown format
spatial: Preserve spatial information in the output
object
Strategy for dividing the document into chunks.
Show properties
string
default:"page"
The type of chunking strategy. Supported values:
page: Chunk document by pages.
document: Entire document is a single chunk. Essentially no chunking.
section: Split by logical sections. Not support for target=spatial.
number
Specify a minimum number of characters per chunk.
number
Specify a maximum number of characters per chunk.
object
Options for controlling how different block types are processed.
Show properties
object
Options for figure blocks.
Show properties
boolean
default:"true"
Whether to include figures in the output.
boolean
default:"true"
Whether to clip and extract images from figures.
object
Options for table blocks.
Show properties
boolean
default:"true"
Whether to include tables in the output.
string
default:"markdown"
The target format for the table blocks. Supported values:
markdown: Convert table to Markdown format
html: Convert table to HTML format
object
Options for text blocks.
Show properties
boolean
default:"true"
Whether an additional vision model will be utilized for advanced signature detection.
Recommended, for most use cases, but should be disabled if signature detection is not necessary and latency is a concern.
object
Advanced parsing options.
Show properties
boolean
default:"true"
Whether to automatically detect and correct page rotation.
Response
string
The type of object. Will always be “parser_run”.
string
A unique identifier for the parser run.
string
The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs. This allows downstream processing to reuse a cache of the parsed file content to reduce your usage costs.
array
An array of chunks extracted from the document.
Hide properties
string
The type of object. Will be “chunk”.
string
The type of chunk (e.g., “page”).
string
The textual content of the chunk in the specified target format.
object
Metadata about the chunk.
Show properties
object
The page range this chunk covers. Often will just be a partial page, in which cases start and end will be the same.
Show properties
number
The starting page number (inclusive).
number
The ending page number (inclusive).
array
An array of block objects that make up the chunk. See the Block object documentation for more detailed information about block structure and types.
Hide properties
string
The type of object. Will be “block”.
string
A unique identifier for the block.
string
The type of block. Possible values include:
text: Regular text content
heading: Section or document headings
section_heading: Subsection headings
table: Tabular data with rows and columns
figure: Images, charts, or diagrams
string
The textual content of the block.
object
Additional details specific to the block type.
object
Metadata about the block.
Show properties
object
Information about the page this block appears on.
Show properties
number
The page number.
number
The width of the page in inches.
number
The height of the page in inches.
array
An array of points defining the polygon that bounds the block.
object
A simplified bounding box for the block.
string
The status of the parser run. Possible values:
PROCESSED: The file was successfully processed
FAILED: The processing failed (see failureReason for details)
string
The reason for failure if status is “FAILED”. Will be null for successful runs.
object
The configuration used for the parsing process, including any default values that were applied.
object
Metrics about the parsing process.
Show properties
number
The time taken to process the document in milliseconds.
The Parse API returns document content in a structured format that provides both high-level formatted content and detailed block-level information. Understanding how to work with this output will help you get the most value from the parsing service.
Working with Chunks
Each chunk (currently only page-level chunks are supported) contains two key properties:
content: A fully formatted representation of the entire chunk in the target format (e.g., markdown). This is ready to use as-is if you need the complete formatted content of a page.
blocks: An array of individual content blocks that make up the chunk, each with its own formatting, position information, and metadata.
When to use chunk.content vs. chunk.blocks
Use chunk.content when:
You need the complete, properly formatted content of a page, already doing the logical placement of blocks (e.g. grouping markdown sections and placing spatially, etc)
You want to display or process the document content as a whole (and can just combine all chunk.content values)
You’re integrating with systems that expect formatted text (e.g., markdown processors)
Use chunk.blocks when:
You need to work with specific elements of the document (e.g., only tables or figures)
You need spatial information about where content appears on the page, perhaps to build citation systems
You’re building a UI that shows or highlights specific document elements
Example: Extracting specific content types
// Extract all tables from a documentfunction extractTables(parseResult) { const tables = []; parseResult.chunks.forEach(chunk => { chunk.blocks.forEach(block => { if (block.type === 'table') { tables.push({ content: block.content, pageNumber: block.metadata.pageNumber, position: block.boundingBox }); } }); }); return tables;}// Extract all figures with their imagesfunction extractFigures(parseResult) { const figures = []; parseResult.chunks.forEach(chunk => { chunk.blocks.forEach(block => { if (block.type === 'figure' && block.details.imageUrl) { figures.push({ caption: block.content, imageUrl: block.details.imageUrl, figureType: block.details.figureType, pageNumber: block.metadata.pageNumber }); } }); }); return figures;}
Example: Reconstructing content with custom formatting
// Extract headings and their content to create a table of contentsfunction createTableOfContents(parseResult) { const toc = []; parseResult.chunks.forEach(chunk => { chunk.blocks.forEach(block => { if (block.type === 'heading' || block.type === 'section_heading') { toc.push({ title: block.content, pageNumber: block.metadata.pageNumber }); } }); }); return toc;}
Spatial Information
Each block contains spatial information in the form of a polygon (precise outline) and a simplified boundingBox. This information can be used to:
Highlight specific content in a document viewer
Create visual overlays on top of the original document
Understand the reading order and layout of the document
By leveraging both the formatted content and the structured block information, you can build powerful document processing workflows that combine the convenience of formatted text with the precision of block-level access.
Error Response Format
When an error occurs, the API returns a structured error response with the following fields:
string
A specific error code that identifies the type of error.
string
A human-readable description of the error.
string
A unique identifier for the request, useful for troubleshooting.
boolean
Indicates whether retrying the request might succeed.
Custom Error Codes
The API may return the following specific error codes:
Custom Error Codes
We provide custom error codes to make it easier for your system to know what happened in case of a failure. There will also be a retryable=true|false field in the response body, but you can also find a breakdown below. Most errors are not retryable and are client errors related to the file provided for parsing.
Error Code
Description
Retryable
INVALID_CONFIG_OPTIONS
Invalid combination of options in the incoming config.
❌
UNABLE_TO_DOWNLOAD_FILE
The system could not download the file from the provided URL, likely means your presigned url is expired, or malformed somehow.
❌
FILE_TYPE_NOT_SUPPORTED
The file type is not supported for parsing.
❌
FILE_SIZE_TOO_LARGE
The file exceeds the maximum allowed size.
❌
CORRUPT_FILE
The file is corrupt and cannot be parsed.
❌
OCR_ERROR
An error occurred in the OCR system. This is a rare error code and would indicate downtime, so requests can be retried. We’d suggest applying a retry with backoff for this error.
✅
PASSWORD_PROTECTED_FILE
The file is password protected and cannot be parsed.
❌
FAILED_TO_CONVERT_TO_PDF
The system could not convert the file to PDF format.
❌
FAILED_TO_GENERATE_TARGET_FORMAT
The system could not generate the requested target format.
❌
INTERNAL_ERROR
An unexpected internal error occurred. We’d suggest applying a retry with backoff for this error as it likely a result of some outage.
✅
HTTP error codes
Corresponding http error codes for different types of failures. We generally recommend relying on our custom error codes for programmatic handling.
Returned when:
Required fields are missing (e.g., file)
Neither fileUrl nor fileBase64 is provided in the file object
The provided fileUrl is invalid
The provided fileBase64 is invalid
The config contains invalid values (e.g., unsupported target format or chunking strategy)
The file type is not supported
The file size is too large
Returned when:
The API token is missing
The API token is invalid
Returned when:
The authenticated workspace doesn’t have permission to use the parse functionality
The API token doesn’t have sufficient permissions
Returned when:
The file is corrupt and cannot be parsed
The file is password protected
The file could not be converted to PDF
The system failed to generate the target format
Returned when:
An OCR error occurs
A chunking error occurs
Any other unexpected error occurs during parsing
Handling Errors
Here are examples of how to handle errors from the Parse API:
const axios = require("axios");const parseDocument = async () => { try { const response = await axios.post( "https://api-prod.extend.app/parse", { file: { fileName: "example.pdf", fileUrl: "https://example.com/documents/example.pdf", }, config: { target: "markdown", }, }, { headers: { Authorization: "Bearer <API_TOKEN>", "Content-Type": "application/json", }, } ); console.log("Document parsed successfully:", response.data); return response.data; } catch (error) { if (error.response) { const { code, message, requestId, retryable } = error.response.data; // Handle specific error codes switch (code) { case "FILE_TYPE_NOT_SUPPORTED": console.error("Unsupported file type. Please use a supported format."); break; case "PASSWORD_PROTECTED_FILE": console.error("The file is password protected. Please provide an unprotected file."); break; case "CORRUPT_FILE": console.error("The file is corrupt and cannot be processed."); break; case "FILE_SIZE_TOO_LARGE": console.error("The file is too large. Please reduce the file size."); break; default: console.error(`Error (${code}): ${message}`); } // Log request ID for troubleshooting console.error(`Request ID: ${requestId}`); // Potentially retry if the error is retryable if (retryable) { console.log("This error is retryable. Consider retrying the request."); } } else { console.error("Network error:", error.message); } throw error; }};
import requestsdef parse_document(file_url, file_name, config=None): if config is None: config = {"target": "markdown"} url = "https://api-prod.extend.app/parse" headers = { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" } payload = { "file": { "fileName": file_name, "fileUrl": file_url }, "config": config } try: response = requests.post(url, json=payload, headers=headers) response.raise_for_status() # Raise exception for 4XX/5XX responses return response.json() except requests.exceptions.HTTPError as e: error_data = e.response.json() code = error_data.get("code") message = error_data.get("message") request_id = error_data.get("requestId") retryable = error_data.get("retryable", False) # Handle specific error codes if code == "FILE_TYPE_NOT_SUPPORTED": print(f"Error: Unsupported file type. {message}") elif code == "PASSWORD_PROTECTED_FILE": print(f"Error: Password protected file. {message}") elif code == "CORRUPT_FILE": print(f"Error: Corrupt file. {message}") elif code == "FILE_SIZE_TOO_LARGE": print(f"Error: File too large. {message}") else: print(f"Error ({code}): {message}") # Log request ID for troubleshooting print(f"Request ID: {request_id}") # Potentially retry if the error is retryable if retryable: print("This error is retryable. Consider retrying the request.") raise except requests.exceptions.RequestException as e: print(f"Network error: {str(e)}") raise
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Extend","colors":{"primary":"#12A7D3","light":"#81D7F7","dark":"#004E7A"},"favicon":"/favicon.png","logo":{"light":"https://mintcdn.com/tryextend/fwFG7xdTywjiFfYq/logo/light.png?fit=max\u0026auto=format\u0026n=fwFG7xdTywjiFfYq\u0026q=85\u0026s=d5b60497f53e7cb8865d11cf97636755","dark":"https://mintcdn.com/tryextend/fwFG7xdTywjiFfYq/logo/dark.png?fit=max\u0026auto=format\u0026n=fwFG7xdTywjiFfYq\u0026q=85\u0026s=2ba675637fc5f8ee673317eb7814ac38"},"api":{"playground":{"display":"none"},"mdx":{"server":null,"auth":{"method":"bearer","name":null}}},"background":{"image":"https://mintlify.s3.us-west-1.amazonaws.com/tryextend/background.png","decoration":null},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tryextend","hasAudioNarration":false,"actualSubdomain":"tryextend","customDomains":["docs.extend.app"],"gitSource":{"type":"github","owner":"extend-hq","repo":"documentation-legacy","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae921fd5bfa35cf904494a3:success","clientVersion":"0.0.4344","searchFilterCounts":[{"language":"default","tag":"API Reference","count":49},{"language":"default","tag":"Documentation","count":18},{"language":"default","tag":"Processor Endpoints","count":12},{"language":"default","tag":"Objects","count":11},{"language":"default","tag":"Workflow Endpoints","count":7},{"language":"default","tag":"Guides","count":6},{"language":"default","tag":"Processor Changelog","count":5},{"language":"default","tag":"Studio","count":5},{"language":"default","tag":"Evaluation Set Endpoints","count":4},{"language":"default","tag":"File Endpoints","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/endpoint/parse","slug":"/api-reference/endpoint/parse","pageMetadata":{"title":"Parse File","api":"POST https://api-prod.extend.app/parse","description":"Parse files to get cleaned, chunked target content (e.g. markdown).","href":"/api-reference/endpoint/parse"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Parse files to get cleaned, chunked target content (e.g. markdown).\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Expandable,Heading,ParamField,ResponseField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The Parse endpoint allows you to convert documents into structured, machine-readable formats with fine-grained control over the parsing process. This endpoint is ideal for extracting cleaned document content to be used as context for downstream processing, e.g. RAG pipelines, custom ingestion pipelines, embeddings classification, etc.`}),`\n`,_jsx(_components.p,{children:`Unlike processor and workflow runs, parsing is a synchronous endpoint and returns the parsed content in the response. Expected latency depends primarily on file size. This makes it suitable for workflows where you need immediate access to document content without waiting for asynchronous processing.`}),`\n`,_jsxs(_components.p,{children:[`For a deeper guide on how to use the output of this endpoint, jump to `,_jsx(_components.a,{href:`#using-parsed-output`,children:`Using Parsed Output`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`body`,children:`Body`}),`\n`,_jsxs(ParamField,{body:`file`,type:`object`,required:true,id:`param-file`,children:[_jsx(_components.p,{children:`A file object containing either a URL or base64 encoded content. Must contain\neither fileUrl or fileId.`}),_jsxs(Expandable,{title:`properties`,defaultOpen:true,children:[_jsx(ParamField,{body:`fileName`,type:`string`,id:`param-file-name`,children:_jsx(_components.p,{children:`The name of the file. If not set, the file name is taken from the url or generated in case of raw upload.`})}),_jsx(ParamField,{body:`fileUrl`,type:`string`,id:`param-file-url`,children:_jsx(_components.p,{children:`A URL for the file. For production use cases, we recommend using presigned URLs with\na 5-15 minute expiration time.`})}),_jsx(ParamField,{body:`fileId`,type:`string`,optional:true,id:`param-file-id`,children:_jsxs(_components.p,{children:[`If you already have an Extend file id (for instance from running a workflow or a previous file `,_jsx(_components.a,{href:`/api-reference/endpoint/upload_file`,children:`upload`}),`) then you can\nuse that file id when running the parse endpoint so that it leverage any cached data that might be available.`]})})]})]}),`\n`,_jsxs(ParamField,{body:`config`,type:`object`,required:true,id:`param-config`,children:[_jsx(_components.p,{children:`Configuration options for the parsing process.`}),_jsxs(Expandable,{title:`properties`,children:[_jsxs(ParamField,{body:`target`,type:`string`,default:`markdown`,id:`param-target`,children:[_jsx(_components.p,{children:`The target format for the parsed content. Supported values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`markdown`}),`: Convert document to Markdown format`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`spatial`}),`: Preserve spatial information in the output`]}),`\n`]})]}),_jsxs(ParamField,{body:`chunkingStrategy`,type:`object`,id:`param-chunking-strategy`,children:[_jsx(_components.p,{children:`Strategy for dividing the document into chunks.`}),_jsxs(Expandable,{title:`properties`,children:[_jsxs(ParamField,{body:`type`,type:`string`,default:`page`,id:`param-type`,children:[_jsx(_components.p,{children:`The type of chunking strategy. Supported values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`page`}),`: Chunk document by pages.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`document`}),`: Entire document is a single chunk. Essentially no chunking.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`section`}),`: Split by logical sections. Not support for target=spatial.`]}),`\n`]})]}),_jsx(ParamField,{body:`minCharacters`,type:`number`,optional:true,id:`param-min-characters`,children:_jsx(_components.p,{children:`Specify a minimum number of characters per chunk.`})}),_jsx(ParamField,{body:`maxCharacters`,type:`number`,optional:true,id:`param-max-characters`,children:_jsx(_components.p,{children:`Specify a maximum number of characters per chunk.`})})]})]}),_jsxs(ParamField,{body:`blockOptions`,type:`object`,id:`param-block-options`,children:[_jsx(_components.p,{children:`Options for controlling how different block types are processed.`}),_jsxs(Expandable,{title:`properties`,children:[_jsxs(ParamField,{body:`figures`,type:`object`,id:`param-figures`,children:[_jsx(_components.p,{children:`Options for figure blocks.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`enabled`,type:`boolean`,default:`true`,id:`param-enabled`,children:_jsx(_components.p,{children:`Whether to include figures in the output.`})}),_jsx(ParamField,{body:`figureImageClippingEnabled`,type:`boolean`,default:`true`,id:`param-figure-image-clipping-enabled`,children:_jsx(_components.p,{children:`Whether to clip and extract images from figures.`})})]})]}),_jsxs(ParamField,{body:`tables`,type:`object`,id:`param-tables`,children:[_jsx(_components.p,{children:`Options for table blocks.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`enabled`,type:`boolean`,default:`true`,id:`param-enabled-1`,children:_jsx(_components.p,{children:`Whether to include tables in the output.`})}),_jsxs(ParamField,{body:`targetFormat`,type:`string`,default:`markdown`,id:`param-target-format`,children:[_jsx(_components.p,{children:`The target format for the table blocks. Supported values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`markdown`}),`: Convert table to Markdown format`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`html`}),`: Convert table to HTML format`]}),`\n`]})]})]})]}),_jsxs(ParamField,{body:`text`,type:`object`,id:`param-text`,children:[_jsx(_components.p,{children:`Options for text blocks.`}),_jsx(Expandable,{title:`properties`,children:_jsx(ParamField,{body:`signatureDetectionEnabled`,type:`boolean`,default:`true`,id:`param-signature-detection-enabled`,children:_jsx(_components.p,{children:`Whether an additional vision model will be utilized for advanced signature detection.\nRecommended, for most use cases, but should be disabled if signature detection is not necessary and latency is a concern.`})})})]})]})]}),_jsxs(ParamField,{body:`advancedOptions`,type:`object`,id:`param-advanced-options`,children:[_jsx(_components.p,{children:`Advanced parsing options.`}),_jsx(Expandable,{title:`properties`,children:_jsx(ParamField,{body:`pageRotationEnabled`,type:`boolean`,default:`true`,id:`param-page-rotation-enabled`,children:_jsx(_components.p,{children:`Whether to automatically detect and correct page rotation.`})})})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsx(_components.p,{children:`The type of object. Will always be “parser_run”.`})}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`A unique identifier for the parser run.`})}),`\n`,_jsx(ResponseField,{name:`fileId`,type:`string`,id:`param-file-id-1`,children:_jsx(_components.p,{children:`The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs. This allows downstream processing to reuse a cache of the parsed file content to reduce your usage costs.`})}),`\n`,_jsxs(ResponseField,{name:`chunks`,type:`array`,id:`param-chunks`,children:[_jsx(_components.p,{children:`An array of chunks extracted from the document.`}),_jsxs(Expandable,{title:`properties`,defaultOpen:true,children:[_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object-1`,children:_jsx(_components.p,{children:`The type of object. Will be “chunk”.`})}),_jsx(ResponseField,{name:`type`,type:`string`,id:`param-type-1`,children:_jsx(_components.p,{children:`The type of chunk (e.g., “page”).`})}),_jsx(ResponseField,{name:`content`,type:`string`,id:`param-content`,children:_jsx(_components.p,{children:`The textual content of the chunk in the specified target format.`})}),_jsxs(ResponseField,{name:`metadata`,type:`object`,id:`param-metadata`,children:[_jsx(_components.p,{children:`Metadata about the chunk.`}),_jsx(Expandable,{title:`properties`,children:_jsxs(ResponseField,{name:`pageRange`,type:`object`,id:`param-page-range`,children:[_jsxs(_components.p,{children:[`The page range this chunk covers. Often will just be a partial page, in which cases `,_jsx(_components.code,{children:`start`}),` and `,_jsx(_components.code,{children:`end`}),` will be the same.`]}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`start`,type:`number`,id:`param-start`,children:_jsx(_components.p,{children:`The starting page number (inclusive).`})}),_jsx(ResponseField,{name:`end`,type:`number`,id:`param-end`,children:_jsx(_components.p,{children:`The ending page number (inclusive).`})})]})]})})]}),_jsxs(ResponseField,{name:`blocks`,type:`array`,id:`param-blocks`,children:[_jsxs(_components.p,{children:[`An array of block objects that make up the chunk. See the `,_jsx(_components.a,{href:`/api-reference/objects/block`,children:`Block object`}),` documentation for more detailed information about block structure and types.`]}),_jsxs(Expandable,{title:`properties`,defaultOpen:true,children:[_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object-2`,children:_jsx(_components.p,{children:`The type of object. Will be “block”.`})}),_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-1`,children:_jsx(_components.p,{children:`A unique identifier for the block.`})}),_jsxs(ResponseField,{name:`type`,type:`string`,id:`param-type-2`,children:[_jsx(_components.p,{children:`The type of block. Possible values include:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`text`}),`: Regular text content`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`heading`}),`: Section or document headings`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`section_heading`}),`: Subsection headings`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`table`}),`: Tabular data with rows and columns`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`figure`}),`: Images, charts, or diagrams`]}),`\n`]})]}),_jsx(ResponseField,{name:`content`,type:`string`,id:`param-content-1`,children:_jsx(_components.p,{children:`The textual content of the block.`})}),_jsx(ResponseField,{name:`details`,type:`object`,id:`param-details`,children:_jsx(_components.p,{children:`Additional details specific to the block type.`})}),_jsxs(ResponseField,{name:`metadata`,type:`object`,id:`param-metadata-1`,children:[_jsx(_components.p,{children:`Metadata about the block.`}),_jsx(Expandable,{title:`properties`,children:_jsxs(ResponseField,{name:`page`,type:`object`,id:`param-page`,children:[_jsx(_components.p,{children:`Information about the page this block appears on.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`number`,type:`number`,id:`param-number`,children:_jsx(_components.p,{children:`The page number.`})}),_jsx(ResponseField,{name:`width`,type:`number`,optional:true,id:`param-width`,children:_jsx(_components.p,{children:`The width of the page in inches.`})}),_jsx(ResponseField,{name:`height`,type:`number`,optional:true,id:`param-height`,children:_jsx(_components.p,{children:`The height of the page in inches.`})})]})]})})]}),_jsx(ResponseField,{name:`polygon`,type:`array`,id:`param-polygon`,children:_jsx(_components.p,{children:`An array of points defining the polygon that bounds the block.`})}),_jsx(ResponseField,{name:`boundingBox`,type:`object`,id:`param-bounding-box`,children:_jsx(_components.p,{children:`A simplified bounding box for the block.`})})]})]})]})]}),`\n`,_jsxs(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:[_jsx(_components.p,{children:`The status of the parser run. Possible values:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`PROCESSED`}),`: The file was successfully processed`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FAILED`}),`: The processing failed (see failureReason for details)`]}),`\n`]})]}),`\n`,_jsx(ResponseField,{name:`failureReason`,type:`string`,id:`param-failure-reason`,children:_jsx(_components.p,{children:`The reason for failure if status is “FAILED”. Will be null for successful runs.`})}),`\n`,_jsx(ResponseField,{name:`config`,type:`object`,id:`param-config-1`,children:_jsx(_components.p,{children:`The configuration used for the parsing process, including any default values that were applied.`})}),`\n`,_jsxs(ResponseField,{name:`metrics`,type:`object`,id:`param-metrics`,children:[_jsx(_components.p,{children:`Metrics about the parsing process.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`processingTimeMs`,type:`number`,id:`param-processing-time-ms`,children:_jsx(_components.p,{children:`The time taken to process the document in milliseconds.`})}),_jsx(ResponseField,{name:`pageCount`,type:`number`,id:`param-page-count`,children:_jsx(_components.p,{children:`The number of pages in the document.`})})]})]}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{filename:`Node.js`,numberOfLines:`46`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`46`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` axios`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` require`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"axios\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` parseDocument`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` axios`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-prod.extend.app/parse\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` file:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fileName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"example.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fileUrl:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://example.com/documents/example.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` config:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"markdown\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` chunkingStrategy:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` type:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"page\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` blockOptions:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` figures:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` enabled:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` figureImageClippingEnabled:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tables:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` enabled:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` text:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` enabled:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` styleFormattingEnabled:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Bearer \u003cAPI_TOKEN>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Document parsed successfully:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Error:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`parseDocument`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`3`,id:`using-parsed-output`,children:`Using Parsed Output`}),`\n`,_jsx(_components.p,{children:`The Parse API returns document content in a structured format that provides both high-level formatted content and detailed block-level information. Understanding how to work with this output will help you get the most value from the parsing service.`}),`\n`,_jsx(Heading,{level:`4`,id:`working-with-chunks`,children:`Working with Chunks`}),`\n`,_jsx(_components.p,{children:`Each chunk (currently only page-level chunks are supported) contains two key properties:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`content`})}),`: A fully formatted representation of the entire chunk in the target format (e.g., markdown). This is ready to use as-is if you need the complete formatted content of a page.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`blocks`})}),`: An array of individual content blocks that make up the chunk, each with its own formatting, position information, and metadata.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(Heading,{level:`4`,id:`when-to-use-chunk-content-vs-chunk-blocks`,children:[`When to use `,_jsx(_components.code,{children:`chunk.content`}),` vs. `,_jsx(_components.code,{children:`chunk.blocks`})]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`Use `,_jsx(_components.code,{children:`chunk.content`}),` when:`]})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`You need the complete, properly formatted content of a page, already doing the logical placement of blocks (e.g. grouping markdown sections and placing spatially, etc)`}),`\n`,_jsx(_components.li,{children:`You want to display or process the document content as a whole (and can just combine all chunk.content values)`}),`\n`,_jsx(_components.li,{children:`You’re integrating with systems that expect formatted text (e.g., markdown processors)`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:_jsxs(_components.strong,{children:[`Use `,_jsx(_components.code,{children:`chunk.blocks`}),` when:`]})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`You need to work with specific elements of the document (e.g., only tables or figures)`}),`\n`,_jsx(_components.li,{children:`You need spatial information about where content appears on the page, perhaps to build citation systems`}),`\n`,_jsx(_components.li,{children:`You’re building a UI that shows or highlights specific document elements`}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`4`,id:`example-extracting-specific-content-types`,children:`Example: Extracting specific content types`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`38`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`38`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Extract all tables from a document`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` extractTables`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`parseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` tables`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` parseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` chunk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`blocks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'table'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tables`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`push`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` content:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pageNumber:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`metadata`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pageNumber`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` position:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`boundingBox`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tables`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Extract all figures with their images`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` extractFigures`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`parseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` figures`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` parseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` chunk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`blocks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'figure'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`details`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`imageUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` figures`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`push`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` caption:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` imageUrl:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`details`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`imageUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` figureType:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`details`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`figureType`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pageNumber:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`metadata`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pageNumber`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` figures`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`4`,id:`example-reconstructing-content-with-custom-formatting`,children:`Example: Reconstructing content with custom formatting`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Extract headings and their content to create a table of contents`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createTableOfContents`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`parseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` toc`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` parseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` chunk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`blocks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'heading'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'section_heading'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` toc`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`push`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` title:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pageNumber:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`metadata`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pageNumber`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` toc`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`4`,id:`spatial-information`,children:`Spatial Information`}),`\n`,_jsxs(_components.p,{children:[`Each block contains spatial information in the form of a `,_jsx(_components.code,{children:`polygon`}),` (precise outline) and a simplified `,_jsx(_components.code,{children:`boundingBox`}),`. This information can be used to:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Highlight specific content in a document viewer`}),`\n`,_jsx(_components.li,{children:`Create visual overlays on top of the original document`}),`\n`,_jsx(_components.li,{children:`Understand the reading order and layout of the document`}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Create highlight coordinates for a document viewer`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createHighlights`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`parseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`searchTerm`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` highlights`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [];`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` parseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` chunk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`blocks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'text'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`includes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`searchTerm`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` highlights`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`push`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` pageNumber:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`metadata`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pageNumber`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` boundingBox:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` block`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`boundingBox`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` highlights`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`By leveraging both the formatted content and the structured block information, you can build powerful document processing workflows that combine the convenience of formatted text with the precision of block-level access.`}),`\n`,_jsx(Heading,{level:`3`,id:`error-response-format`,children:`Error Response Format`}),`\n`,_jsx(_components.p,{children:`When an error occurs, the API returns a structured error response with the following fields:`}),`\n`,_jsx(ResponseField,{name:`code`,type:`string`,id:`param-code`,children:_jsx(_components.p,{children:`A specific error code that identifies the type of error.`})}),`\n`,_jsx(ResponseField,{name:`message`,type:`string`,id:`param-message`,children:_jsx(_components.p,{children:`A human-readable description of the error.`})}),`\n`,_jsx(ResponseField,{name:`requestId`,type:`string`,id:`param-request-id`,children:_jsx(_components.p,{children:`A unique identifier for the request, useful for troubleshooting.`})}),`\n`,_jsx(ResponseField,{name:`retryable`,type:`boolean`,id:`param-retryable`,children:_jsx(_components.p,{children:`Indicates whether retrying the request might succeed.`})}),`\n`,_jsx(Heading,{level:`3`,id:`custom-error-codes`,children:`Custom Error Codes`}),`\n`,_jsx(_components.p,{children:`The API may return the following specific error codes:`}),`\n`,_jsx(Heading,{level:`3`,id:`custom-error-codes-2`,children:`Custom Error Codes`}),`\n`,_jsxs(_components.p,{children:[`We provide custom error codes to make it easier for your system to know what happened in case of a failure. There will also be a `,_jsx(_components.code,{children:`retryable=true|false`}),` field in the response body, but you can also find a breakdown below. Most errors are not retryable and are client errors related to the file provided for parsing.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Error Code`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{children:`Retryable`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`INVALID_CONFIG_OPTIONS`})}),_jsx(_components.td,{children:`Invalid combination of options in the incoming config.`}),_jsx(_components.td,{children:`❌`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`UNABLE_TO_DOWNLOAD_FILE`})}),_jsx(_components.td,{children:`The system could not download the file from the provided URL, likely means your presigned url is expired, or malformed somehow.`}),_jsx(_components.td,{children:`❌`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`FILE_TYPE_NOT_SUPPORTED`})}),_jsx(_components.td,{children:`The file type is not supported for parsing.`}),_jsx(_components.td,{children:`❌`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`FILE_SIZE_TOO_LARGE`})}),_jsx(_components.td,{children:`The file exceeds the maximum allowed size.`}),_jsx(_components.td,{children:`❌`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CORRUPT_FILE`})}),_jsx(_components.td,{children:`The file is corrupt and cannot be parsed.`}),_jsx(_components.td,{children:`❌`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`OCR_ERROR`})}),_jsx(_components.td,{children:`An error occurred in the OCR system. This is a rare error code and would indicate downtime, so requests can be retried. We’d suggest applying a retry with backoff for this error.`}),_jsx(_components.td,{children:`✅`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PASSWORD_PROTECTED_FILE`})}),_jsx(_components.td,{children:`The file is password protected and cannot be parsed.`}),_jsx(_components.td,{children:`❌`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`FAILED_TO_CONVERT_TO_PDF`})}),_jsx(_components.td,{children:`The system could not convert the file to PDF format.`}),_jsx(_components.td,{children:`❌`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`FAILED_TO_GENERATE_TARGET_FORMAT`})}),_jsx(_components.td,{children:`The system could not generate the requested target format.`}),_jsx(_components.td,{children:`❌`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`INTERNAL_ERROR`})}),_jsx(_components.td,{children:`An unexpected internal error occurred. We’d suggest applying a retry with backoff for this error as it likely a result of some outage.`}),_jsx(_components.td,{children:`✅`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`http-error-codes`,children:`HTTP error codes`}),`\n`,_jsx(_components.p,{children:`Corresponding http error codes for different types of failures. We generally recommend relying on our custom error codes for programmatic handling.`}),`\n`,_jsxs(ResponseField,{name:`400 Bad Request`,id:`param-400-bad-request`,children:[_jsx(_components.p,{children:`Returned when:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Required fields are missing (e.g., `,_jsx(_components.code,{children:`file`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Neither `,_jsx(_components.code,{children:`fileUrl`}),` nor `,_jsx(_components.code,{children:`fileBase64`}),` is provided in the file object`]}),`\n`,_jsxs(_components.li,{children:[`The provided `,_jsx(_components.code,{children:`fileUrl`}),` is invalid`]}),`\n`,_jsxs(_components.li,{children:[`The provided `,_jsx(_components.code,{children:`fileBase64`}),` is invalid`]}),`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.code,{children:`config`}),` contains invalid values (e.g., unsupported target format or chunking strategy)`]}),`\n`,_jsx(_components.li,{children:`The file type is not supported`}),`\n`,_jsx(_components.li,{children:`The file size is too large`}),`\n`]})]}),`\n`,_jsxs(ResponseField,{name:`401 Unauthorized`,id:`param-401-unauthorized`,children:[_jsx(_components.p,{children:`Returned when:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The API token is missing`}),`\n`,_jsx(_components.li,{children:`The API token is invalid`}),`\n`]})]}),`\n`,_jsxs(ResponseField,{name:`403 Forbidden`,id:`param-403-forbidden`,children:[_jsx(_components.p,{children:`Returned when:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The authenticated workspace doesn’t have permission to use the parse functionality`}),`\n`,_jsx(_components.li,{children:`The API token doesn’t have sufficient permissions`}),`\n`]})]}),`\n`,_jsxs(ResponseField,{name:`422 Unprocessable Entity`,id:`param-422-unprocessable-entity`,children:[_jsx(_components.p,{children:`Returned when:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The file is corrupt and cannot be parsed`}),`\n`,_jsx(_components.li,{children:`The file is password protected`}),`\n`,_jsx(_components.li,{children:`The file could not be converted to PDF`}),`\n`,_jsx(_components.li,{children:`The system failed to generate the target format`}),`\n`]})]}),`\n`,_jsxs(ResponseField,{name:`500 Internal Server Error`,id:`param-500-internal-server-error`,children:[_jsx(_components.p,{children:`Returned when:`}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`An OCR error occurs`}),`\n`,_jsx(_components.li,{children:`A chunking error occurs`}),`\n`,_jsx(_components.li,{children:`Any other unexpected error occurs during parsing`}),`\n`]})]}),`\n`,_jsx(Heading,{level:`3`,id:`handling-errors`,children:`Handling Errors`}),`\n`,_jsx(_components.p,{children:`Here are examples of how to handle errors from the Parse API:`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Error Handling in Node.js`,numberOfLines:`61`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`61`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` axios`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` require`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"axios\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` parseDocument`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` axios`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-prod.extend.app/parse\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` file:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fileName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"example.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fileUrl:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://example.com/documents/example.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` config:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` target:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"markdown\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Bearer \u003cAPI_TOKEN>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Document parsed successfully:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`requestId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`retryable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Handle specific error codes`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` switch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"FILE_TYPE_NOT_SUPPORTED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Unsupported file type. Please use a supported format.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"PASSWORD_PROTECTED_FILE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The file is password protected. Please provide an unprotected file.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"CORRUPT_FILE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The file is corrupt and cannot be processed.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"FILE_SIZE_TOO_LARGE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The file is too large. Please reduce the file size.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Error (\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`): `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Log request ID for troubleshooting`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Request ID: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`requestId`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Potentially retry if the error is retryable`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retryable`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"This error is retryable. Consider retrying the request.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Network error:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error Handling in Python`,numberOfLines:`53`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`53`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` parse_document`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`file_url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`file_name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`is`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` config `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"target\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"markdown\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` url `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-prod.extend.app/parse\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` headers `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer \u003cAPI_TOKEN>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` payload `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"file\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fileName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: file_name,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fileUrl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: file_url`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"config\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: config`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(url, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`payload, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`headers)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.raise_for_status() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Raise exception for 4XX/5XX responses`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.exceptions.HTTPError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error_data `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e.response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error_data.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` message `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error_data.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` request_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error_data.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"requestId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` retryable `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error_data.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"retryable\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Handle specific error codes`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"FILE_TYPE_NOT_SUPPORTED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Error: Unsupported file type. `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"PASSWORD_PROTECTED_FILE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Error: Password protected file. `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"CORRUPT_FILE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Error: Corrupt file. `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"FILE_SIZE_TOO_LARGE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Error: File too large. `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Error (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`code`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`): `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Log request ID for troubleshooting`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Request ID: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`request_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Potentially retry if the error is retryable`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` retryable:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"This error is retryable. Consider retrying the request.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.exceptions.RequestException `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Network error: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(e)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`})}),`\n`]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Parse File","api":"POST https://api-prod.extend.app/parse","description":"Parse files to get cleaned, chunked target content (e.g. markdown).","href":"/api-reference/endpoint/parse"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Body","slug":"body","depth":3,"children":[]},{"title":"Response","slug":"response","depth":3,"children":[]},{"title":"Using Parsed Output","slug":"using-parsed-output","depth":3,"children":[]},{"title":"Working with Chunks","slug":"working-with-chunks","depth":4,"children":[]},{"title":"When to use chunk.content vs. chunk.blocks","slug":"when-to-use-chunk-content-vs-chunk-blocks","depth":4,"children":[]},{"title":"Example: Extracting specific content types","slug":"example-extracting-specific-content-types","depth":4,"children":[]},{"title":"Example: Reconstructing content with custom formatting","slug":"example-reconstructing-content-with-custom-formatting","depth":4,"children":[]},{"title":"Spatial Information","slug":"spatial-information","depth":4,"children":[]},{"title":"Error Response Format","slug":"error-response-format","depth":3,"children":[]},{"title":"Custom Error Codes","slug":"custom-error-codes","depth":3,"children":[]},{"title":"Custom Error Codes","slug":"custom-error-codes-2","depth":3,"children":[]},{"title":"HTTP error codes","slug":"http-error-codes","depth":3,"children":[]},{"title":"Handling Errors","slug":"handling-errors","depth":3,"children":[]}],"codeExamples":{},"endpoint":{"title":"Parse File","path":"/parse","servers":[{"url":"https://api-prod.extend.app"}],"method":"post","request":{"security":[{"title":"Bearer Auth","parameters":{"header":{"Authorization":{"type":"http","scheme":"bearer","description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token."}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"file":[{"type":"object","properties":{"fileName":[{"type":"string","description":"The name of the file. If not set, the file name is taken from the url or generated in case of raw upload."}],"fileUrl":[{"type":"string","description":"A URL for the file. For production use cases, we recommend using presigned URLs with a 5-15 minute expiration time."}],"fileId":[{"type":"string","description":"If you already have an Extend file id (for instance from running a workflow or a previous file upload ) then you can use that file id when running the parse endpoint so that it leverage any cached data that might be available."}]},"description":"A file object containing either a URL or base64 encoded content. Must contain either fileUrl or fileId.","required":true}],"config":[{"type":"object","properties":{"target":[{"type":"string","description":"The target format for the parsed content. Supported values: `markdown` : Convert document to Markdown format `spatial` : Preserve spatial information in the output"}],"chunkingStrategy":[{"type":"object","properties":{"type":[{"type":"string","description":"The type of chunking strategy. Supported values: `page` : Chunk document by pages. `document` : Entire document is a single chunk. Essentially no chunking. `section` : Split by logical sections. Not support for target=spatial."}],"minCharacters":[{"type":"number","description":"Specify a minimum number of characters per chunk."}],"maxCharacters":[{"type":"number","description":"Specify a maximum number of characters per chunk."}]},"description":"Strategy for dividing the document into chunks."}],"blockOptions":[{"type":"object","properties":{"figures":[{"type":"object","properties":{"enabled":[{"type":"boolean","description":"Whether to include figures in the output."}],"figureImageClippingEnabled":[{"type":"boolean","description":"Whether to clip and extract images from figures."}]},"description":"Options for figure blocks."}],"tables":[{"type":"object","properties":{"enabled":[{"type":"boolean","description":"Whether to include tables in the output."}],"targetFormat":[{"type":"string","description":"The target format for the table blocks. Supported values: `markdown` : Convert table to Markdown format `html` : Convert table to HTML format"}]},"description":"Options for table blocks."}],"text":[{"type":"object","properties":{"signatureDetectionEnabled":[{"type":"boolean","description":"Whether an additional vision model will be utilized for advanced signature detection. Recommended, for most use cases, but should be disabled if signature detection is not necessary and latency is a concern."}]},"description":"Options for text blocks."}]},"description":"Options for controlling how different block types are processed."}],"advancedOptions":[{"type":"object","properties":{"pageRotationEnabled":[{"type":"boolean","description":"Whether to automatically detect and correct page rotation."}]},"description":"Advanced parsing options."}]},"description":"Configuration options for the parsing process.","required":true}]}}],"examples":{"example":{"value":{"file":{"fileName":"\u003cstring>","fileUrl":"\u003cstring>","fileId":"\u003cstring>"},"config":{"target":"\u003cstring>","chunkingStrategy":{"type":"\u003cstring>","minCharacters":123,"maxCharacters":123},"blockOptions":{"figures":{"enabled":true,"figureImageClippingEnabled":true},"tables":{"enabled":true,"targetFormat":"\u003cstring>"},"text":{"signatureDetectionEnabled":true}},"advancedOptions":{"pageRotationEnabled":true}}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"object":[{"type":"string","description":"The type of object. Will always be “parser_run”."}],"id":[{"type":"string","description":"A unique identifier for the parser run."}],"fileId":[{"type":"string","description":"The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs. This allows downstream processing to reuse a cache of the parsed file content to reduce your usage costs."}],"chunks":[{"type":"array","items":[{"type":"object","properties":{"object":[{"type":"string","description":"The type of object. Will be “chunk”."}],"type":[{"type":"string","description":"The type of chunk (e.g., “page”)."}],"content":[{"type":"string","description":"The textual content of the chunk in the specified target format."}],"metadata":[{"type":"object","properties":{"pageRange":[{"type":"object","properties":{"start":[{"type":"number","description":"The starting page number (inclusive)."}],"end":[{"type":"number","description":"The ending page number (inclusive)."}]},"description":"The page range this chunk covers. Often will just be a partial page, in which cases `start` and `end` will be the same."}]},"description":"Metadata about the chunk."}],"blocks":[{"type":"array","items":[{"type":"object","properties":{"object":[{"type":"string","description":"The type of object. Will be “block”."}],"id":[{"type":"string","description":"A unique identifier for the block."}],"type":[{"type":"string","description":"The type of block. Possible values include: `text` : Regular text content `heading` : Section or document headings `section_heading` : Subsection headings `table` : Tabular data with rows and columns `figure` : Images, charts, or diagrams"}],"content":[{"type":"string","description":"The textual content of the block."}],"details":[{"type":"object","properties":{},"description":"Additional details specific to the block type."}],"metadata":[{"type":"object","properties":{"page":[{"type":"object","properties":{"number":[{"type":"number","description":"The page number."}],"width":[{"type":"number","description":"The width of the page in inches."}],"height":[{"type":"number","description":"The height of the page in inches."}]},"description":"Information about the page this block appears on."}]},"description":"Metadata about the block."}],"polygon":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"An array of points defining the polygon that bounds the block."}],"boundingBox":[{"type":"object","properties":{},"description":"A simplified bounding box for the block."}]}}],"description":"An array of block objects that make up the chunk. See the Block object documentation for more detailed information about block structure and types."}]}}],"description":"An array of chunks extracted from the document."}],"status":[{"type":"string","description":"The status of the parser run. Possible values: `PROCESSED` : The file was successfully processed `FAILED` : The processing failed (see failureReason for details)"}],"failureReason":[{"type":"string","description":"The reason for failure if status is “FAILED”. Will be null for successful runs."}],"config":[{"type":"object","properties":{},"description":"The configuration used for the parsing process, including any default values that were applied."}],"metrics":[{"type":"object","properties":{"processingTimeMs":[{"type":"number","description":"The time taken to process the document in milliseconds."}],"pageCount":[{"type":"number","description":"The number of pages in the document."}]},"description":"Metrics about the parsing process."}],"code":[{"type":"string","description":"A specific error code that identifies the type of error."}],"message":[{"type":"string","description":"A human-readable description of the error."}],"requestId":[{"type":"string","description":"A unique identifier for the request, useful for troubleshooting."}],"retryable":[{"type":"boolean","description":"Indicates whether retrying the request might succeed."}]}}],"examples":{"example":{"value":{"object":"\u003cstring>","id":"\u003cstring>","fileId":"\u003cstring>","chunks":[{"object":"\u003cstring>","type":"\u003cstring>","content":"\u003cstring>","metadata":{"pageRange":{"start":123,"end":123}},"blocks":[{"object":"\u003cstring>","id":"\u003cstring>","type":"\u003cstring>","content":"\u003cstring>","details":{},"metadata":{"page":{"number":123,"width":123,"height":123}},"polygon":[{}],"boundingBox":{}}]}],"status":"\u003cstring>","failureReason":"\u003cstring>","config":{},"metrics":{"processingTimeMs":123,"pageCount":123},"code":"\u003cstring>","message":"\u003cstring>","requestId":"\u003cstring>","retryable":true}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"tryextend","siteName":"Extend","title":"Parse File - Extend","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{"2025-04-21":{"href":"/api-reference/endpoint/parse","matchLevel":0},"2024-12-23":{"href":"/api-reference/endpoint/parse","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T03:55:38.450Z","originalFileLocation":"api-reference/endpoint/parse.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Parse files to get cleaned, chunked target content (e.g. markdown).\">\u003cmeta data-mint-head name=\"application-name\" content=\"Extend\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Parse File - Extend\">\u003cmeta data-mint-head property=\"og:description\" content=\"Parse files to get cleaned, chunked target content (e.g. markdown).\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Extend\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.extend.app/api-reference/endpoint/parse\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tryextend.mintlify.site/_mintlify/api/og/v2?division=Parse+Endpoints\u0026amp;title=Parse+File\u0026amp;description=Parse+files+to+get+cleaned%2C+chunked+target+content+%28e.g.+markdown%29.\u0026amp;theme=a092852b4845b3f9207a97d5\u0026amp;signature=c8aa7da26b6178ca8203200943ac8f8c9f4e45285c618ec1ed534487b13f4755\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Parse File - Extend\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Parse files to get cleaned, chunked target content (e.g. markdown).\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tryextend.mintlify.site/_mintlify/api/og/v2?division=Parse+Endpoints\u0026amp;title=Parse+File\u0026amp;description=Parse+files+to+get+cleaned%2C+chunked+target+content+%28e.g.+markdown%29.\u0026amp;theme=a092852b4845b3f9207a97d5\u0026amp;signature=c8aa7da26b6178ca8203200943ac8f8c9f4e45285c618ec1ed534487b13f4755\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/tryextend/ARUs0RnNqdDjcqQq/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Extend\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#12A7D3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.extend.app/api-reference/endpoint/parse\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/parse.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.extend.app/#organization\",\"name\":\"Extend\",\"url\":\"https://docs.extend.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tryextend/fwFG7xdTywjiFfYq/logo/light.png?fit=max\u0026auto=format\u0026n=fwFG7xdTywjiFfYq\u0026q=85\u0026s=d5b60497f53e7cb8865d11cf97636755\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.extend.app#website\",\"name\":\"Extend\",\"url\":\"https://docs.extend.app\",\"publisher\":{\"@id\":\"https://docs.extend.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.extend.app/api-reference/endpoint/parse#webpage\",\"url\":\"https://docs.extend.app/api-reference/endpoint/parse\",\"name\":\"Parse File\",\"description\":\"Parse files to get cleaned, chunked target content (e.g. markdown).\",\"dateModified\":\"2026-01-07T03:55:38.450Z\",\"isPartOf\":{\"@id\":\"https://docs.extend.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.extend.app/api-reference/endpoint/parse#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.extend.app/api-reference/endpoint/parse#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Extend\",\"item\":\"https://docs.extend.app\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Parse File\",\"item\":\"https://docs.extend.app/api-reference/endpoint/parse\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.extend.app/api-reference/endpoint/parse#apireference\",\"headline\":\"Parse File\",\"name\":\"Parse File\",\"description\":\"Parse files to get cleaned, chunked target content (e.g. markdown).\",\"url\":\"https://docs.extend.app/api-reference/endpoint/parse\",\"mainEntityOfPage\":{\"@id\":\"https://docs.extend.app/api-reference/endpoint/parse#webpage\"},\"dateModified\":\"2026-01-07T03:55:38.450Z\",\"publisher\":{\"@id\":\"https://docs.extend.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.extend.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Extend\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Extend\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoint/parse.md","siteName":"Extend","nav":{"global":null,"versions":[{"version":"2025-04-21","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Documentation","pages":[{"title":"Authentication","href":"/api-reference/authentication"},{"title":"API Versioning","href":"/api-reference/api_versioning"}]},{"group":"Workflow Endpoints","pages":[{"title":"Run Workflow","api":"POST https://api-prod.extend.app/workflow_runs","href":"/api-reference/endpoint/run_workflow"},{"title":"Batch Run Workflow","api":"POST https://api-prod.extend.app/workflow_runs/batch","href":"/api-reference/endpoint/run_workflow_batch"},{"title":"Get Workflow Run","api":"GET https://api-prod.extend.app/workflow_runs/:workflowRunId","href":"/api-reference/endpoint/get_workflow_run"},{"title":"List Workflow Runs","api":"GET https://api-prod.extend.app/workflow_runs","href":"/api-reference/endpoint/list_workflow_runs"},{"title":"Update Workflow Run","api":"POST https://api-prod.extend.app/workflow_runs/:id","href":"/api-reference/endpoint/update_workflow_run"},{"title":"Correct Workflow Run Outputs","api":"POST https://api-prod.extend.app/workflow_runs/:workflowRunId/outputs/:outputId","href":"/api-reference/endpoint/correct_workflow_run"},{"title":"Create Workflow","api":"POST https://api-prod.extend.app/workflows","href":"/api-reference/endpoint/create_workflow"}]},{"group":"Processor Endpoints","pages":[{"title":"Run Processor","api":"POST https://api-prod.extend.app/v1/processor_runs","href":"/api-reference/endpoint/run_processor20250421"},{"title":"Get Processor Run","api":"GET https://api-prod.extend.app/processor_runs/{id}","href":"/api-reference/endpoint/get_processor_run"},{"title":"Get Batch Processor Run","api":"GET https://api-prod.extend.app/batch_processor_runs/{id}","href":"/api-reference/endpoint/get_batch_processor_run"},{"title":"Create Processor","api":"POST https://api-prod.extend.app/v1/processors","href":"/api-reference/endpoint/create_processor20250421"},{"title":"Update Processor","api":"POST https://api-prod.extend.app/v1/processors/:id","href":"/api-reference/endpoint/update_processor20250421"},{"title":"Publish Processor Version","api":"POST https://api-prod.extend.app/v1/processors/:id/publish","href":"/api-reference/endpoint/publish_processor_version20250421"},{"title":"Get Processor Version","api":"GET https://api-prod.extend.app/processors/:ProcessorId/versions/:processorVersionId","href":"/api-reference/endpoint/get_processor_version"},{"title":"List Processor Versions","api":"GET https://api-prod.extend.app/processors/:id/versions","description":"Retrieve all versions of a specific processor in Extend.","href":"/api-reference/endpoint/get_processor_versions"}]},{"group":"Parse Endpoints","pages":[{"title":"Parse File","api":"POST https://api-prod.extend.app/parse","href":"/api-reference/endpoint/parse"}]},{"group":"File Endpoints","pages":[{"title":"Upload File","api":"POST https://api-prod.extend.app/files/upload","description":"Upload and create a new file in Extend.","href":"/api-reference/endpoint/upload_file"},{"title":"Get File","api":"GET https://api-prod.extend.app/files/:id?rawText=true","href":"/api-reference/endpoint/get_file"},{"title":"List Files","api":"GET https://api-prod.extend.app/files","href":"/api-reference/endpoint/list_files"},{"title":"[DEPRECATED] Create File","api":"POST https://api-prod.extend.app/files","href":"/api-reference/endpoint/create_file"}]},{"group":"Evaluation Set Endpoints","pages":[{"title":"Create Evaluation Set","api":"POST https://api-prod.extend.app/evaluation_sets","href":"/api-reference/endpoint/create_eval_set"},{"title":"Create Evaluation Set Item","api":"POST https://api-prod.extend.app/evaluation_set_items","href":"/api-reference/endpoint/create_eval_set_item"},{"title":"Update Evaluation Set Item","api":"POST https://api-prod.extend.app/evaluation_set_items/:id","href":"/api-reference/endpoint/update_eval_set_item"},{"title":"Bulk Create Evaluation Set Items","api":"POST https://api-prod.extend.app/evaluation_set_items/bulk","href":"/api-reference/endpoint/bulk_create_eval_set_item"}]},{"group":"Objects","pages":[{"title":"The Block Object","href":"/api-reference/objects/block"},{"title":"The EvaluationSet object","href":"/api-reference/objects/evaluation_set"},{"title":"The EvaluationSetItem object","href":"/api-reference/objects/evaluation_set_item"},{"title":"The File object","href":"/api-reference/objects/file"},{"title":"The Processor object","href":"/api-reference/objects/processor"},{"title":"The ProcessorRun object","href":"/api-reference/objects/processor_run"},{"title":"The BatchProcessorRun object","href":"/api-reference/objects/batch_processor_run"},{"title":"The ProcessorVersion object","href":"/api-reference/objects/processor_version"},{"title":"The Workflow object","href":"/api-reference/objects/workflow"},{"title":"The WorkflowRun object","href":"/api-reference/objects/workflow_run"},{"title":"The WorkflowRun Summary object","href":"/api-reference/objects/workflow_run_summary"}]},{"group":"Guides","pages":[{"title":"Processor configs","href":"/api-reference/guides/processor_configs20250421"},{"title":"Processor output types","href":"/api-reference/guides/output_types20250421"},{"title":null,"href":"/api-reference/guides/bounding_boxes"},{"title":"Supported File Types","href":"/api-reference/supported_file_types"}]},{"group":"Webhooks","pages":[{"title":"Configuration","href":"/api-reference/webhooks/webhooks"},{"title":"Events","href":"/api-reference/webhooks/events"}]}]},{"tab":"Processor Changelog","pages":[{"title":"Processor Changelog","href":"/changelog/overview"}]}]},{"version":"2024-12-23","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Documentation","pages":[{"title":"Authentication","href":"/api-reference/authentication"},{"title":"API Versioning","href":"/api-reference/api_versioning"}]},{"group":"Workflow Endpoints","pages":[{"title":"Run Workflow","api":"POST https://api-prod.extend.app/workflow_runs","href":"/api-reference/endpoint/run_workflow"},{"title":"Batch Run Workflow","api":"POST https://api-prod.extend.app/workflow_runs/batch","href":"/api-reference/endpoint/run_workflow_batch"},{"title":"Get Workflow Run","api":"GET https://api-prod.extend.app/workflow_runs/:workflowRunId","href":"/api-reference/endpoint/get_workflow_run"},{"title":"List Workflow Runs","api":"GET https://api-prod.extend.app/workflow_runs","href":"/api-reference/endpoint/list_workflow_runs"},{"title":"Update Workflow Run","api":"POST https://api-prod.extend.app/workflow_runs/:id","href":"/api-reference/endpoint/update_workflow_run"},{"title":"Correct Workflow Run Outputs","api":"POST https://api-prod.extend.app/workflow_runs/:workflowRunId/outputs/:outputId","href":"/api-reference/endpoint/correct_workflow_run"},{"title":"Create Workflow","api":"POST https://api-prod.extend.app/workflows","href":"/api-reference/endpoint/create_workflow"}]},{"group":"Processor Endpoints","pages":[{"title":"Run Processor","api":"POST https://api-prod.extend.app/processor_runs","href":"/api-reference/endpoint/run_processor"},{"title":"Get Processor Run","api":"GET https://api-prod.extend.app/processor_runs/{id}","href":"/api-reference/endpoint/get_processor_run"},{"title":"Get Batch Processor Run","api":"GET https://api-prod.extend.app/batch_processor_runs/{id}","href":"/api-reference/endpoint/get_batch_processor_run"},{"title":"Create Processor","api":"POST https://api-prod.extend.app/processors","href":"/api-reference/endpoint/create_processor"},{"title":"Update Processor","api":"POST https://api-prod.extend.app/processors/:id","href":"/api-reference/endpoint/update_processor"},{"title":"Publish Processor Version","api":"POST https://api-prod.extend.app/processors/:id/publish","href":"/api-reference/endpoint/publish_processor_version"},{"title":"Get Processor Version","api":"GET https://api-prod.extend.app/processors/:ProcessorId/versions/:processorVersionId","href":"/api-reference/endpoint/get_processor_version"},{"title":"List Processor Versions","api":"GET https://api-prod.extend.app/processors/:id/versions","description":"Retrieve all versions of a specific processor in Extend.","href":"/api-reference/endpoint/get_processor_versions"}]},{"group":"Parse Endpoints","pages":[{"title":"Parse File","api":"POST https://api-prod.extend.app/parse","href":"/api-reference/endpoint/parse"}]},{"group":"File Endpoints","pages":[{"title":"Upload File","api":"POST https://api-prod.extend.app/files/upload","description":"Upload and create a new file in Extend.","href":"/api-reference/endpoint/upload_file"},{"title":"Get File","api":"GET https://api-prod.extend.app/files/:id?rawText=true","href":"/api-reference/endpoint/get_file"},{"title":"List Files","api":"GET https://api-prod.extend.app/files","href":"/api-reference/endpoint/list_files"},{"title":"[DEPRECATED] Create File","api":"POST https://api-prod.extend.app/files","href":"/api-reference/endpoint/create_file"}]},{"group":"Evaluation Set Endpoints","pages":[{"title":"Create Evaluation Set","api":"POST https://api-prod.extend.app/evaluation_sets","href":"/api-reference/endpoint/create_eval_set"},{"title":"Create Evaluation Set Item","api":"POST https://api-prod.extend.app/evaluation_set_items","href":"/api-reference/endpoint/create_eval_set_item"},{"title":"Update Evaluation Set Item","api":"POST https://api-prod.extend.app/evaluation_set_items/:id","href":"/api-reference/endpoint/update_eval_set_item"},{"title":"Bulk Create Evaluation Set Items","api":"POST https://api-prod.extend.app/evaluation_set_items/bulk","href":"/api-reference/endpoint/bulk_create_eval_set_item"}]},{"group":"Objects","pages":[{"title":"The Block Object","href":"/api-reference/objects/block"},{"title":"The EvaluationSet object","href":"/api-reference/objects/evaluation_set"},{"title":"The EvaluationSetItem object","href":"/api-reference/objects/evaluation_set_item"},{"title":"The File object","href":"/api-reference/objects/file"},{"title":"The Processor object","href":"/api-reference/objects/processor"},{"title":"The ProcessorRun object","href":"/api-reference/objects/processor_run"},{"title":"The BatchProcessorRun object","href":"/api-reference/objects/batch_processor_run"},{"title":"The ProcessorVersion object","href":"/api-reference/objects/processor_version"},{"title":"The Workflow object","href":"/api-reference/objects/workflow"},{"title":"The WorkflowRun object","href":"/api-reference/objects/workflow_run"},{"title":"The WorkflowRun Summary object","href":"/api-reference/objects/workflow_run_summary"}]},{"group":"Guides","pages":[{"title":"Processor configs","href":"/api-reference/guides/processor_configs"},{"title":"Processor output types","href":"/api-reference/guides/output_types"},{"title":null,"href":"/api-reference/guides/bounding_boxes"},{"title":"Supported File Types","href":"/api-reference/supported_file_types"}]},{"group":"Webhooks","pages":[{"title":"Configuration","href":"/api-reference/webhooks/webhooks"},{"title":"Events","href":"/api-reference/webhooks/events"}]}]},{"tab":"Processor Changelog","pages":[{"title":"Processor Changelog","href":"/changelog/overview"}]}]}]},"basePath":"","title":"Parse File - Extend","deploymentId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","buildId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-B8kPdtB2.js","snippetPresets-C-p1aFQ1.js","utils-B9NnUZSZ.js","style-to-object-BY3JEAdk.js","utils-DFxl7cW2.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-bSr9h7OB.js","conditional-requirements-CFM0id0Q.js","cloneDeep-Bw4Gcy_r.js","_Uint8Array-C68x8Gny.js","isObject-FP1Yky1u.js","ApiExamples-BXsp8PHs.js","usePlaygroundInputsStore-BlAOLmIF.js","shallow-C2F02mqa.js","isEqual-C8iG4q2G.js","CodeSnippets-45lHR04X.js","CodeSnippet-6Cemznl-.js","use-playground-group-access-Cyy8SXp5.js","Page-CeZ_ZB5X.js","api-description-markdown-DiOdv5rp.js","DynamicMarkdown-B_9ywLDq.js","SectionHeading-Cc2r-uqU.js","MethodPill-Df3Tcu4c.js","getPastedJson-B3vrV0wE.js","Check2Icon-YQhSFafd.js","axios-CsQoIw0U.js"]}