Skip to main content
POST
/
tasks
/
parse
Create Parse Task
curl --request POST \
  --url https://api.chunkr.ai/api/v1/tasks/parse \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "chunk_processing": {
    "ignore_headers_and_footers": true,
    "target_length": 4096,
    "tokenizer": {
      "Enum": "Word"
    }
  },
  "error_handling": "Fail",
  "llm_processing": {
    "fallback_strategy": "None",
    "llm_model_id": "<string>",
    "max_completion_tokens": 1,
    "temperature": 123
  },
  "ocr_strategy": "All",
  "pipeline": "Azure",
  "segment_processing": null,
  "segmentation_strategy": "LayoutAnalysis",
  "expires_in": 123,
  "file": "<string>",
  "file_name": "<string>"
}'
{
  "configuration": {
    "chunk_processing": {
      "ignore_headers_and_footers": true,
      "target_length": 4096,
      "tokenizer": {
        "Enum": "Word"
      }
    },
    "error_handling": "Fail",
    "llm_processing": {
      "fallback_strategy": "None",
      "llm_model_id": "<string>",
      "max_completion_tokens": 1,
      "temperature": 123
    },
    "ocr_strategy": "All",
    "pipeline": "Azure",
    "segment_processing": null,
    "segmentation_strategy": "LayoutAnalysis"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "file_info": {
    "mime_type": "<string>",
    "name": "<string>",
    "page_count": 1,
    "url": "<string>"
  },
  "finished_at": "2023-11-07T05:31:56Z",
  "input_file_url": "<string>",
  "message": "<string>",
  "output": null,
  "started_at": "2023-11-07T05:31:56Z",
  "status": "Starting",
  "task_id": "<string>",
  "task_type": "Parse",
  "task_url": "<string>",
  "version_info": {
    "client_version": "Legacy",
    "server_version": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Body

application/json

JSON request to create a parse task

file
string
required

The file to be parsed. Supported inputs:

  • ch://files/{file_id}: Reference to an existing file. Upload via the Files API
  • http(s)://...: Remote URL to fetch
  • data:*;base64,... or raw base64 string
chunk_processing
object

Controls the setting for the chunking and post-processing of each chunk.

error_handling
enum<string>
default:Fail

Controls how errors are handled during processing:

  • Fail: Stops processing and fails the task when any error occurs
  • Continue: Attempts to continue processing despite non-critical errors (eg. LLM refusals etc.)
Available options:
Fail,
Continue
llm_processing
object

Controls the LLM used for the task.

ocr_strategy
enum<string>
default:All

Controls the Optical Character Recognition (OCR) strategy.

  • All: Processes all pages with OCR. (Latency penalty: ~0.5 seconds per page)
  • Auto: Selectively applies OCR only to pages with missing or low-quality text. When text layer is present the bounding boxes from the text layer are used.
Available options:
All,
Auto
pipeline
enum<string>
default:Azure
Available options:
Azure,
Chunkr
segment_processing
object | null

Configuration for how each document segment is processed and formatted.

Each segment has sensible defaults, but you can override specific settings:

  • format: Output as Html or Markdown
  • strategy: Auto (rule-based), LLM (AI-generated), or Ignore (skip)
  • crop_image: Whether to crop images to segment bounds
  • extended_context: Use full page as context for LLM processing
  • description: Generate descriptions for segments

Defaults per segment type: Check the documentation for more details.

Only specify the fields you want to change - everything else uses the defaults.

segmentation_strategy
enum<string>
default:LayoutAnalysis

Controls the segmentation strategy:

  • LayoutAnalysis: Analyzes pages for layout elements (e.g., Table, Picture, Formula, etc.) using bounding boxes. Provides fine-grained segmentation and better chunking.
  • Page: Treats each page as a single segment. Faster processing, but without layout element detection and only simple chunking.
Available options:
LayoutAnalysis,
Page
expires_in
integer | null

The number of seconds until task is deleted. Expired tasks can not be updated, polled or accessed via web interface.

file_name
string | null

The name of the file to be parsed. If not set a name will be generated.

Response

Task created successfully.

configuration
object
required
created_at
string<date-time>
required

The date and time when the task was created and queued.

file_info
object
required

Information about the input file.

message
string
required

A message describing the task's status or any errors that occurred.

status
enum<string>
required

The status of the task.

Available options:
Starting,
Processing,
Succeeded,
Failed,
Cancelled
task_id
string
required

The unique identifier for the task.

task_type
enum<string>
required
Available options:
Parse,
Extract
version_info
object
required

Version information for the task.

expires_at
string<date-time> | null

The date and time when the task will expire.

finished_at
string<date-time> | null

The date and time when the task was finished.

input_file_url
string | null
deprecated

The presigned URL of the input file. Deprecated use file_info.url instead.

output
object | null

The processed results of a document parsing task

started_at
string<date-time> | null

The date and time when the task was started.

task_url
string | null

The presigned URL of the task.