curl --request POST \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/files/trigger-parse \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"flow": "submission",
"fileIds": [
"550e8400-e29b-41d4-a716-446655440020",
"550e8400-e29b-41d4-a716-446655440030"
]
}
'{
"flow": "submission",
"enqueued": [
{
"target": {
"kind": "file",
"id": "550e8400-e29b-41d4-a716-446655440020"
},
"parseTaskName": "create_submission_v1",
"outcome": "enqueued",
"runId": "994bfc11-8ff3-485a-89ff-7839c9bb6101"
},
{
"target": {
"kind": "folder",
"id": "550e8400-e29b-41d4-a716-446655440040"
},
"parseTaskName": "create_submission_v1",
"outcome": "enqueued",
"runId": "0f204eac-17e5-42bc-93b1-0dd2aea57baa"
}
]
}Trigger Parse
Extract data from uploaded documents, such as an application or an
existing policy, and create records from it: an exposure, a submission,
and an in-progress quote that a person reviews and binds. Upload and
finalize the files first (Create Upload Intent,
createCompanyFileUploadIntent, then Finalize Upload,
finalizeCompanyFileUpload). Then call this, and poll List Parse Runs
(listCompanyFileParseRuns) for the result.
Explicitly kick the parsing pipeline over one or more files and/or
folders that were already uploaded and finalized. For each target the
server resolves the parse-stage task from {company, flow} and enqueues the
extract step, which then hands off to the resolved create_<flow>_v<N> task.
Each target becomes ONE parse run: a fileId parses that single file, and a
folderId recursively flattens the folder to its live, ready files and parses
them together as one run (a folder of N documents is one run, not N). Provide
at least one of fileIds or folderIds.
This is the only way to start parsing: upload and finalize a file (or a folder of files), then POST here to parse it. 3rd-party callers and the inbound-email forwarder both use this to parse (or re-parse) content uploaded earlier. Poll the outcome with List Parse Runs.
Without Idempotency-Key, re-posting the same target for the same flow
collapses to duplicate outcomes. Set force: true to bypass that target
dedupe. With Idempotency-Key, retry the same key to receive the original
run IDs without another parse. Each distinct key starts new runs, including
when force is false. A failed dispatch can be retried with the same key;
already accepted targets keep their run IDs.
Content that has not finished scanning is safe to trigger — extract
self-gates and backs off until every file in the target is ready.
A folder that is an email-sourced import from a sender the company has not
recognized is never parsed: its outcome is skipped_unrecognized_sender
(with runId: null) and no run is created. An operator can recognize the
sender on the in-app Imports page to make the folder parseable.
Required permission: file.parse
curl --request POST \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/files/trigger-parse \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"flow": "submission",
"fileIds": [
"550e8400-e29b-41d4-a716-446655440020",
"550e8400-e29b-41d4-a716-446655440030"
]
}
'{
"flow": "submission",
"enqueued": [
{
"target": {
"kind": "file",
"id": "550e8400-e29b-41d4-a716-446655440020"
},
"parseTaskName": "create_submission_v1",
"outcome": "enqueued",
"runId": "994bfc11-8ff3-485a-89ff-7839c9bb6101"
},
{
"target": {
"kind": "folder",
"id": "550e8400-e29b-41d4-a716-446655440040"
},
"parseTaskName": "create_submission_v1",
"outcome": "enqueued",
"runId": "0f204eac-17e5-42bc-93b1-0dd2aea57baa"
}
]
}Authorizations
Headers
Optional key that makes a retry of this operation safe. Send a new value, 1 to 255 printable ASCII characters, for each intended operation, and send the same value with the same request when you retry it. A committed attempt reserves the key for 30 days from admission; retries do not extend that window. After 30 days the same key runs as a new request, even if its body differs. Within that window, a retry after the first request completed returns the original resource or run identity with the same status and response shape, without starting another operation. A failure before the intent commits stores nothing; after an external effect fails, a retry may resume that same committed intent. Keys belong to the credential, so another API key, even one the same user created, cannot replay them. Within 30 days, reusing a key with a different request returns 422 IDEMPOTENCY_KEY_REUSED; an invalid key returns 400 INVALID_IDEMPOTENCY_KEY. The key is compared exactly, so case and surrounding spaces count.
1 - 255^[\x20-\x7E]{1,255}$