v1

latestOpenAPI 3.1.02026-07-13175151.8 KB
Tasks

Create Extract Task

Queues a document/parsed task for extraction and returns a TaskResponse with the assigned task_id, initial configuration, file metadata, and timestamps. The initial status is Starting.

Creates an extract task and returns its metadata immediately.

post/tasks/extract

Request body

schemaobject required

The schema to be used for the extraction.

system_promptstring nullable

The system prompt to be used for the extraction.

expires_ininteger nullable

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

filestring required

The file to be extracted. 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
  • task_id: Reference to an existing parsetask.
file_namestring nullable

The name of the file to be extracted. If not set a name will be generated. Can not be provided if the file is a task_id.

Response

Task created successfully.

completedboolean required

True when the task reaches a terminal state i.e. status is Succeeded or Failed or Cancelled

created_atstring date-time required

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

expires_atstring date-time nullable

The date and time when the task will expire.

finished_atstring date-time nullable

The date and time when the task was finished.

input_file_urlstring nullable

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

messagestring required

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

parse_task_idstring nullable

The ID of the source parse task that was used for extraction

started_atstring date-time nullable

The date and time when the task was started.

status'Starting' | 'Processing' | 'Succeeded' | 'Failed' | 'Cancelled' required

The status of the task.

task_idstring required

The unique identifier for the task.

task_type'Parse' | 'Extract' required
task_urlstring nullable

The presigned URL of the task.