---
title: "POST /documents/v1/parse"
method: POST
path: "/documents/v1/parse"
tags: ["parse"]
---

# POST /documents/v1/parse

`POST /documents/v1/parse`

## Request body

- object
  - `file` string, nullable — The file to parse. This can be a remote file URL or a tensorlake file (e.g. `file_***`). If a remote file URL is provided, the file will be downloaded and parsed. For a tensorlake file, the file needs to be uploaded to the server first. This field is optional and is only used if the `content` field is not provided. If both fields are provided, this field takes precedence.
  - `content` string, nullable — The content to parse. This can be any kind of text e.g. an email content, or an HTML page. This field is optional and is only used if the `file` field is not provided. If both fields are provided, the `file` field takes precedence.
  - `mimeType` 'application/pdf' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' | 'application/vnd.apple.keynote' | 'image/jpeg' | 'text/plain' | 'text/html' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/vnd.ms-excel.sheet.macroEnabled.12' | 'application/vnd.ms-excel' | 'text/csv' | 'image/png'
  - `pages` string, nullable — The page number to parse. This is only used if the `file` field is provided, and is a pageable file (e.g. PDF). If not provided, all pages will be parsed.
  - `settings` Settings
    - `tableParsingMode` 'tsr' | 'vlm' | 'unknown'
    - `tableOutputMode` 'markdown' | 'html'
    - `tableSummarization` boolean — Whether to summarize the contents of the tables.
    - `tableSummarizationPrompt` string, nullable — The prompt to use for table summarization.
    - `figureSummarization` boolean — Whether to summarize the contents of the figures.
    - `figureSummarizationPrompt` string, nullable — The prompt to use for figure summarization. If not provided, the default prompt will be used.
    - `formDetectionMode` 'vlm' | 'tsr' | 'unknown'
    - `chunkStrategy` 'page' | 'section' | 'fragment' — Chunking strategy determines how the document is chunked into smaller pieces. This is only supported in Markdown mode.
    - `jsonSchema` unknown
    - `structuredExtractionPrompt` string, nullable — Overide the prompt to customize structured extractions. Use this if you want to extract data from a file using a different prompt than the one we use to extract.
    - `modelProvider` 'tensorlake' | 'claude-3-5-sonnet-latest' | 'gpt-4o-mini' — The model provider to use for structured data extraction.
    - `deliverWebhook` boolean — Whether to deliver a webhook when the job is completed. A webhook needs to be configured for this to work. If a webhook is not configured, the job will still be processed but the webhook will not be delivered.
    - `detectSignature` boolean — Boolean to perform signature detection.
    - `skewCorrection` boolean — Skew correction for the document.
    - `disableLayoutDetection` boolean — Whether to disable layout detection.
    - `structuredExtractionSkipOcr` boolean — Whether to skip OCR for structured extraction.
    - `detectStrikethrough` boolean
  - `labels` object, nullable — Additional metadata for the job.

## Response `200`

Parse pages from a file

- JobDispatchedResponse
  - `jobId` string, required
  - `fileId` string, required
  - `status` string, required

## Other responses

- `400` — Invalid request
- `401` — Unauthorized. Invalid or missing credentials
- `403` — Forbidden. You do not have permission to access this resource
- `500` — Internal server error

---

[API](https://skmtc.net/tensorlakeai/apis/tensorlake-api.md) · [All operations](https://skmtc.net/tensorlakeai/apis/tensorlake-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tensorlakeai/tensorlake-api/revisions/fb161f7c0ab7/schema)
