Sources
Auto-pull watchers on drive folders, mailboxes and Teams channels.
List sources#
List sources
/api/v2/sourcesRequires 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"
{"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
/api/v2/sourcesRequires sources:manage on the queue it touches.queue-scoped
Body
application/jsonqueueIdstringrequiredconnectionIdstringnamestringrequiredconfigobjectrequiredintervalMinutesinteger- Default
15 enabledboolean- Default
true
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}'
{"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
/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"
{"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
/api/v2/sources/{id}Requires sources:manage on the queue it touches.queue-scoped
Path parameters
idstringrequired- Source id.
Body
application/jsonqueueIdstringconnectionIdstringnamestringconfigobjectintervalMinutesinteger- Default
15 enabledboolean- Default
true
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}'
{"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
/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"
{"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.
/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}"
{"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.
/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-datafilefile[]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"
{"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.
/api/v2/sources/previewRequires sources:manage on the queue it touches.queue-scoped
Body
application/jsonconnectionIdstringsourceIdstringconfigobjectrequiredlimitinteger- Default
15
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}'
{"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
/api/v2/sources/{id}/runRequires 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"
{"queued": true}
Poll stats and recent documents#
Poll stats and recent documents
/api/v2/sources/{id}/runsRequires 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"
{"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"}]}