V2
Extract

Create Extract Job

Create an extraction job.

Extracts structured data from a document using either a saved configuration or an inline JSON Schema.

Input

Provide exactly one of:

  • configuration_id — reference a saved extraction config
  • configuration — inline configuration with a data_schema

Document input

Set file_input to a file ID (dfl-...) or a completed parse job ID (pjb-...).

The job runs asynchronously. Poll GET /extract/{job_id} or register a webhook to monitor completion.

post/api/v2/extract

Query parameters

project_idstring uuid nullable
organization_idstring uuid nullable

Cookies

sessionstring nullable

Request body

configuration_idstring nullable

Saved configuration ID

file_inputstring required

File ID or parse job ID to extract from

Example request

{
  "configuration_id": "cfg-11111111-2222-3333-4444-555555555555",
  "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
}

Response

Successful Response

file_inputstring required

File ID or parse job ID that was extracted

idstring required

Unique job identifier (job_id)

project_idstring required

Project this job belongs to

configuration_idstring nullable

Saved extract configuration ID used for this job, if any

statusstring required

Current job status.

  • PENDING — queued, not yet started
  • RUNNING — actively processing
  • COMPLETED — finished successfully
  • FAILED — terminated with an error
  • CANCELLED — cancelled by user
error_messagestring nullable

Error details when status is FAILED

created_atstring date-time required

Creation timestamp

updated_atstring date-time required

Last update timestamp

Example response

{
  "file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "id": "ext-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "project_id": "prj-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "configuration_id": "cfg-11111111-2222-3333-4444-555555555555",
  "configuration": {
    "target_pages": "1,3,5-7",
    "max_pages": 10,
    "tier": "cost_effective",
    "version": "latest",
    "extraction_target": "per_doc",
    "system_prompt": "Extract all monetary values in USD. If a currency is not specified, assume USD.",
    "parse_tier": "fast",
    "parse_config_id": "cfg-11111111-2222-3333-4444-555555555555"
  },
  "status": "COMPLETED",
  "extract_metadata": {
    "field_metadata": {
      "document_metadata": {
        "items": [
          {
            "amount": {
              "citation": [
                {
                  "matching_text": "$10.00",
                  "page": 1
                }
              ],
              "confidence": 1
            },
            "description": {
              "citation": [
                {
                  "matching_text": "$10/month",
                  "page": 1
                }
              ],
              "confidence": 0.998
            }
          }
        ],
        "total": {
          "citation": [
            {
              "matching_text": "$10.00",
              "page": 1
            }
          ],
          "confidence": 1
        },
        "vendor": {
          "citation": [
            {
              "matching_text": "Noisebridge",
              "page": 1
            }
          ],
          "confidence": 1,
          "extraction_confidence": 1,
          "parsing_confidence": 1
        }
      }
    }
  }
}

Changes

Changed in 8 of the 33 revisions of this API.2714

    • added the optional property detail/items/ctx to the response with the 422 status

      response-optional-property-added

    • added the optional property detail/items/input to the response with the 422 status

      response-optional-property-added

    This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • removed the request property configuration/anyOf[subschema #1: ExtractConfiguration]/extract_version

      request-property-removed

    • removed the optional property configuration/anyOf[subschema #1: ExtractConfiguration]/extract_version from the response with the 200 status

      response-optional-property-removed

    • added the new optional request property configuration/anyOf[subschema #1: ExtractConfiguration]/version

      new-optional-request-property

    • added the new classify.running enum value to the request property webhook_configurations/anyOf[subschema #1]/items/webhook_events/anyOf[subschema #1]/items/

      request-property-enum-value-added

    • added the new sheets.cancelled enum value to the request property webhook_configurations/anyOf[subschema #1]/items/webhook_events/anyOf[subschema #1]/items/

      request-property-enum-value-added

    • added the new sheets.error enum value to the request property webhook_configurations/anyOf[subschema #1]/items/webhook_events/anyOf[subschema #1]/items/

      request-property-enum-value-added

    • added the new sheets.partial_success enum value to the request property webhook_configurations/anyOf[subschema #1]/items/webhook_events/anyOf[subschema #1]/items/

      request-property-enum-value-added

    • added the new sheets.pending enum value to the request property webhook_configurations/anyOf[subschema #1]/items/webhook_events/anyOf[subschema #1]/items/

      request-property-enum-value-added

    • added the new sheets.success enum value to the request property webhook_configurations/anyOf[subschema #1]/items/webhook_events/anyOf[subschema #1]/items/

      request-property-enum-value-added

    • added the optional property configuration/anyOf[subschema #1: ExtractConfiguration]/version to the response with the 200 status

      response-optional-property-added

    • removed the optional property metadata/anyOf[subschema #1: ExtractV2JobMetadata]/usage/anyOf[subschema #1: ExtractJobUsage]/num_document_tokens from the response with the 200 status

      response-optional-property-removed

    • removed the optional property metadata/anyOf[subschema #1: ExtractV2JobMetadata]/usage/anyOf[subschema #1: ExtractJobUsage]/num_output_tokens from the response with the 200 status

      response-optional-property-removed

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • api tag LlamaExtract removed

      api-tag-removed

    • api tag LlamaExtract added

      api-tag-added

    This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • api tag LlamaExtract removed

      api-tag-removed

    • removed the request property configuration/anyOf[subschema #1: ExtractConfiguration]/lang

      request-property-removed

    • removed the optional property configuration/anyOf[subschema #1: ExtractConfiguration]/lang from the response with the 200 status

      response-optional-property-removed

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 7e0726654d22211See the full diff
    • added the new required request property file_input

      new-required-request-property

    • removed the required property document_input_value from the response with the 200 status

      response-required-property-removed

    • removed the request property document_input_value

      request-property-removed

    • added the required property file_input to the response with the 200 status

      response-required-property-added