API v2 sortspoke.com Get API access
Get started

Build SortSpoke into your product

SortSpoke reads insurance documents and turns them into structured, verified JSON you can feed straight into your own app. Its AI does the extraction and people review what it isn't sure about, and every value carries how it was verified and the document it came from. Send documents through the API, embed SortSpoke's review screen in your own app, or both.

How it fits together

A document is ready to export when it reaches Finished. That happens when your project's auto-accept rules accept it, or when a person accepts it in SortSpoke or in the embedded review screen. Until then it waits for review.

The essentials

Base URLhttps://api.sortspoke.com/api/v2Use the host for your account's data center. Base URLs
AuthenticationAn API token in the Authorization: Bearer header. A SortSpoke admin creates it: Create an API token. Authentication
File typesPDF, BMP, GIF, JPG, PNG, TIF, DOC, DOCX, XLS, XLSX, PPT, PPTX. Up to 200 MB per upload request; Office files up to 100 MB each.
WebhooksSortSpoke calls your endpoint when a submission or document changes state. Set one up in Admin → Webhooks: Create a webhook. Webhooks and polling
ResultsThe document's export, as JSON (JsonV2) or Excel, once it's Finished. Export a document
API reference filesThe OpenAPI description and a Postman collection of every public call, ready to import. Downloads

Popular guides

Was this page helpful? Next: Quickstart →
Get started

Authentication

Every request sends an API token in the Authorization header. The token acts as the SortSpoke user it belongs to, with that user's access to projects and documents.

Get a token

  1. A SortSpoke admin opens Admin → Users, picks the user and generates a token under API Tokens. Step-by-step: Create an API token.
  2. Copy it straight away. SortSpoke shows it once.
  3. Store it on your server, for example as SORTSPOKE_API_TOKEN. Never put it in browser code.

Tokens have an expiry date, shown on the user's page in SortSpoke. Generate a new one before it passes. Revoking a token is permanent.

Send it

Add Authorization: Bearer $SORTSPOKE_API_TOKEN and Accept: application/json to every request. The call on the right lists the projects the token can see.

A missing, wrong, expired or revoked token returns 401 with the standard error body.

Base URLs and data centers

Use the host for the data center your SortSpoke account is on. Ask SortSpoke if you're not sure. The samples on these pages use the US host; swap in yours if your account is elsewhere.

Data centerAPI hostReview links come from
UShttps://api.sortspoke.comhttps://auth.sortspoke.com
Canadahttps://api.ca.sortspoke.comhttps://auth.ca.sortspoke.com
US (second)https://api.c4.sortspoke.comhttps://auth.c4.sortspoke.com

User-Agent

No particular User-Agent is required. Send one that names your app, such as your-app/1.0, so SortSpoke support can find your requests. If a request ever returns an HTML page with status 403 instead of JSON, a firewall rule blocked it: send support the time of the request and your server's IP address.

ClientUser-Agent sentResult
Sample User-Agentyour-app/1.0Accepted (200)
Python requests (default)python-requests/2.32.5Accepted (200)
curl (default)curl/8.23.0Accepted (200)
Node.js fetch (default)node (undici), v24.14.0Accepted (200)
.NET HttpClient (default: no User-Agent header)(none)Accepted (200)

Checked on 2026-11-24 against the Canada and US hosts with a valid token.

Was this page helpful? Next: Quickstart →
Get started

Quickstart

Upload a document, wait until it's Finished, and download its data. Four calls, shown on the right in curl, Node, Python and C#.

Before you start
  • An API token in SORTSPOKE_API_TOKEN (Authentication).
  • The API host for your data center (Base URLs).
  • A project in SortSpoke with at least one document category.
1

Find your project and category

List projects with expanded=1 to see their names, then list the project's categories. Keep the projectId and the labelId of the category your documents belong to.

Reference: List projects →
2

Upload the document

Send the file as multipart/form-data. Passing labelId sorts it into that category, so it goes straight to extraction. Keep the docId from the response.

Reference: Upload files to a project →
3

Wait until it's Finished

Poll document status until documentState is 7 (Finished). Stop and handle the document if it reaches 1002 (preprocessing error), 1004 (export error), 1005 (rejected) or 1006 (quarantined). Prefer not to poll? Set up a webhook in SortSpoke for document.status_changed: Webhooks and polling.

Reference: Get document status →
4

Download the data

Download the document's export. In a JsonV2 project the file is JSON: one entry in Fields per extracted field.

Reference: Export a document (JSON) →
A document finishes after review.

If your project doesn't auto-accept a category, the document waits in Extracting (5) until a person accepts it. To have people review inside your own app, create a review link and embed it: Embed guide.

Guides

Emailed submission to structured data

A commercial application arrives by email. Your system uploads it, an underwriter checks the extracted fields inside your app, and the accepted data flows back to your system.

Prerequisites
  • A webhook in SortSpoke for document.status_changed.ready and document.status_changed, pointing at your server (Webhooks and polling). Or poll document status instead.
  • SortSpoke has added your page's exact https origin to the allowed hosts for your data center, so the review screen can load in your page.
  • Your server creates review links. The API token never reaches the browser.
1

Upload with the category

Upload the attachment with the labelId of your application category, so it skips sorting.

Reference: Upload files to a project →
2

Wait for "ready for review"

Your webhook receives document.status_changed.ready with status 5 (Extracting) once fields are predicted.

Guide: Webhooks and polling →
3

Create a review link

Your server creates a review link for the document and returns returnUrl to your page. Create it just before showing the screen: it works once and expires 60 minutes after it's created.

Guide: Embed SortSpoke →
4

The underwriter accepts

Your page loads returnUrl in an iframe. When the underwriter accepts, SortSpoke posts a Document_State_Change message with message "Exporting".

Guide: iframe messages →
5

Download the accepted data

When document.status_changed arrives with status 7 (Finished), download the export.

Reference: Export a document (JSON) →

What the webhooks carry

Both events arrive as a JSON POST to your URL with the header sortspoke-webhook-signature. The body has these fields:

FieldTypeMeaning
idstringEvent ID. Use it to ignore repeats.
eventstringdocument.status_changed or document.status_changed.ready
attemptintegerDelivery attempt, starting at 1. SortSpoke retries until your endpoint returns 2xx.
data.documentIduuidThe document
data.sourcefileIduuidThe uploaded file it came from (lowercase f)
data.statusintegerThe new document state
data.accountId, data.projectId, data.streamIduuidWhere it lives
creationTimeUtcdate-timeWhen the event was created

How to verify the signature, and the full list of events: Webhooks and polling.

Was this page helpful? Next: Upload files to a project →
API reference / Uploads

Upload files to a project

POST/api/v2/projects/{projectId}/upload

Uploads one or more files into the project's default stream. SortSpoke preprocesses each file, then sorts it into a category or, if you pass labelId, sends it straight to extraction. The response comes back as soon as the files are stored. To upload into a specific stream, use POST /api/v2/streams/{streamId}/upload with the same parameters.

Used in: Quickstart Emailed submission to structured data

Parameters

projectIduuidpathrequired

Project ID from List projects.

uploadPathstringquery

Virtual folder, for example /inbox/claims@example.com. Without it, files go to the uploading user's queue.

labelIduuidquery

Category to sort the document into. The document skips sorting and goes to Extracting.

filefileform fieldrequired

One or more files as multipart/form-data. Every file part is processed.

Returns

An array with one entry per file:

docIduuid

The document SortSpoke created. Use it for status, exports and review links.

sourceFileIduuid

The stored file. One file can become several documents when it's split.

filenamestring

Stored path: /<uploader>/<file name>.

sizeinteger

File size in bytes.

Errors

StatusWhen
400Every file failed, the project ID is wrong, or the token's user can't use the project.
401Missing, wrong, expired or revoked token.
413An Office file is over 100,000,000 bytes, or the request is over 200,000,000 bytes.
Try it yourself: import the draft Postman collection, set baseUrl, apiToken and projectId, and send "Upload files to a project" with any PDF.
Was this page helpful? Next: Upload files to a stream →
API reference / Exports

Export a document (JSON)

GET/api/v2/downloads/docs/{docId}/export_file

Downloads the document's export in the project's export format. Use it once the document is Finished (state 7) or Delivered (8).

  • The response is always a file download (application/octet-stream), whatever Accept header you send. In a JsonV2 project, read the body and parse it as JSON.
  • Export files use PascalCase keys (DocId, Fields). Other API responses use camelCase.
  • AutoAccepted, SortPrediction and FieldPrediction appear only when the project exports scores.

Used in: Quickstart Emailed submission to structured data

Parameters

docIduuidpathrequired

Document ID from the upload response.

Returns

The export file. Main keys:

ExportFormatstring

JsonV2 for JSON exports.

DocIduuid

The document.

DocClassstring

The category the document was accepted in. DocClassId is its ID.

ReceivedDatedate-time

When the file arrived. ExportedDate is when the export was written.

SortPredictionobject

How the category was chosen. Only when the project exports scores.

Show 3 fields
AutoAcceptedboolean

The category was accepted without a person.

Correctboolean

The predicted category was kept.

Scorenumber

Model score for the predicted category, 0 to 1.

Fieldsarray

One entry per extracted field. The shapes are described below.

Show 4 fields
FieldIduuid

The field in the category.

Namestring

The field name as set up in SortSpoke.

Valuestring

The accepted value as text. Empty values are left out.

FieldPredictionobject

AutoAccepted and Score for the value. Only when the project exports scores.

What's in Fields

Each entry has FieldId and Name, plus one of these shapes:

ShapeRecognise it byContains
FieldValue or ValuesThe value as text, or Values when there are several. Optional: FieldPrediction, NormalizedValue, NormalizedType, SubFields, RecordId, DocPageNum.
TableDataRows: { RowId, Cells: [Field] }. Optional TablePrediction.
Repeating groupRecordsRecords: { RecordId, Fields: [Field] }, for example one per vehicle or location.

Empty values are left out of the file. Ignore keys you don't use: SortSpoke adds fields over time.

Errors

StatusWhen
400Unknown document, no access, or the document isn't Finished yet.
401Missing, wrong, expired or revoked token.
Was this page helpful? Next: Export a document (Excel) →
Guides

Documents and submission data

Take a finished submission out of SortSpoke and into your system: the submission's data as one JSON file, and each of its documents as a PDF with its own extracted data.

A submission is a batch in SortSpoke, for example one emailed submission with all its attachments. SortSpoke splits it into documents (an application, a loss run, a statement of values), extracts each one, and combines the values into one record for the submission. Your system pulls both levels with an API token.

LevelWhat you getCall
SubmissionOne JSON file per submission. Values are merged across all its documents, conflicts are resolved, and each value lists the documents it came from. SortSpoke can reshape it into your format.Export submission data
DocumentEach document's pages as a PDF, plus its type, file name, page count and extracted fields as JSON.List a batch's documents, Download a document as PDF, Export a document (JSON)

The flow

Pulling a finished submission SortSpoke sends the batch.status_changed webhook with status 50 to your system. Your system then calls GET /api/v2/batches/{batchId}/summary/export and gets the submission JSON, calls GET /api/v2/batches/{batchId}/docs and gets the list of documents, and for each document calls GET /api/v2/downloads/doc/{docId} for the PDF and GET /api/v2/downloads/docs/{docId}/export_file for the document JSON. SortSpoke Your system 1 POST your webhook URL batch.status_changed · status 50 · batchId 2 GET /api/v2/batches/{batchId}/summary/export Submission JSON: one file, merged across documents 3 GET /api/v2/batches/{batchId}/docs [{ docId, state }] For each docId 4 GET /api/v2/downloads/doc/{docId} The document's pages as a PDF GET /api/v2/downloads/docs/{docId}/export_file Document JSON: type, file name, page count, fields
  1. Know when it's done. SortSpoke calls your webhook with batch.status_changed. Act on status 50 (Finished) and skip 110 (Rejected). Can't receive webhooks? See Webhooks and polling.
  2. Get the submission data with the batchId from the event. This is the record to create in your system.
  3. List the documents in the batch. Each has a docId; state 7 means Finished.
  4. Download each document. The PDF is the document's pages. Its JSON export carries the metadata you'll want to file it under: DocClass (the document type), SrcFilename, PageCount, ReceivedDate.

Before you start

  • An API token for a SortSpoke user with access to the project. Keep it on your server. Authentication
  • The base URL for your account's data center. Base URLs
  • A webhook for Batch Status Changed, set up in SortSpoke under Admin → Webhooks with your HTTPS URL. Copy the secret when it's shown: it's shown once.
  • Your format, if you have one. SortSpoke can map the submission JSON to the field names, codes, date formats and nesting your system expects. Send SortSpoke a sample of what your system imports. The call stays the same.

Read the submission data

The file has two parts. batch describes the submission: batchId, name, state, dates, owner and project. data holds the values, keyed by the project's field keys. Each entry in data is one of three things:

EntryLooks likeExample
Value{ Name, Status, Value, Sources }uwScreeningDecision
SectionAn object of valuespolicyInformation.proposedEffDate
Repeating groupAn array of records, one per vehicle, driver or location. Each record is an array holding one object of values.vehicle[0][0].vin

Value is the agreed value as text. Sources lists where it came from: each source has the DocId and FieldId it was read from, the text as printed (DisplayValue), a NormalizedValue, and a Tier: HumanVerified, AutoVerified or Predicted. A value typed directly on the submission, such as an underwriter's decision, has SourceType Submission and no DocId.

Link a value to its page

From a submission value to its source document A value in the submission JSON has Sources. Each source's DocId identifies the document: download it as a PDF with GET /api/v2/downloads/doc/{DocId}. Its FieldId matches the field in that document's JSON export. Submission JSON data .applicationInformation .agency.Value Sources[0] DocId · FieldId · Tier Source document DocId the page the value was read from PDF GET /api/v2/downloads/ doc/{docId} Document JSON Fields[] where FieldId matches

Use the DocId to show the source document next to the value, or to open SortSpoke's review screen on that field. Read-only links and field deep links

Make it reliable

  • Answer the webhook within 60 seconds with any 2xx, then do the downloads in the background. SortSpoke retries failed deliveries, so the same event can arrive twice: skip an id you've already handled.
  • Pull again any time. The submission export works in any batch state and returns the same file for the same data. After the submission is accepted in SortSpoke its values are frozen.
  • Stream PDFs to disk. A 30-page application can be several megabytes.
  • Ignore keys you don't use. SortSpoke adds keys over time, and the keys in data follow the project's setup.
  • Log the traceId from any error response. Errors
Was this page helpful? Next: Webhooks and polling →
Guides

Webhooks and polling

SortSpoke calls your HTTPS endpoint when a submission, document or uploaded file changes state, so you don't have to keep asking.

Events

EventSent whendata
batch.status_changedA submission (named batch) changes state. status 50 is Finished, 110 Rejected.accountId, projectId, streamId, status, batchId
batch.triage.readyA batch finishes triage.accountId, projectId, streamId, status, batchId, triageBucketId
document.status_changedA document changes state, for example to Finished (7).accountId, projectId, streamId, status, sourcefileId, documentId
document.status_changed.readyA document is ready for review (3 or 5).Same as above
document.auto_acceptThe auto-accept decision is made.autoAccepted, documentId, sourcefileId, accountId, projectId, streamId, labelId, status
sourcefile.status_changedAn uploaded file changes state.accountId, projectId, streamId, status, sourcefileId

Default batches don't send batch.status_changed: only named batches, such as one per emailed submission, do. Note the casing sourcefileId, with a lowercase f. status is a number from State codes.

Set up a webhook

  1. In SortSpoke, go to Admin → Webhooks and add a webhook.
  2. Enter your HTTPS URL and pick the events, for example Batch Status Changed.
  3. Copy the secret. It's shown once; store it with your other secrets.

Step by step, with screenshots: Create or remove a webhook. Ask SortSpoke if you want webhooks set up for you.

What you receive

A POST with Content-Type: application/json and User-Agent: SortSpoke/1.0. The body is an envelope around the event's data: id (unique per event), event, attempt (1 on the first try), data and creationTimeUtc.

Verify the signature

Every delivery has a sortspoke-webhook-signature header: an HMAC-SHA256 of the raw request body, keyed with your webhook secret exactly as shown (its UTF-8 bytes; don't decode it first), written as uppercase hex pairs joined by dashes, like 3A-F2-…. Compute it over the bytes you received, before any JSON parsing, and compare in constant time. Reject anything that doesn't match.

Delivery and retries

  • Answer with any 2xx within 60 seconds. Anything else, or no answer, is a failed delivery.
  • SortSpoke retries with growing gaps, up to about a day apart, for about 30 days. attempt counts the tries.
  • The same event can arrive more than once. Use id to skip repeats.
  • A webhook that keeps failing gets warnings on days 7, 14, 21 and 28 and is switched off on day 30.

Polling instead

If your system can't receive calls from outside, poll. Keep the interval to 15 seconds or more, and run a daily check for anything missed even when you use webhooks.

Was this page helpful? Next: Export submission data →
API reference / Submissions

Export submission data

GET/api/v2/batches/{batchId}/summary/export

Returns one submission's data as a single JSON file: values merged across all of the batch's documents, conflicts resolved, in the format set up for your project. This is the call to create a record in your system.

  • Send Accept: application/json to get JSON back. Without it the same body comes as a file download named after the batch.
  • Works in any batch state. Wait for batch.status_changed with status 50, or check batch.state, before you import.
  • Needs a project with submission review switched on.

Used in: Documents and submission data Webhooks and polling

Parameters

batchIduuidpathrequired

Batch ID. One batch is one submission. It arrives as batchId in the batch.status_changed webhook.

formatstringquery

Leave it out to get the project's assigned format. transform:{specName} or transform:{specName}@{version} applies a named transformation. Only JSON is available.

Your format

SortSpoke can apply a transformation to this file: rename and nest fields, split one value into several (an address into street, city, state and ZIP), change date formats, map values to your codes and drop what you don't need. SortSpoke sets it up for your project from a sample of what your system imports, and can preview it against a real submission first. Once it's assigned, this call returns your format with no change on your side.

Returns

Without a transformation, the same shape as Get submission data:

batchobject

The submission.

Show 12 fields
batchIduuid

The batch.

namestring

The batch name, for example the email subject.

statestring

The batch state as text, for example Finished.

dateCreateddate-time

When the batch was created. dateFinished is when it finished.

ownedByuuid

The user who owns the batch. ownedByUserName is their user name.

acctIduuid

The account.

projectIduuid

The project. projectName is its name.

streamIduuid

The stream. streamName is its name.

dataobject

The values, keyed by the project's field keys. Each entry is a value, a section (an object of values) or a repeating group (an array of records, each an array holding one object of values).

Show a value's 4 fields
Namestring

The field's display name.

Statusstring

Resolved once one value has been agreed.

Valuestring

The agreed value as text.

Sourcesarray

Where the value came from: SourceType (Document or Submission), DisplayValue, NormalizedValue, DocId, FieldId, ValueId, RecordId, RowId, TableInstanceId and Tier (HumanVerified, AutoVerified or Predicted). RecordId and RowId are null unless the value came from a record or table row.

Errors

StatusWhen
401Missing, wrong, expired or revoked token.
404Unknown batch or no access, a project without submission review, or an unknown transformation in format.
422format asked for CSV or Excel: "Only JSON is available for a submission export."
Was this page helpful? Next: Export a document (JSON) →
API reference / Submissions

Get submission data

GET/api/v2/batches/{batchId}/summary

Returns the submission's data exactly as the Submission tab in SortSpoke shows it, with no transformation. Use it to see the full shape while you build a mapping. To import into your system, use Export submission data, which applies your project's format.

Used in: Documents and submission data

Parameters

batchIduuidpathrequired

Batch ID. One batch is one submission. It arrives as batchId in the batch.status_changed webhook.

Returns

{ batch, data }, described on Export submission data.

Errors

StatusWhen
400Unknown batch or no access.
401Missing, wrong, expired or revoked token.
Was this page helpful? Next: Export submission data →
API reference / Batches

List a batch's documents

GET/api/v2/batches/{batchId}/docs

Lists the documents in a batch with their state. Use the docId values to download each document's PDF and export.

Used in: Documents and submission data

Parameters

batchIduuidpathrequired

Batch ID.

stateintegerquery

Document state to include.

fromFinishedDatedate-timequery

 

toFinishedDatedate-timequery

 

Returns

docIduuid

The document.

stateinteger

The document state. 7 is Finished. State codes

Errors

StatusWhen
200An empty array for an unknown batch, or when no document matches state.
401Missing, wrong, expired or revoked token.
Was this page helpful? Next: Mark batches delivered →
API reference / Exports

Download a document as PDF

GET/api/v2/downloads/doc/{docId}

Downloads one document's pages as a PDF, built from the pages of the file it was split from.

  • The response is application/octet-stream with a Content-Disposition file name: the original file name, ending in .pdf.
  • Stream it to disk: a long application can be several megabytes.
  • For the document's type, page count and extracted fields, use Export a document (JSON).

Used in: Documents and submission data

Parameters

docIduuidpathrequired

Document ID from the upload response.

Errors

StatusWhen
401Missing, wrong, expired or revoked token.
404Unknown document or no access.
Was this page helpful? Next: Export a batch (JSON) →
API reference / Documents

Get document status

POST/api/v2/status

Returns the state of one or more documents. Send a bare JSON array of document IDs. A document is ready to export at state 7 (Finished).

  • An unknown or inaccessible ID is left out of the response; there's no error for it.
  • Poll every 15 seconds or more, or use webhooks instead.

Used in: Quickstart Webhooks and polling

Parameters

(request body)uuid[]bodyrequired

A bare JSON array of document IDs.

Returns

docIduuid

The document.

documentStateinteger

The document state. State codes

autoAcceptedboolean

The document was accepted without a person.

Errors

StatusWhen
400The body isn't a JSON array of IDs.
401Missing, wrong, expired or revoked token.
Was this page helpful? Next: Search documents →
API reference / Batches

Create a batch

POST/api/v2/projects/{projectId}/batches POST/api/v2/streams/{streamId}/batches

Creates an empty named batch and returns its ID. A batch groups the files of one submission: upload files into it with Upload files to a batch. The project route uses the project's default stream; the stream route takes streamId in place of projectId and the same body.

  • Named batches need a custom project configuration. Ask SortSpoke support to set it up.
  • batchName must be unique among active batches (Filling, Filled or Claimed). The check ignores case.
  • Leave out assigneeUserIdOrUserName to create the batch unassigned. You can assign it later with Assign a batch.
  • When a named batch is Finished or Rejected, SortSpoke sends the batch.status_changed webhook. See Webhooks and polling.

Parameters

projectIduuidpathrequired

Project ID from List projects.

batchNamestringbodyrequired

Unique among active batches.

assigneeUserIdOrUserNamestringbody

Leave out to create the batch unassigned.

Returns

The new batch's ID as a bare JSON string, not an object.

Errors

StatusWhen
400The batch wasn't created: for example, the name is already used by an active batch, the project or stream ID is wrong, or the token's user can't use it.
401Missing, wrong, expired or revoked token.

Error bodies and every status code: Errors and status codes. Batch states: State codes.

Was this page helpful? Next: Upload files to a batch →
API reference / Batches

Upload files to a batch

POST/api/v2/batches/{batchId}/upload

Uploads one or more files into a named batch. It works like Upload files to a project: the same multipart/form-data body, the same limits and the same response. Every file part in the form is processed; name the field file.

  • Pass labelId to send the documents straight to extraction in that category instead of sorting them.
  • A request can be up to 200,000,000 bytes. Office files (doc, docx, xls, xlsx, ppt, pptx) can be up to 100,000,000 bytes each.

Parameters

batchIduuidpathrequired

Batch ID.

labelIduuidquery

Category to sort the document into. The document skips sorting and goes to Extracting.

filefileform fieldrequired

One or more files as multipart/form-data. Every file part is processed.

Returns

An array with one entry per file:

docIduuid

The document SortSpoke created.

sourceFileIduuid

The stored file. One file can become several documents when it's split.

filenamestring

Stored path: /<uploader>/<file name>.

sizeinteger

File size in bytes.

Errors

StatusWhen
400Every file failed, the batch ID is wrong, or the token's user can't use the batch.
401Missing, wrong, expired or revoked token.
413An Office file is over 100,000,000 bytes, or the request is over 200,000,000 bytes.

Error bodies and every status code: Errors and status codes.

Was this page helpful? Next: Assign a batch →
API reference / Batches

Assign a batch

POST/api/v2/batches/{batchId}/assign

Assigns a batch to a user. Send the user's ID as a bare JSON string, not an object.

  • The batch must be active: Filling (10), Filled (20) or Claimed (30).
  • A Filled (20) batch becomes Claimed (30).
  • Search batches shows each assigned batch's user as userId.

Parameters

batchIduuidpathrequired

Batch ID.

(request body)stringbodyrequired

A bare JSON string: the user ID.

Returns

200 with an empty body.

Errors

StatusWhen
400The batch isn't active, the batch or user ID is wrong, the body isn't a JSON string, or the token's user can't use the batch.
401Missing, wrong, expired or revoked token.

Error bodies and every status code: Errors and status codes. Batch states: State codes.

Was this page helpful? Next: Update a batch →
API reference / Batches

Update a batch

PATCH/api/v2/batches/{batchId}

Renames a batch and sets its state.

  • batchName can't be empty or only spaces.
  • state accepts only the active states: Filling (10), Filled (20) and Claimed (30).
  • The batch itself must be active and created through the API. Batches from a cloud storage import (isCloudImportedBatch is true) can't be updated.

Parameters

batchIduuidpathrequired

Batch ID.

batchNamestringbodyrequired

The new name. It can't be empty.

stateintegerbody

10, 20 or 30 only.

Returns

200 with an empty body.

Errors

StatusWhen
400batchName is empty, state isn't 10, 20 or 30, the batch isn't active or came from a cloud storage import, the batch ID is wrong, or the token's user can't use the batch.
401Missing, wrong, expired or revoked token.

Error bodies and every status code: Errors and status codes. Batch states: State codes.

Was this page helpful? Next: Search batches →
API reference / Batches

Mark batches delivered

POST/api/v2/batches/deliver

Marks finished batches, and their documents, as Delivered: the batch moves to state 60 and its documents to 8. Call it once your system has imported the submission.

  • Send a bare JSON array of batch IDs, not an object.
  • A batch is ready to deliver when it's Finished (50).

Parameters

(request body)uuid[]bodyrequired

A bare JSON array of finished batch IDs.

Returns

200 with an empty body.

Errors

StatusWhen
400The body isn't a JSON array of IDs, or the batches couldn't be delivered: for example, an ID is wrong or the token's user can't use the batch.
401Missing, wrong, expired or revoked token.

Error bodies and every status code: Errors and status codes. Batch states: State codes.

Was this page helpful? Next: Get submission data →
API reference / Documents

List sibling documents

GET/api/v2/docs/{docId}/siblings

Lists the documents that came from the same uploaded file as this one, with their category, state and pages. The list includes the document you asked about.

Parameters

docIduuidpathrequired

Document ID from the upload response.

Returns

An array with one entry per document:

docIduuid

The document.

labelIduuid

The document's category.

predictedLabelobject

The category SortSpoke predicted: labelId, confidence and datePredicted. It can differ from labelId.

stateinteger

The document state. State codes

sourcePagesarray

Which pages of the uploaded file make up the document.

Show 3 fields
docPageNuminteger

Page number in the document, from 1.

sourceFileIduuid

The uploaded file.

sourceFilePageNuminteger

Page number in the uploaded file, from 1.

Each entry also has stageId, containsVerifiedFields, containsComments, ownedByCurrentUser and ownedByCurrentUserInDifferentBatch. SortSpoke's own screens use them; you can ignore them.

Errors

StatusWhen
400Unknown document or no access.
401Missing, wrong, expired or revoked token.

Errors use the standard error body.

Was this page helpful? Next: Assign documents →
API reference / Documents

Assign documents

PATCH/api/v2/projects/{projectId}/documents/assign

Assigns one or more documents in a project to a user. Name the user by user ID or by username (their email).

Parameters

projectIduuidpathrequired

Project ID from List projects.

userIdstringbodyrequired

User ID or username (email).

docIdsuuid[]bodyrequired

Documents to assign.

Returns

200 with an empty body.

Errors

StatusWhen
400Unknown user or document, no access, or a body that isn't valid.
401Missing, wrong, expired or revoked token.

Errors use the standard error body.

Was this page helpful? Next: Mark documents delivered →
API reference / Documents

Mark documents delivered

POST/api/v2/docs/deliver

Marks finished documents as Delivered (state 8), to record that your system has received their exports. Send a bare JSON array of document IDs.

  • Send only Finished documents (state 7).
  • Once every document from an uploaded file, or every document in a batch, is Delivered, SortSpoke marks that file or batch Delivered too.

Parameters

(request body)uuid[]bodyrequired

A bare JSON array of finished document IDs.

Returns

200 with an empty body.

Errors

StatusWhen
400The body isn't a JSON array of IDs, or a document is unknown or not accessible.
401Missing, wrong, expired or revoked token.

Errors use the standard error body. State codes

Was this page helpful? Next: Create a review link →
API reference / Exports

Export a document (Excel)

GET/api/v2/downloads/ExportFinishedDoc/{docId}

Downloads one document's export as an Excel file. Call it once the document is Finished (state 7).

  • The response is a binary file, not JSON: application/vnd.ms-excel for an .xlsx file, or the macro-enabled Excel type for an .xlsm file. Stream it to disk.
  • To read the extracted fields in code, use Export a document (JSON) instead.

Parameters

docIduuidpathrequired

Document ID from the upload response.

Returns

The Excel file. There's no JSON body to show here.

Errors

StatusWhen
401Missing, wrong, expired or revoked token.
404Unknown document or no access.

Error bodies are described on Errors and status codes.

Was this page helpful? Next: Bulk export →
API reference / Exports

Bulk export

POST/api/v2/downloads/export_files POST/api/v2/downloads/export_files/Excel

Downloads the exports of several documents in one ZIP file. The first route uses the project's export format. The /Excel route returns the exports as Excel files.

  • Send the document IDs as form data (multipart/form-data or form-urlencoded), not JSON. Repeat the docIds field once per document.
  • The response is a binary file, not JSON: application/zip, named SortSpokeExport_<UTC time>.zip. Stream it to disk.
  • For one document, use Export a document (JSON) or Export a document (Excel).

Parameters

docIdsuuid[]form fieldrequired

Repeat the docIds form field once per document.

The /Excel route takes the same form field.

Returns

The ZIP file. There's no JSON body to show here.

Errors

StatusWhen
400The request is invalid, for example too many documents in one request. Ask SortSpoke for the limit.
401Missing, wrong, expired or revoked token.
404None of the documents exist or are accessible.
422The export format doesn't apply. The body may be plain text.

Error bodies are described on Errors and status codes.

Was this page helpful? Next: Download a document as PDF →
API reference / Exports

Export a batch (JSON)

GET/api/v2/batches/{batchId}/export_file

Returns the exports of every document in a batch, in one JSON file: batch details at the top, then one document export per entry in ExportDocuments.

  • Send Accept: application/json to get JSON back. Without it the same body comes as a file download, named as in ExportPathFilename.
  • Keys are PascalCase, like the document export. Null values are left out.
  • No transformation is applied. For a submission's merged data in your format, use Export submission data.

Parameters

batchIduuidpathrequired

Batch ID.

Returns

BatchIduuid

The batch. BatchName is its name.

ProjectIduuid

The project. ProjectName is its name.

StreamIduuid

The stream. StreamName is its name.

CreationDatedate-time

When the batch was created. FinishedDate is when it finished.

UserIduuid

The batch's user. UserName is their user name.

TriageBucketIduuid

The batch's TriageAI bucket. TriageBucketName is its name.

ExportFormatstring

JsonV2 for JSON exports.

ExportPathFilenamestring

The file name used for the download.

ExportedDatedate-time

When the export was written.

ExportDocumentsarray

One document export per entry, with the same keys as Export a document (JSON): DocId, DocClass, Fields and the rest.

Errors

StatusWhen
400Unknown batch or no access.
401Missing, wrong, expired or revoked token.

Error bodies are described on Errors and status codes.

Was this page helpful? Next: Get triage results →
API reference / TriageAI

Get triage results

GET/api/v2/projects/{projectId}/batch/{batchId}/triageResults

Shows how TriageAI handled a batch, rule by rule: what went in, which rules ran and the result.

  • Needs TriageAI turned on for the project. TriageAI needs a custom project setup: ask SortSpoke.
  • The batch.triage.ready webhook tells you when a batch finishes triage. See Webhooks and polling.

Parameters

projectIduuidpathrequired

Project ID from List projects.

batchIduuidpathrequired

Batch ID.

Returns

inputsobject

The batch's documents grouped by category, keyed LabelId:<id>. Each document lists its mergedRanges.

outputsobject

The result, for example BucketId.

rulesarray

The rules that were evaluated.

Errors

StatusWhen
400Unknown project or batch, or no access.
401Missing, wrong, expired or revoked token.

Error bodies are described on Errors and status codes.

Was this page helpful? Next: Re-run triage →
API reference / TriageAI

Re-run triage

POST/api/v2/projects/{projectId}/batch/{batchId}/triage

Runs triage on a batch again. Send no body. To see what happened, use Get triage results.

  • Needs TriageAI turned on for the project. TriageAI needs a custom project setup: ask SortSpoke.

Parameters

projectIduuidpathrequired

Project ID from List projects.

batchIduuidpathrequired

Batch ID.

Returns

200 with an empty body.

Errors

StatusWhen
400The request failed: check the project and batch IDs and the token user's access.
401Missing, wrong, expired or revoked token.

Error bodies are described on Errors and status codes.

Was this page helpful? Next: List priority buckets →
API reference / TriageAI

List priority buckets

GET/api/v2/projects/{projectId}/triage/buckets

Lists the project's priority buckets: the groups TriageAI sorts batches into. Use a bucketId to set a batch's bucket by hand.

  • Needs TriageAI turned on for the project. TriageAI needs a custom project setup: ask SortSpoke.

Parameters

projectIduuidpathrequired

Project ID from List projects.

Returns

projectIduuid

The project.

acctIduuid

The account.

bucketsarray

One entry per bucket.

Show 4 fields
bucketIduuid

The bucket.

namestring

The bucket name.

colorHexstring

The bucket's colour as a hex code.

isDefaultboolean

This is the project's default bucket.

Errors

StatusWhen
400Unknown project or no access.
401Missing, wrong, expired or revoked token.

Error bodies are described on Errors and status codes.

Was this page helpful? Next: Set a batch's bucket →
API reference / TriageAI

Set a batch's bucket

PATCH/api/v2/batches/{batchId}/bucket/{bucketId}

Puts a batch in a priority bucket by hand. Send no body. Get bucket IDs from List priority buckets.

  • Needs TriageAI turned on for the project. TriageAI needs a custom project setup: ask SortSpoke.

Parameters

batchIduuidpathrequired

Batch ID.

bucketIduuidpathrequired

Bucket ID from List priority buckets.

Returns

200 with an empty body.

Errors

StatusWhen
400The request failed: check the batch and bucket IDs and the token user's access.
401Missing, wrong, expired or revoked token.

Error bodies are described on Errors and status codes.

Was this page helpful? Next: Errors and status codes →
API reference / Projects

List projects

GET/api/v2/projects

Lists the projects the token's user can access. By default the response is an array of project IDs. Send expanded=1 to get a project object for each one, with its name and default stream.

  • A project object has more fields than the ones below. Use only these; the rest is internal configuration.

Used in: Quickstart

Parameters

expandedstringquery

1 returns project objects instead of an array of IDs.

Returns

Without expanded, an array of project ID strings. With expanded=1, an array of projects:

projectIduuid

The project. Use it for categories, uploads and searches.

acctIduuid

The account.

projectNamestring

The project's name in SortSpoke.

dateCreateddate-time

When the project was created.

defaultStreamIduuid

The project's default stream. Upload files to a project uses it; Upload files to a stream takes a stream ID.

defaultLanguagestring

The project's language, for example en-US.

Errors

StatusWhen
401Missing, wrong, expired or revoked token.

See Errors and status codes for the error body.

Was this page helpful? Next: List categories →
API reference / Projects

List categories

GET/api/v2/projects/{projectId}/labels

Lists the document categories set up in a project. The API calls a category a label, so its ID is labelId. Pass it as labelId when you upload to send a document straight to that category, or use it to list the category's fields.

  • Each category has more settings than the ones below. Use only these.

Used in: Quickstart

Parameters

projectIduuidpathrequired

Project ID from List projects.

Returns

projectIduuid

The project.

acctIduuid

The account.

labelsarray

The project's categories.

Show 2 fields
labelIduuid

The category.

namestring

The category's name in SortSpoke.

deletedLabelsarray

Categories removed from the project, in the same shape.

Errors

StatusWhen
400Unknown project, or the token's user can't use it.
401Missing, wrong, expired or revoked token.

See Errors and status codes for the error body.

Was this page helpful? Next: List fields in a category →
API reference / Projects

List fields in a category

GET/api/v2/projects/{projectId}/labels/{labelId}/fields

Lists the fields set up in one category of a project, with their IDs and names. Use it to see what a category extracts before you build your mapping.

  • The list is nested. An entry with its own fields array is a group, and its fields are inside it. Other entries are single fields.
  • Each field has more settings than the ones below. Use only these; the rest is internal configuration.

Parameters

projectIduuidpathrequired

Project ID from List projects.

labelIduuidpathrequired

Category ID from List categories.

Returns

labelIduuid

The category.

projectIduuid

The project. acctId is the account.

fieldsarray

The category's fields and groups of fields.

Show 4 fields
fieldIduuid

The field, or the group.

namestring

The name as set up in SortSpoke.

fieldsarray

Only on a group: the fields in it, in the same shape.

isRequiredboolean

Only on a field, with isMulti, isColumn (both boolean) and validationType: the field's settings in SortSpoke.

deletedFieldsarray

Fields removed from the category.

Errors

StatusWhen
400Unknown project or category, or the token's user can't use it.
401Missing, wrong, expired or revoked token.

See Errors and status codes for the error body.

Was this page helpful? Next: Upload files to a project →
API reference / Uploads

Upload files to a stream

POST/api/v2/streams/{streamId}/upload

Uploads one or more files into a specific stream of a project. It works like Upload files to a project, which always uses the project's default stream: same parameters, same response, same limits.

  • A project's default stream is its defaultStreamId in List projects with expanded=1.
  • Send the files as multipart/form-data. Every file part in the form is processed; name the part file.
  • Pass labelId to send a document straight to that category's extraction; without it, SortSpoke sorts it first.

Parameters

streamIduuidpathrequired

Stream ID (a project's defaultStreamId, or a custom stream).

uploadPathstringquery

Virtual folder, for example /inbox/claims@example.com. Without it, files go to the uploading user's queue.

labelIduuidquery

Category to sort the document into. The document skips sorting and goes to Extracting.

filefileform fieldrequired

One or more files as multipart/form-data. Every file part is processed.

Returns

An array with one entry per file, the same as for Upload files to a project:

docIduuid

The document SortSpoke created.

sourceFileIduuid

The stored file. Use it with Get source file status.

filenamestring

Stored path: /<uploader>/<file name>.

sizeinteger

File size in bytes.

Errors

StatusWhen
400Every file failed, the stream ID is wrong, or the token's user can't use the stream.
401Missing, wrong, expired or revoked token.
413An Office file is over 100,000,000 bytes, or the request is over 200,000,000 bytes.

See Errors and status codes for the error body.

Was this page helpful? Next: Get source file status →
API reference / Source files

Get source file status

GET/api/v2/sourceFiles/{sourceFileId}/status

Returns the state of a file you uploaded. A source file is the stored upload; SortSpoke can split it into several documents. State 300 (Finished) means the file and all of its documents are finished.

  • Take sourceFileId from the upload response.
  • An unknown source file ID returns 400.

Parameters

sourceFileIduuidpathrequired

Source file ID from the upload response.

Returns

sourceFileIduuid

The source file.

projectIduuid

The project it was uploaded to.

stateinteger

The source file state. 300 is Finished. State codes

sourceFileNamestring

The file name.

pageCountinteger

Number of pages in the file.

Errors

StatusWhen
400Unknown source file, or the token's user can't use it.
401Missing, wrong, expired or revoked token.

See Errors and status codes for the error body.

Was this page helpful? Next: List a source file's documents →
API reference / Source files

List a source file's documents

GET/api/v2/sourceFiles/{sourceFileId}/docs

Lists the documents SortSpoke made from one uploaded file, with each document's category, state and pages. Use it to see how a file was split.

Parameters

sourceFileIduuidpathrequired

Source file ID from the upload response.

Returns

An array with one entry per document:

docIduuid

The document.

labelIduuid

The category the document is in.

predictedLabelobject

The category SortSpoke predicted: labelId, confidence (number) and datePredicted (date-time).

stateinteger

The document state. 7 is Finished. State codes

sourcePagesarray

Which pages of the file the document holds.

Show 3 fields
docPageNuminteger

Page number in the document, starting at 1.

sourceFileIduuid

The source file.

sourceFilePageNuminteger

Page number in the uploaded file, starting at 1.

Errors

StatusWhen
400The source file ID isn't a valid ID.
401Missing, wrong, expired or revoked token.

See Errors and status codes for the error body.

Was this page helpful? Next: Split a source file →
API reference / Source files

Split a source file

POST/api/v2/sourceFiles/{sourceFileId}/split

Splits an uploaded file into documents by page range. Each entry in docPageRanges becomes one document in the category you give, made of the pages you list. Use it when one file holds several documents, for example an application followed by a loss run.

  • Page numbers in sourceFilePageNums start at 1. Take category IDs from List categories.
  • Every document from the file must still be at state 5 (Extracting) or earlier, or the request fails.
  • Pages with an invalid labelId or page range don't become a document, and there's no error for them. Check documents in the response.
  • The file's earlier documents are removed or regenerated by the split: state 1100 (Deleted During Split).

Parameters

sourceFileIduuidpathrequired

Source file ID from the upload response.

docPageRangesobject[]bodyrequired

[{ "labelId": "…", "sourceFilePageNums": [1, 2] }]. Page numbers are 1-based.

Returns

sourceFileIduuid

The source file.

documentsarray

The documents the split created.

Show 3 fields
docIduuid

The new document.

labelIduuid

Its category.

pagesinteger[]

Its pages.

Errors

StatusWhen
400A document from the file is past Extracting, the source file is unknown, or the token's user can't use it.
401Missing, wrong, expired or revoked token.

See Errors and status codes for the error body.

Was this page helpful? Next: Mark source files delivered →
API reference / Source files

Mark source files delivered

POST/api/v2/sourceFiles/deliver

Marks finished source files as Delivered (state 310), to record that you've received their exports. Their finished documents become Delivered (8) too, and a related batch moves to Delivered when it qualifies.

  • Send a bare JSON array of source file IDs, not an object.

Parameters

(request body)uuid[]bodyrequired

A bare JSON array of finished source file IDs.

Returns

200 with an empty body.

Errors

StatusWhen
400The body isn't a JSON array of IDs, or the request failed. Check that each ID is a finished source file the token's user can use.
401Missing, wrong, expired or revoked token.

See Errors and status codes for the error body.

Was this page helpful? Next: Get document status →
Embed

Embed SortSpoke in your app

Show SortSpoke's review screen in an iframe so people check and correct extracted data inside your app. Your server creates a review link, your page loads it, and SortSpoke posts messages to your page as the reviewer works.

Before you start
  • Send SortSpoke the exact https origin of the page that will show the iframe, for example https://app.example.com, for each data center you use. SortSpoke adds it to the allowed hosts; until then the browser refuses to show the screen.
  • Create review links on your server. The API rejects browser calls, and your API token must stay on your server.

1. Create a review link on your server

Call POST /api/v2/presigned/document/{docId}. A JSON body is required: send {} for the defaults, or set options in embedConfig. The link opens the Extract view for a document in states 3, 4, 5 or 510, and the read-only Finished view for states 7 and 8. Other states return 400.

Your server
curl -X POST "https://api.sortspoke.com/api/v2/presigned/document/$DOC_ID" \
  -H "Authorization: Bearer $SORTSPOKE_API_TOKEN" \
  -H "Accept: application/json" \
  -H "User-Agent: your-app/1.0" \
  -H "Content-Type: application/json" \
  -d '{"embedConfig": {"ui": {"language": "en-CA"}, "messaging": {"emitExportFieldsData": true}}}'
// On your server: never call this from the browser.
const res = await fetch(`${BASE}/api/v2/presigned/document/${docId}`, {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({
    embedConfig: { ui: { language: "en-CA" }, messaging: { emitExportFieldsData: true } },
  }),
});
if (!res.ok) throw new Error(`SortSpoke ${res.status}: ${await res.text()}`);
const { returnUrl, expiryDate } = await res.json();
// Send returnUrl to your page.
# On your server: never call this from the browser.
res = requests.post(
    f"{BASE}/api/v2/presigned/document/{doc_id}",
    json={"embedConfig": {"ui": {"language": "en-CA"}, "messaging": {"emitExportFieldsData": True}}},
    headers=HEADERS,
)
res.raise_for_status()
return_url = res.json()["returnUrl"]
// On your server: never call this from the browser.
var res = await http.PostAsJsonAsync($"/api/v2/presigned/document/{docId}", new
{
    embedConfig = new { ui = new { language = "en-CA" }, messaging = new { emitExportFieldsData = true } },
});
res.EnsureSuccessStatusCode();
using var link = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
var returnUrl = link.RootElement.GetProperty("returnUrl").GetString();
Response200 OK
{
  "generatedDate": "2026-11-24T15:00:00.0000000Z",
  "expiryDate": "2026-11-24T16:00:00.0000000Z",
  "returnUrl": "https://auth.sortspoke.com/embed/launch?token=<encrypted>"
}
Recorded from a live call. Values are fictional.
Each link works once and expires 60 minutes after you create it.

The embedded session also ends at expiryDate, so create the link right before you show the screen. SortSpoke can change uses (1 to 100) and expiry (10 minutes to 24 hours) per project on request.

Creating an editable link also puts the document in the token user's queue: a document with no batch joins that user's default batch, and an unassigned batch is claimed by them. A document in someone else's batch returns 400. Send "readOnly": true to open a view-only link without these effects.

2. Load the iframe

Use all three sandbox tokens. allow-forms is required: the review screen starts with a form post inside the frame.

Your page · HTML
<iframe id="sortspoke-iframe" title="SortSpoke document review"
        sandbox="allow-same-origin allow-scripts allow-forms"
        style="width:100%;height:100%;border:0" hidden></iframe>

3. Listen for messages

SortSpoke posts messages to your page with target "*", so check where each one came from. Trust a message only if event.source is your iframe and event.origin is your API host or the origin of returnUrl.

Your page · JavaScript
const API_ORIGIN = "https://api.sortspoke.com";
const iframe = document.getElementById("sortspoke-iframe");

async function openReview(docId) {
  // Your own endpoint, which calls the presigned API on your server.
  const { returnUrl } = await (await fetch(`/review-links/${docId}`, { method: "POST" })).json();
  const allowed = [API_ORIGIN, new URL(returnUrl).origin];
  window.addEventListener("message", (event) => {
    if (event.source !== iframe.contentWindow || !allowed.includes(event.origin)) return;
    const msg = event.data;
    if (msg.messageType === "Document_State_Change" && msg.message === "Exporting") {
      // Accepted: wait for the document to reach Finished (7), then download the export.
    }
    if (msg.messageType === "Close_Window") iframe.hidden = true;
  });
  iframe.setAttribute("src", returnUrl);
  iframe.hidden = false;
}
MessageSent whenKey fields
Document_State_ChangeThe reviewer accepts ("Exporting", 6), rejects ("Rejected", 1005) or sorts the document ("Predicting Values", 4). In batch sessions, re-sorting sends "Sorting", 3. On by default.subjectId (the document), message, state, timestamp
Export_Fields_DataRight after an accept. Off by default: set messaging.emitExportFieldsData to true.message ("success" or "error"), data (the fields)
Close_WindowThe reviewer clicks the close button. SortSpoke signs the session out first. Also sent from the expired-link page.sortSpokeModule is "App"; field data only if messaging.closeWindowData is "changed" or "all"
MessageDocument_State_Change
{
  "sortSpokeModule": "Extract",
  "messageType": "Document_State_Change",
  "subjectId": "5f0c8a2e-0000-4000-a000-0000000000f1",
  "timestamp": "2026-11-24T15:30:00.000Z",
  "message": "Exporting",
  "state": 6
}
Shape from SortSpoke source code; not recorded live.
MessageExport_Fields_Data
{
  "sortSpokeModule": "Extract",
  "messageType": "Export_Fields_Data",
  "subjectId": "5f0c8a2e-0000-4000-a000-0000000000f1",
  "timestamp": "2026-11-24T15:30:00.000Z",
  "message": "success",
  "data": [
    {
      "fieldId": "5f0c8a2e-0000-4000-a000-0000000000f2",
      "name": "Insured Name",
      "value": "Northwind Trucking Ltd."
    },
    {
      "fieldId": "5f0c8a2e-0000-4000-a000-0000000000f3",
      "name": "Vehicles",
      "records": [
        {
          "recordId": "5f0c8a2e-0000-4000-a000-0000000000f4",
          "fields": [
            {
              "fieldId": "5f0c8a2e-0000-4000-a000-0000000000f5",
              "name": "VIN",
              "value": "1FTFW1E50PFA00000"
            }
          ]
        }
      ]
    },
    {
      "fieldId": "5f0c8a2e-0000-4000-a000-0000000000f6",
      "name": "Loss Table",
      "data": [
        {
          "rowId": "row-1",
          "cells": [
            {
              "fieldId": "5f0c8a2e-0000-4000-a000-0000000000f8",
              "name": "Date",
              "value": "2025-03-01"
            }
          ]
        }
      ]
    }
  ]
}
Shape from SortSpoke source code; not recorded live.
MessageClose_Window
{
  "sortSpokeModule": "App",
  "messageType": "Close_Window",
  "timestamp": "2026-11-24T15:30:00.000Z"
}
Shape from SortSpoke source code; not recorded live.
MessageClose_Window with closeWindowData
{
  "sortSpokeModule": "App",
  "messageType": "Close_Window",
  "subjectId": "5f0c8a2e-0000-4000-a000-0000000000f1",
  "timestamp": "2026-11-24T15:30:00.000Z",
  "message": "success",
  "changedFieldIds": [
    "5f0c8a2e-0000-4000-a000-0000000000f2"
  ],
  "data": [
    {
      "fieldId": "5f0c8a2e-0000-4000-a000-0000000000f3",
      "name": "Policy Number",
      "value": "NW-2027-0042",
      "tier": "HumanVerified"
    }
  ]
}
Shape from SortSpoke source code; not recorded live.

Options: embedConfig

Every option is optional. The whole embedConfig must stay under 4 KB.

OptionDefaultWhat it does
ui.languageen-CAStarting language: en-CA, fr or es-MX. Also accepts en, en-US, fr-CA, fr-FR, es. Anything else returns 400.
ui.showLanguageSelectorfalseShow the language picker.
ui.showIframeCloseButtontrueShow the close button. Hiding it also stops Close_Window.
ui.showLogotrueShow the SortSpoke logo.
ui.showDoneDocSummaryPaneltrueShow the summary panel in the Finished view.
ui.showRefreshPredictions, ui.showResort, ui.showReject, ui.showViewFieldstrueShow these menu items.
messaging.emitDocumentStateChangetrueSend Document_State_Change.
messaging.emitExportFieldsDatafalseSend Export_Fields_Data after an accept.
messaging.closeWindowData"none""none", "changed" or "all": what Close_Window carries. "changed" sends every field plus changedFieldIds.
theme.primaryColour#0091B6Main colour, as #RRGGBB. Note the British spelling.
theme.headerColour—Header bar colour.
featureFlags.enhancedNavOnfalseStart with fast navigation on.
featureFlags.splitEnabledfalseAllow splitting. Batch review only.

Read-only links and field deep links

Next to embedConfig, send "readOnly": true for a view-only link, or fieldTarget to open at one field: { "fieldId": "…" }, { "fieldId": "…", "recordId": "…" } for one row or record, or { "valueId": "…" }.

Known limits

  • The review screen uses a cookie that sortspoke.com sets inside your page. Browsers that block third-party cookies may not load it. Test in the browsers your users run.
  • The iframe doesn't accept messages from your page.

Deprecated routes

RouteStatusUse instead
GET /api/v2/presigned/document/{docId}DeprecatedPOST /api/v2/presigned/document/{docId}
POST /api/v2/presigned/document/{docId}/extractDeprecatedPOST /api/v2/presigned/document/{docId}
GET /api/v2/presigned/document/{docId}/extractRemovedPOST /api/v2/presigned/document/{docId}
POST /api/v2/presigned/batch/{batchId}/extractDeprecatedPOST /api/v2/presigned/batch/{batchId}
Was this page helpful? Next: Errors and status codes →
Get started

Errors and status codes

Errors return JSON with the HTTP status, a traceId and a short description. Log the traceId: support uses it to find your request.

StatusMeaningWhat to do
200Success. Some write calls return an empty body.
400Invalid input, and also most cases of no access, not found or wrong state. SortSpoke doesn't return 403 or 404 for those.Check the IDs, the token user's access and the document's state.
401Missing, wrong, expired or revoked token.Check the Authorization header; create a new token if needed.
403An HTML page, not JSON: a firewall rule blocked the request.Send support the time and your server's IP address.
413Upload too large. The body may be plain text.See the upload limits.
422The requested export format doesn't apply to this document. The body may be plain text.
500Something failed on SortSpoke's side.Retry later; send support the time and IDs.

State codes

Documents, uploaded files and batches each have a numeric state. Switch on the number: display names can change.

Document states

CodeNameMeaning
1PreprocessingReceived; being preprocessed. Temporary.
2Predicting SortQueued for sorting. Temporary.
3SortingReady to be sorted into a category by a person.
310Reprocessing PagesPages being reprocessed during sorting. Temporary.
4Predicting ValuesSorted; queued for field predictions. Temporary.
5ExtractingReady for review.
510Reprocessing PagesPages being reprocessed during review. Temporary.
6ExportingAccepted; export being written. Temporary.
7FinishedDone. The export is ready.
8DeliveredYou marked the export as received.
1002Preprocessing ErrorThe file could not be preprocessed.
1004Export ErrorExport failed. Contact SortSpoke.
1005RejectedA person rejected the document.
1006QuarantinedThe file failed the antivirus scan.
1100Deleted During SplitRemoved or regenerated by a split.
1200Excel UnpackedAn XLSX file was split into one document per sheet.
91005Pending RejectionMarked for rejection; being processed.

Source file states

CodeNameMeaning
100DownloadedReceived; queued for preprocessing. Temporary.
200PreprocessedReady.
250Pending ExportAll its documents are finished; updating shortly. Temporary.
300FinishedAll its documents are finished.
310DeliveredYou marked the export as received.
320Excel UnpackedAn XLSX file was split into one file per sheet.
400Preprocessing ErrorThe file could not be preprocessed.
401QuarantinedThe file failed the antivirus scan.
1300ReplacedA newer copy arrived from a cloud storage connection.

Batch states

CodeNameMeaning
10FillingReceiving documents.
20FilledReady to be claimed.
30ClaimedAssigned to a person.
50FinishedEvery document is accepted or rejected.
60DeliveredYou marked the export as received.
90MergedMerged into another batch.
100AbortedAbandoned. Says nothing about its documents.
110RejectedRejected, with any unfinished documents in it.
Was this page helpful? Next: Downloads →
Resources

Downloads

Files to try SortSpoke from your own tools. They describe every public API call and are checked against live calls.

OpenAPI descriptionEvery public operation, with parameters, the error body and examples. Use it with code generators and API tools.JSON · 80 KB
Postman collectionEvery public operation, grouped by resource, with bearer auth from apiToken and a User-Agent header.JSON · 30 KB
Postman environmentEmpty values for baseUrl, apiToken and the IDs the collection uses.JSON · 912 bytes
llms.txtAn index of these pages for AI assistants.Text · 4 KB
Was this page helpful? Back to Overview →

File