Run agentic extraction via API
Use this to run agentic extraction from your own system without email: upload the documents, start a run, poll it until it finishes, then read the submission it created.
All requests go to https://main.formflow-dev.net and use the same Bearer token as the rest of the API (see Authentication and limits). Your API client token already has access to these endpoints. They are not yet listed in the API reference.
Request upload URLs
POST /api/studio/uploads
List every file you are going to upload, with its exact size in bytes. You can list up to 20 files.
{
"files": [
{ "filename": "proposal-form.pdf", "size": 284113 },
{ "filename": "claims-history.xlsx", "size": 40211 }
]
}Leave out threadId to start a new conversation, which is what you normally want. To add files to a conversation you started earlier through the API, pass its threadId.
201 response
{
"threadId": "5f0c3a6e-2b1d-4f7a-9c3e-0d8b6a1e4f21",
"files": [
{
"fileId": "a1c2e3f4-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
"filename": "proposal-form.pdf",
"mimeType": "application/pdf",
"size": 284113,
"uploadUrl": "https://…s3…amazonaws.com/…",
"method": "PUT",
"headers": { "Content-Type": "application/pdf", "Content-Length": "284113" },
"expiresIn": 900
}
]
}Keep threadId and every fileId. You need them to start the run.
The file type comes from the filename extension. Allowed:
pdf,doc,docx,xls,xlsx,csv,jpg,jpeg,png,gif,heic.Each file can be up to 30 MB.
If any one file is rejected, the whole request fails with
400, and nothing is created. AthreadIdthat is unknown returns404. One that was not created through the API returns400.
Upload the bytes
PUT each file's bytes to its uploadUrl within expiresIn seconds (15 minutes). Send every header listed in headers, with exactly those values. The body must be exactly size bytes, because the URL is signed for that type and length. Anything else is rejected by storage.
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/pdf" \
--data-binary @proposal-form.pdfcurl sets Content-Length from the file itself. This request goes straight to storage, so do not send your Bearer token with it.
Confirm each upload
POST /api/studio/uploads/{fileId}/complete
No request body. Call this once per file after its PUT has succeeded.
200 response
{ "fileId": "a1c2e3f4-5b6d-4e7f-8a9b-0c1d2e3f4a5b", "status": "completed", "size": 284113 }409 means the file has not reached storage. If the PUT is still in progress, retry the call when it has finished. If the upload URL expired first, it can't be reused: request a new upload (step 1), which gives a new fileId, and upload to that. A file that hasn't been confirmed can't be used in a run.
Start the run
POST /api/studio/extraction-runs
{
"threadId": "5f0c3a6e-2b1d-4f7a-9c3e-0d8b6a1e4f21",
"fileIds": ["a1c2e3f4-5b6d-4e7f-8a9b-0c1d2e3f4a5b", "b2d3f4a5-6c7e-4f8a-9b0c-1d2e3f4a5b6c"],
"templateId": 7
}threadId
Required. The threadId from step 1.
fileIds
Required, 1–20. Confirmed uploads on that conversation. You can name some of its files rather than all of them.
templateId
Required. The template to extract against. See Templates.
workflowId
Optional. Only needed if your organisation has more than one active workflow that starts from documents. The error message tells you when it is needed.
202 response
{
"runId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",
"workflowId": "c0ffee00-1234-4abc-9def-0123456789ab",
"threadId": "5f0c3a6e-2b1d-4f7a-9c3e-0d8b6a1e4f21",
"status": "running",
"fileIds": ["a1c2e3f4-5b6d-4e7f-8a9b-0c1d2e3f4a5b", "b2d3f4a5-6c7e-4f8a-9b0c-1d2e3f4a5b6c"]
}The run starts straight away. Over the API nothing is ever asked: if the workflow needs something this request doesn't give, the request fails with 400 and says what is missing.
400
One or more
fileIdsaren't confirmed uploads on that conversation. The whole request is refused, so no run reads only some of your files.The conversation was not created through the API.
Several workflows could run and
workflowIdis missing.The named workflow is inactive or not fully set up.
The workflow needs a parameter this request can't supply. The message lists it.
404
Unknown thread, template or workflow. Or your organisation has no active workflow that starts from documents.
Poll the run
GET /api/studio/extraction-runs/{runId}
Poll until finished is true. A run usually takes a few minutes, so polling every 15–30 seconds is enough.
200 response, while running
{
"runId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",
"status": "running",
"finished": false,
"currentStepIndex": 2,
"stepsTotal": 7,
"submissionId": "3b7f0a1e-9c2d-4e5f-8a6b-7c8d9e0f1a2b",
"completedAt": null
}200 response, finished
{
"runId": "9e8d7c6b-5a49-4382-8170-6f5e4d3c2b1a",
"status": "completed",
"finished": true,
"currentStepIndex": 7,
"stepsTotal": 7,
"submissionId": "3b7f0a1e-9c2d-4e5f-8a6b-7c8d9e0f1a2b",
"message": "Your submission has been processed, but it was not exported to the ledger.",
"completedAt": "2026-10-07T09:41:12.000Z"
}status
pending, running, completed or failed.
finished
true once the run is completed or failed. Stop polling when it is.
currentStepIndex
Progress only, counted from 0. On a completed run it equals stepsTotal, even when validation stopped the run early. On a failed run it stays at the step that failed. Use finished to tell whether the run is done.
stepsTotal
Number of steps in the workflow.
submissionId
The submission the run created. Appears once the first step has run.
missingFields
Only when validation stopped the run. A readable list of what is missing or invalid.
message
The run's final message. On a failed run, a short technical reason, for example which step failed or timed out.
completedAt
When the run finished, or null.
Read the result
The poll result tells you how the run went. The extracted data is on the submission. Fetch it with GET /api/submission/{submissionId} and read its payload, as in classic processing. To check the outcome in code, read the submission's status. Don't parse message, whose wording can change.
completed, no missingFields
The run went through, but the submission was not exported, because API runs never export automatically. Check the submission's status. If it is held for review, it waits for a reviewer. Otherwise check it with GET /api/submission/{submissionId}/validate, then export it with POST /api/submission/{submissionId}/export or from the web app.
completed with missingFields
The submission was extracted, but it does not pass validation yet. See Missing fields over the API.
failed
A step failed, and message says which. submissionId is there if the submission was created before the failure.
No webhooks: polling is the way to get results
The submission webhooks may fire for the submission a run creates, for example extracted. Use them to follow the submission. They never tell you whether the run finished, failed or stopped for missing fields.
Missing fields over the API
Over email, Nora asks the sender for missing fields. Over the API there is nobody to ask. The run stops, returns the list in missingFields, and leaves the submission in Nora without exporting it. To finish it:
Add the missing values in the Nora web app, or with
PATCH /api/submission/{submissionId}.Check it with
GET /api/submission/{submissionId}/validate.Export it from the web app, or with
POST /api/submission/{submissionId}/export.
Was this helpful?