Queues

Document families: automation, workload and assignment.

SLA clocks#

Per queue: the SLA target and the calendar its clock counts in (null = 24/7), plus those calendars — enough to show "due in 3 business hours".

GET/api/v2/business-calendars/sla

Requires documents:read.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/business-calendars/sla" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"policies": {
"key": {
"slaMinutes": 1,
"calendarId": "clx9k2m4p0001qh8z3v7d5f2a"
}
},
"calendars": {
"key": {
"name": "Invoices",
"timeZone": "timeZone",
"week": [
[
{
"start": 1,
"end": 1
}
]
],
"presets": [
"us_federal"
],
"exceptions": [
{
"date": "date",
"name": "Invoices",
"hours": []
}
],
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"isDefault": false,
"updatedAt": "2026-10-01T12:00:00.000Z"
}
}
}

List queues#

With document counts and the active schema summary. Narrowed to queues the caller can read.

GET/api/v2/queues

Requires queues:read on the queue it touches.queue-scoped

Query parameters

includeArchivedboolean

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/queues" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"queues": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"color": "indigo",
"automation": "never",
"threshold": 0.9,
"splitting": false,
"classification": false,
"activeSchemaId": "clx9k2m4p0001qh8z3v7d5f2a",
"settings": {},
"archivedAt": null,
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z",
"stats": {
"total": 1,
"needsReview": 1,
"processing": 1,
"failed": 1,
"approved7d": 1,
"avgConfidence": 0.91,
"sources": 1,
"destinations": 1,
"rules": 1
},
"schema": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"version": 1,
"fieldCount": 1,
"documentType": "invoice"
}
}
]
}

Create a queue#

From a template (templateId) or your own fields.

POST/api/v2/queues

Requires queues:create.

Body

application/json
namestringrequired
descriptionstring | null
colorstring
templateIdstring
fieldsFieldDef[]
instructionsstring
documentTypestring
automation"never" | "confident" | "always"
thresholdnumber

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/queues" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"color": "indigo",
"instructions": "Dates are day-first. The total is the amount due, not the subtotal.",
"documentType": "invoice",
"threshold": 0.9
}'
Response201
{
"queue": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"color": "indigo",
"automation": "never",
"threshold": 0.9,
"splitting": false,
"classification": false,
"activeSchemaId": "clx9k2m4p0001qh8z3v7d5f2a",
"settings": {},
"archivedAt": null,
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z",
"activeSchema": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"version": 1,
"name": "Invoices",
"fields": [
{
"key": "invoiceNumber",
"label": "Invoice number",
"type": "string",
"description": "Supplier invoices from the accounts payable mailbox.",
"required": false,
"options": [],
"children": [],
"itemType": "string",
"pattern": "pattern",
"min": 1,
"max": 1,
"format": "format",
"examples": [],
"enrich": {
"dataset": "dataset",
"keyPath": "keyPath",
"column": "column",
"mode": "exact"
}
}
],
"instructions": "Dates are day-first. The total is the amount due, not the subtotal.",
"documentType": "invoice"
}
}
}

Get a queue#

Get a queue

GET/api/v2/queues/{id}

Requires queues:read on the queue it touches.queue-scoped

Path parameters

idstringrequired
Queue id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/queues/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"queue": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"color": "indigo",
"automation": "never",
"threshold": 0.9,
"splitting": false,
"classification": false,
"activeSchemaId": "clx9k2m4p0001qh8z3v7d5f2a",
"settings": {},
"archivedAt": null,
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z",
"activeSchema": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"version": 1,
"name": "Invoices",
"fields": [
{
"key": "invoiceNumber",
"label": "Invoice number",
"type": "string",
"description": "Supplier invoices from the accounts payable mailbox.",
"required": false,
"options": [],
"children": [],
"itemType": "string",
"pattern": "pattern",
"min": 1,
"max": 1,
"format": "format",
"examples": [],
"enrich": {
"dataset": "dataset",
"keyPath": "keyPath",
"column": "column",
"mode": "exact"
}
}
],
"instructions": "Dates are day-first. The total is the amount due, not the subtotal.",
"documentType": "invoice"
}
}
}

Update a queue#

Name, automation, threshold, splitting, classification, OCR mode, model tier, assignment and SLA settings.

PATCH/api/v2/queues/{id}

Requires queues:configure on the queue it touches.queue-scoped

Path parameters

idstringrequired
Queue id.

Body

application/json
namestring
descriptionstring | null
colorstring | null
iconstring | null
automation"never" | "confident" | "always"
thresholdnumber
splittingboolean
classificationboolean
ocrMode"auto" | "always" | "never"
modelTier"fast" | "accurate"
verifyWithSecondModelboolean
settingsRecord<string, any>
slaMinutesinteger | null
slaBusinessHoursboolean
slaTimezonestring
slaCalendarIdstring | null
assignmentMode"manual" | "round_robin" | "least_loaded"
assignmentOnlyNeedsReviewboolean

Responses

OK

curl -X PATCH "https://docuflow.pendral.io/api/v2/queues/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"color": "indigo",
"threshold": 0.9
}'
Response200
{
"queue": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"color": "indigo",
"automation": "never",
"threshold": 0.9,
"splitting": false,
"classification": false,
"activeSchemaId": "clx9k2m4p0001qh8z3v7d5f2a",
"settings": {},
"archivedAt": null,
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z",
"activeSchema": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"version": 1,
"name": "Invoices",
"fields": [
{
"key": "invoiceNumber",
"label": "Invoice number",
"type": "string",
"description": "Supplier invoices from the accounts payable mailbox.",
"required": false,
"options": [],
"children": [],
"itemType": "string",
"pattern": "pattern",
"min": 1,
"max": 1,
"format": "format",
"examples": [],
"enrich": {
"dataset": "dataset",
"keyPath": "keyPath",
"column": "column",
"mode": "exact"
}
}
],
"instructions": "Dates are day-first. The total is the amount due, not the subtotal.",
"documentType": "invoice"
}
}
}

Delete a queue#

Delete a queue

DELETE/api/v2/queues/{id}

Requires queues:delete on the queue it touches.queue-scoped

Path parameters

idstringrequired
Queue id.

Responses

OK

curl -X DELETE "https://docuflow.pendral.io/api/v2/queues/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"ok": true
}

Archive or unarchive#

Archive or unarchive

POST/api/v2/queues/{id}/archive

Requires queues:configure on the queue it touches.queue-scoped

Path parameters

idstringrequired
Queue id.

Body

application/json
archivedboolean
Defaulttrue

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/queues/{id}/archive" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Response200
{
"queue": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"color": "indigo",
"automation": "never",
"threshold": 0.9,
"splitting": false,
"classification": false,
"activeSchemaId": "clx9k2m4p0001qh8z3v7d5f2a",
"settings": {},
"archivedAt": null,
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z"
}
}

Queue overview#

Stats, recent documents and per-field accuracy with trend.

GET/api/v2/queues/{id}/overview

Requires queues:read on the queue it touches.queue-scoped

Path parameters

idstringrequired
Queue id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/queues/{id}/overview" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"queue": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"color": "indigo",
"automation": "never",
"threshold": 0.9,
"splitting": false,
"classification": false,
"activeSchemaId": "clx9k2m4p0001qh8z3v7d5f2a",
"settings": {},
"archivedAt": null,
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z",
"activeSchema": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"version": 1,
"name": "Invoices",
"fields": [
{
"key": "invoiceNumber",
"label": "Invoice number",
"type": "string",
"description": "Supplier invoices from the accounts payable mailbox.",
"required": false,
"options": [],
"children": [],
"itemType": "string",
"pattern": "pattern",
"min": 1,
"max": 1,
"format": "format",
"examples": [],
"enrich": {
"dataset": "dataset",
"keyPath": "keyPath",
"column": "column",
"mode": "exact"
}
}
],
"instructions": "Dates are day-first. The total is the amount due, not the subtotal.",
"documentType": "invoice"
}
},
"stats": {
"total": 1,
"needsReview": 1,
"processing": 1,
"failed": 1,
"autoApproveRate": 1,
"avgConfidence": 0.91,
"medianProcessingMs": 1
},
"recent": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"status": "received",
"createdAt": "2026-10-01T12:00:00.000Z"
}
],
"accuracy": [
{
"path": "invoiceTotal",
"total": 1,
"edited": 1,
"accuracy": 1
}
],
"accuracyTrend": {}
}

Reviewer workload#

Eligible reviewers with open, overdue and oldest assigned work, plus the queue's assignment and SLA settings.

GET/api/v2/queues/{id}/workload

Requires queues:read on the queue it touches.queue-scoped

Path parameters

idstringrequired
Queue id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/queues/{id}/workload" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"rows": [
{
"userId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"email": "ada@example.com",
"image": null,
"eligible": false,
"open": 1,
"overdue": 1,
"oldestAt": "2026-10-01T12:00:00.000Z",
"workspaceOpen": 1
}
],
"unassigned": 1,
"eligibleCount": 1,
"mode": "mode",
"onlyNeedsReview": false,
"slaMinutes": 1,
"slaBusinessHours": false
}

Processed documents in a queue#

The latest 50 with pages (for generating a schema from a sample).

GET/api/v2/queues/{id}/documents

Requires documents:read on the queue it touches.queue-scoped

Path parameters

idstringrequired
Queue id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/queues/{id}/documents" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"documents": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "invoice-1042.pdf",
"status": "received",
"pageCount": 2,
"createdAt": "2026-10-01T12:00:00.000Z"
}
]
}