Sources

Auto-pull watchers on drive folders, mailboxes and Teams channels.

List sources#

List sources

GET/api/v2/sources

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

Query parameters

queueIdstring

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/sources" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"sources": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"config": {},
"intervalMinutes": 1,
"enabled": true,
"lastRunAt": "2026-10-01T12:00:00.000Z",
"nextRunAt": "2026-10-01T12:00:00.000Z",
"lastError": null,
"itemsIngested": 1
}
]
}

Create a source#

Create a source

POST/api/v2/sources

Requires sources:manage on the queue it touches.queue-scoped

Body

application/json
queueIdstringrequired
connectionIdstring
namestringrequired
configobjectrequired
intervalMinutesinteger
Default15
enabledboolean
Defaulttrue

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/sources" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"config": {
"kind": "drive-folder",
"driveId": "clx9k2m4p0001qh8z3v7d5f2a",
"itemId": "clx9k2m4p0001qh8z3v7d5f2a",
"path": "invoiceTotal"
},
"enabled": true
}'
Response201
{
"source": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"config": {},
"intervalMinutes": 1,
"enabled": true,
"lastRunAt": "2026-10-01T12:00:00.000Z",
"nextRunAt": "2026-10-01T12:00:00.000Z",
"lastError": null,
"itemsIngested": 1
}
}

Get a source#

Get a source

GET/api/v2/sources/{id}

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

Path parameters

idstringrequired
Source id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/sources/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"source": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"config": {},
"intervalMinutes": 1,
"enabled": true,
"lastRunAt": "2026-10-01T12:00:00.000Z",
"nextRunAt": "2026-10-01T12:00:00.000Z",
"lastError": null,
"itemsIngested": 1
}
}

Update a source#

Update a source

PATCH/api/v2/sources/{id}

Requires sources:manage on the queue it touches.queue-scoped

Path parameters

idstringrequired
Source id.

Body

application/json
queueIdstring
connectionIdstring
namestring
configobject
intervalMinutesinteger
Default15
enabledboolean
Defaulttrue

Responses

OK

curl -X PATCH "https://docuflow.pendral.io/api/v2/sources/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Invoices",
"enabled": true
}'
Response200
{
"source": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"config": {},
"intervalMinutes": 1,
"enabled": true,
"lastRunAt": "2026-10-01T12:00:00.000Z",
"nextRunAt": "2026-10-01T12:00:00.000Z",
"lastError": null,
"itemsIngested": 1
}
}

Delete a source#

Delete a source

DELETE/api/v2/sources/{id}

Requires sources:manage on the queue it touches.queue-scoped

Path parameters

idstringrequired
Source id.

Responses

OK

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

Trigger a source from outside#

Starts a poll immediately. The token in the path is the only credential, so a Salesforce Flow or a script can call it without an API key. Repeated calls inside ten seconds collapse into one poll. The response never reveals whether the source exists.

POST/api/v2/sources/{id}/hook/{token}

No DocuFlow credential: authenticated by a token derived from the deployment key and the source id; the route compares before it looks anything up.

Path parameters

idstringrequired
Source id.
tokenstringrequired
The source's hook token, shown beside the source in DocuFlow.

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/sources/{id}/hook/{token}"
Response200
{
"queued": false
}

Deliver a fax to a fax line#

Where a fax platform posts each inbound fax. Accepts multipart/form-data (every file part is a document, every text part a field), a bare PDF/TIFF/image body (facts in the query string or X-Fax-From / X-Fax-To headers), or JSON carrying the file as base64. The sending number, the line it was sent to, the station id and the page count are read under whatever names the platform uses. A repeat of the same file answers success without processing it twice, so vendor retries are safe; a paused line answers 503 so the platform holds and retries. The token in the path is the only credential.

POST/api/v2/sources/{id}/inbound/{token}

No DocuFlow credential: authenticated by a fax line's inbound token, derived from the deployment key and the source id under its own purpose; compared before any lookup.

Path parameters

idstringrequired
Source id of a fax line.
tokenstringrequired
The line's inbound token, part of the address shown beside it in DocuFlow.

Query parameters

filenamestring
Original file name, for a bare-body delivery.

Body

multipart/form-data
filefile[]required
The fax (PDF, TIFF or image). Any number of file parts; the part name does not matter.
fromstring
Sending number. Also read as from_number, caller_id, sender, ani…
tostring
The line it was sent to. Also read as to_number, recipient, dnis, did…
csidstring
Sender station id.
pagesstring
Page count.

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/sources/{id}/inbound/{token}" \
-F "file=@invoice.pdf"
Response202
{
"received": 1,
"documents": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "invoice-1042.pdf",
"duplicate": false
}
],
"skipped": [
{
"name": "Invoices",
"reason": "Duplicate of an earlier upload"
}
]
}

Preview what a source would pull#

Judges the most recent emails or files against a draft source's intake rules and reports what it would have taken, with the condition trace for each. Reads only: nothing is imported and no cursor moves.

POST/api/v2/sources/preview

Requires sources:manage on the queue it touches.queue-scoped

Body

application/json
connectionIdstring
sourceIdstring
configobjectrequired
limitinteger
Default15

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/sources/preview" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"config": {
"kind": "drive-folder",
"driveId": "clx9k2m4p0001qh8z3v7d5f2a",
"itemId": "clx9k2m4p0001qh8z3v7d5f2a",
"path": "invoiceTotal"
},
"limit": 50
}'
Response200
{
"scanned": 1,
"wouldIngest": 1,
"messages": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"subject": "subject",
"from": "from",
"receivedAt": "2026-10-01T12:00:00.000Z",
"matched": false,
"trace": {},
"webLink": "webLink",
"bodyWouldBeIngested": false,
"attachments": [
{
"name": "Invoices",
"sizeKb": 1,
"taken": false,
"reason": "Duplicate of an earlier upload",
"trace": {}
}
]
}
],
"files": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"path": "invoiceTotal",
"sizeKb": 1,
"matched": false,
"reason": "Duplicate of an earlier upload",
"trace": {},
"webUrl": "webUrl"
}
],
"records": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"path": "invoiceTotal",
"matched": false,
"reason": "Duplicate of an earlier upload",
"trace": {}
}
]
}

Poll now#

Poll now

POST/api/v2/sources/{id}/run

Requires sources:manage on the queue it touches.queue-scoped

Path parameters

idstringrequired
Source id.

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/sources/{id}/run" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"queued": true
}

Poll stats and recent documents#

Poll stats and recent documents

GET/api/v2/sources/{id}/runs

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

Path parameters

idstringrequired
Source id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/sources/{id}/runs" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"stats": {
"lastRunAt": "2026-10-01T12:00:00.000Z",
"nextRunAt": "2026-10-01T12:00:00.000Z",
"lastError": null,
"itemsIngested": 1,
"enabled": true
},
"recent": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"status": "received"
}
]
}