Beta
Batch Processing

Create Batch Job

Changed on

Create a new batch processing job for a directory.

Processes all files in the specified directory according to the job configuration. The job runs asynchronously and you can monitor progress using the job status endpoint.

post/api/v1/beta/batch-processing

Request

  • The document declares no server URL.
  • Auth: HTTP bearer

Query parameters

project_idstring uuid nullable
organization_idstring uuid nullable

Headers

temporal-namespacestring nullable

Cookies

sessionstring nullable

Request body

directory_idstring nullable

ID of the directory containing files to process

item_idsstring[] nullable

List of specific item IDs to process. Either this or directory_id must be provided.

page_sizeinteger

Number of files to fetch per batch from the directory (only used in directory mode)

continue_as_new_thresholdinteger nullable

Maximum number of files to process before calling continue-as-new. If None, continue-as-new is called after every batch. (only used in directory mode)

Example request

{
  "job_config": {
    "rules": [
      {
        "type": "invoice",
        "description": "contains invoice number, line items, and total amount"
      }
    ]
  }
}

Response

Successful Response

status'pending' | 'running' | 'dispatched' | 'completed' | 'failed' | 'cancelled' required

Status of a batch processing job.

effective_atstring date-time
job_record_idstring nullable

The job record ID associated with this status, if any.

error_messagestring nullable

Error message for the latest job attempt, if any.

idstring required

Unique identifier for the batch job

created_atstring date-time nullable

Creation datetime

updated_atstring date-time nullable

Update datetime

project_idstring required

Project this job belongs to

directory_idstring nullable

Directory being processed

job_type'parse' | 'extract' | 'classify' required

Type of batch processing operation.

total_itemsinteger required

Total number of items in the job

processed_itemsinteger

Number of items processed so far

failed_itemsinteger

Number of items that failed processing

skipped_itemsinteger

Number of items skipped (already processed or size limit)

workflow_idstring nullable

Temporal workflow ID for this batch job

started_atstring date-time nullable

Timestamp when job processing started

completed_atstring date-time nullable

Timestamp when job completed

Changes