UntangledAPI
Extract

Batch

Submit up to 20 documents in one synchronous batch call.

POST /v1/extract/batch is for grouped extraction work. Submit up to 20 documents, each with its own JSON Schema. The response returns one results array immediately; each item has either data or an error.

Submit a batch

curl https://api.untangledapi.com/v1/extract/batch \
  -H "x-api-key: $UNTANGLED_KEY" \
  -H "content-type: application/json" \
  -d '{
    "items": [
      {
        "id": "inv-001",
        "document": {
          "text": "Acme Co. — Invoice #1042 — Total: $1,250.00 — Due: 2026-05-15"
        },
        "schema": {
          "type": "object",
          "properties": {
            "vendor": { "type": "string" },
            "total": { "type": "number" },
            "due_date": { "type": "string", "format": "date" }
          },
          "required": ["vendor", "total"]
        }
      },
      {
        "id": "inv-002",
        "document": { "text": "..." },
        "schema": {
          "type": "object",
          "properties": {
            "vendor": { "type": "string" },
            "total": { "type": "number" }
          },
          "required": ["vendor", "total"]
        }
      }
    ]
  }'
{
  "results": [
    {
      "id": "inv-001",
      "ok": true,
      "data": {
        "vendor": "Acme Co.",
        "total": 1250.00,
        "due_date": "2026-05-15"
      }
    },
    {
      "id": "inv-002",
      "ok": false,
      "error": {
        "code": "extract_failed",
        "message": "Document parsed but no schema-conformant data could be produced."
      }
    }
  ],
  "usage": {
    "inputTokens": 900,
    "outputTokens": 210
  }
}

Schemas

Each items[] entry carries its own schema. If every document shares the same shape, repeat the same schema on each item.

HEU billing

Each document is billed as part of the submitted batch. The batch endpoint does not discount HEU — the value is operational grouping rather than economic.

On this page