Skip to main content
POST
/
v1
/
projects
/
{project_id}
/
extract
Create Extract Job
curl --request POST \
  --url https://api.example.com/v1/projects/{project_id}/extract \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-selected-account-id: <api-key>' \
  --data @- <<EOF
{
  "parameters": {
    "extraction_schema": {
      "properties": {
        "invoice_id": {
          "description": "The unique invoice identifier.",
          "type": "string"
        },
        "total_amount": {
          "description": "The final amount due.",
          "type": "number"
        }
      },
      "required": [
        "invoice_id",
        "total_amount"
      ],
      "type": "object"
    },
    "generate_citations": true,
    "model": "openai/gpt-4",
    "system_prompt": "You are an expert financial analyst. Extract data with high precision.",
    "user_prompt": "The invoice total can be found near the bottom right. Pay close attention to the 'Total Due' label."
  },
  "source_id": "job_parse_xyz..."
}
EOF
{
  "id": "<string>",
  "project_id": "<string>",
  "operation": "parse",
  "status": "pending",
  "created_at": "2023-11-07T05:31:56Z",
  "object": "job",
  "source_id": "<string>",
  "correlation_id": "<string>",
  "started_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "result": {},
  "error": "<string>",
  "history": [
    {
      "step": "<string>",
      "timestamp": "2023-11-07T05:31:56Z",
      "duration_ms": 123,
      "status": "<string>",
      "details": {}
    }
  ]
}

Authorizations

x-api-key
string
header
required

API key for authentication

x-selected-account-id
string
header
required

Selected Account ID

Path Parameters

project_id
string
required

Body

application/json

Request model for creating an extract job from a parse result.

parameters
ExtractionParameters · object
required

Extraction parameters including schema and prompts

source_id
string
required

The ID of the resource to extract from (file_... or job_...)

Response

Successful Response

Job response model representing an asynchronous operation.

id
string
required

ID of the entity

project_id
string
required

ID of the project

operation
enum<string>
required

Operation type (e.g., 'parse')

Available options:
parse,
extract,
vector_store,
chunk
status
enum<string>
required

Current job status

Available options:
pending,
running,
succeeded,
failed
created_at
string<date-time>
required

When the job was created

object
string
default:job
Allowed value: "job"
source_id
string | null

Source document/file ID

correlation_id
string | null

Request correlation ID for tracing

started_at
string<date-time> | null

When the job started processing

completed_at
string<date-time> | null

When the job completed

result
Result · object

Job result payload when completed

error
string | null

Error message if job failed

history
JobHistoryEvent · object[] | null

Timeline of job execution events