Run a Spec and get results
What you get
A run turns a set of documents into one structured row per document, with every value tied to the page and passage it came from. It is for operations teams who run a Spec from the app and for developers who push documents from their own systems.
Talonic reads each document, fills every field in your Spec, links each value to its source passage and applies your validation rules. Values it is unsure about go to review; the rest of the document carries on.
Before you start
- A saved Spec. See Define what to extract: Specs.
- Documents already in the workspace, or files and file URLs to send with the run.
- In the app, starting a run and re-running a stage need the Admin role; cancelling a run needs Member or above.
- Over the API, a key with the
writescope to start, cancel or re-run, andreadto follow progress and read results. See Authentication.
Do it in the app
- Open the Specs page and pick your Spec.
- Choose the documents and click Run pipeline. The button shows how many documents the run will take.
- The run opens in its workspace. Rows fill in as documents finish, so you can start reading before the run ends. Select any cell to see its source passage, its checks and its history.
- Each document finishes as complete, or as partial when some fields wait in review. Clean fields of a partial document are already done.
- To repeat part of a run after you change the Spec, click ↻ Rerun stage. If the Spec changed since the run started, choose Apply Spec changes and rerun or Rerun as planned. Earlier stages keep their results.
- To stop a run, click Cancel run. Documents that already finished keep their results.
Do it with the API
Two entry points start a run. POST /v1/run takes files (up to 20 per call) or file_urls together with a spec_id, ingests them and starts the run in one call; it answers 202 with a run_id. POST /v1/pipelines runs a Spec over documents already in the workspace (schema_id plus document_ids) and answers 201 with the run id. Poll GET /v1/run/{id} or GET /v1/pipelines/{id}/progress, then read rows from GET /v1/run/{id}/results or GET /v1/pipelines/{id}/results. Runs started with the older POST /v1/process endpoint are polled at GET /v1/runs/{id}; new integrations use /v1/run or /v1/pipelines.
curl -s -X POST https://api.talonic.com/v1/run \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-F "spec_id=1fc7807e-e1aa-4504-b796-5709986e78ed" \
-F "batch_id=ERP-2026-07-14-001" \
-F "files=@invoice-0847.pdf" \
-F "file_urls=https://example.com/contracts/msa-2026.pdf"
curl -s https://api.talonic.com/v1/run/a8716d18-978d-4d19-8ca5-8b3784ca857c \
-H "Authorization: Bearer $TALONIC_API_KEY"const base = 'https://api.talonic.com';
const headers = {
Authorization: `Bearer ${process.env.TALONIC_API_KEY}`,
'Content-Type': 'application/json',
};
const run = await fetch(`${base}/v1/pipelines`, {
method: 'POST',
headers,
body: JSON.stringify({ schema_id: SPEC_SCHEMA_ID, document_ids: DOCUMENT_IDS }),
}).then((r) => r.json());
let progress;
do {
await new Promise((r) => setTimeout(r, 5000));
progress = await fetch(`${base}/v1/pipelines/${run.id}/progress`, { headers }).then((r) => r.json());
} while (progress.status === 'active');
const rows = await fetch(`${base}/v1/pipelines/${run.id}/results?limit=100`, { headers }).then((r) => r.json());
console.log(rows.pending_review_count, rows.data.map((d) => d.fields));Each result row carries document_id, filename, a per-document status (complete, partial, error or processing) and a fields object with one clean value per Spec field. A value still waiting for review is null until someone decides it, and pending_review_count tells you how many are outstanding. Add include=cells,provenance for confidence and source passages per value; see Trust every value.
{
"run_id": "a8716d18-978d-4d19-8ca5-8b3784ca857c",
"status": "completed",
"columns": [
{ "field_key": "invoice_number", "display_name": "Invoice number", "data_type": "string" },
{ "field_key": "total_gross", "display_name": "Total (EUR)", "data_type": "number" }
],
"data": [
{
"document_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"filename": "invoice-0847.pdf",
"status": "complete",
"fields": { "invoice_number": "RE-2026-0847", "total_gross": 1249.9 }
}
],
"pagination": { "total": 1, "limit": 25, "has_more": false, "next_cursor": null },
"pending_review_count": 0
}Re-run and cancel. POST /v1/pipelines/{id}/rerun with from_phase (transfer, extraction, resolution, matching or validation) repeats the run from that stage of your Spec onward; earlier stages keep their results and earlier review decisions stand. Every document must be finished first. POST /v1/run/{id}/cancel or POST /v1/pipelines/{id}/cancel stops the run; it is idempotent, deletes nothing and returns how many documents completed and how many it stopped.
Large batches. For backlogs that do not need answers today, upload into a source with processing_mode=batch (POST /v1/sources/{id}/documents) or switch the source to batch mode in the app. Batch work costs half and returns within 48 hours. Documents appear in your library at once with status batch_queued, and fill in when the batch completes. A batch needs at least 100 documents; smaller uploads and image-only files (PNG, JPG) are processed straight away at the normal rate. Follow batches under Sources → Batches or with GET /v1/batches, and stop one with POST /v1/batches/{id}/cancel.
Do it with an agent
Use talonic_list_specs to find the Spec, talonic_run_spec to start the run, talonic_get_run to follow it and talonic_get_run_results to read the rows. No MCP tool cancels a Spec run: call POST /v1/pipelines/{id}/cancel from your agent, or use talonic_invoke_agent_tool with the cancel_pipeline tool. Example: "Run the invoice Spec on the documents uploaded today and tell me which ones need review."
Limits and costs
POST /v1/run: up to 20 files per call; per-file size depends on your plan.metadataholds up to 50 flat keys.POST /v1/pipelines: up to 3,000 documents per run by default. Split larger sets into several runs.- Credits follow the published catalog (
GET /v1/pricing): 100 credits per ingested page and 20 credits per filled field value; values Talonic fills from fields it already knows in your workspace, validation and delivery are free. - Batch mode applies a 0.5x multiplier in exchange for the 48-hour window.
- A cancel stops further spend; it does not refund work already done. See Billing, credits and usage.
Errors
| Parameter | Type | Description |
|---|---|---|
| 400 | bad_request | No `spec_id` or input, invalid `metadata`, the Spec has nothing to run, or a re-run was asked while documents are still processing. Fix the request and resend. |
| 402 | insufficient_credits | Balance too low. Nothing is ingested; top up and resend. |
| 404 | not_found | No run, pipeline or Spec with that id in your workspace. |
| 409 | not_cancellable_yet | The run is still ingesting. Retry the cancel shortly. |
| 413 | file_too_large / PIPELINE_RUN_TOO_LARGE | A file is over your size cap, or the run has too many documents. Split and retry. |
| 429 | rate_limited | Daily quota reached or processing is at capacity. Wait for `Retry-After` and resend. |
| 503 | PIPELINE_QUEUE_UNAVAILABLE | Temporary. Resend shortly. |
Next
Frequently asked questions
Do I have to wait for the whole run to finish?+
run.completed webhook to be told when it ends.