Parse File
cURL
curl --request POST \
--url https://api.contextual.ai/v1/parse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form raw_file='@example-file' \
--form parse_mode=standard \
--form enable_document_hierarchy=true \
--form enable_split_tables=true \
--form max_split_table_cells=123 \
--form 'page_range=<string>'
Response Codes:
- 200
- 422
Successful Response Example:
{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
Documentation Index
Fetch the complete documentation index at: https://docs.contextual.ai/llms.txt
Authorizations
Authorization
Type: string
In header: required
Format: Bearer <token>, where <token> is your auth token.
Body
Multipart/form-data:
raw_file:
- Type:
file - Required: Yes
- Description: The file to be parsed. Supported types: PDF, DOC/DOCX, PPT/PPTX, PNG, JPG/JPEG.
- Type:
parse_mode:
- Type:
enum<string> - Default:
standard - Options:
basic,standard - Description: The settings for parsing.
- Type:
enable_document_hierarchy:
- Type:
boolean - Description: Adds a table of contents with the structure of the entire document. (Beta feature)
- Type:
enable_split_tables:
- Type:
boolean - Description: Splits large tables for improved LLM comprehension.
- Type:
max_split_table_cells:
- Type:
integer - Description: Threshold for splitting large tables.
- Type:
page_range:
- Type:
string - Description: Represents page ranges to be parsed.
- Type:
Response
Successful Response:
- 200 application/json
- Contains:
/parseresponse object.
- Contains:
Fields:
job_id:- Type:
string<uuid> - Required: Yes
- Description: Unique ID of the parse job.
- Type: