Extractions
Extractions pull structured data from documents. Point an extraction at a document with a schema (or inline fields), and get back clean JSON.
The extraction object
{
"id": "e1a2b3c4-...",
"object": "extraction",
"document_id": "f47ac10b-...",
"schema_id": "s1a2b3c4-...",
"data": {
"vendor": "Acme Corp",
"total": 1500.00,
"date": "2026-01-15"
},
"confidence": 0.95,
"duration_ms": 2340,
"created": 1710000000
}Run an extraction
POST /v1/extractionsProvide one of the following to define what to extract:
| Parameter | Type | Description |
|---|---|---|
document_id | string | Required. The document to extract from |
schema_id | string | ID of a saved schema |
fields | array | Inline field definitions (same format as schema fields) |
description | string | Natural language description (10+ chars, auto-generates fields) |
Using a saved schema
curl https://docld.com/api/v1/extractions \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{
"document_id": "f47ac10b-...",
"schema_id": "s1a2b3c4-..."
}'Using inline fields
curl https://docld.com/api/v1/extractions \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{
"document_id": "f47ac10b-...",
"fields": [
{"name": "vendor", "type": "string"},
{"name": "total", "type": "number"}
]
}'Using a description
curl https://docld.com/api/v1/extractions \
-H "Authorization: Bearer docld_..." \
-H "Content-Type: application/json" \
-d '{
"document_id": "f47ac10b-...",
"description": "Extract the vendor name, invoice number, and total amount"
}'Retrieve an extraction
GET /v1/extractions/:idcurl https://docld.com/api/v1/extractions/e1a2b3c4-... \
-H "Authorization: Bearer docld_..."Last updated on