Connections

Microsoft 365 accounts connected through Nango (connected in the app; browsed and imported from here).

List connections#

List connections

GET/api/v2/connections

Requires connections:read.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/connections" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"connections": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"provider": "provider",
"providerLabel": "providerLabel",
"displayName": "displayName",
"accountEmail": "accountEmail",
"status": "status",
"createdAt": "2026-10-01T12:00:00.000Z"
}
],
"configured": false
}

Finalize a connection#

Called by the app after the Nango connect UI completes.

POST/api/v2/connections

Requires connections:manage.

Body

application/json
providerstringrequired
nangoConnectionIdstringrequired

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/connections" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "provider",
"nangoConnectionId": "clx9k2m4p0001qh8z3v7d5f2a"
}'
Response201
{
"connection": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"provider": "provider",
"providerLabel": "providerLabel",
"displayName": "displayName",
"accountEmail": "accountEmail",
"status": "status",
"createdAt": "2026-10-01T12:00:00.000Z"
}
}

Get a connection#

Get a connection

GET/api/v2/connections/{id}

Requires connections:read.

Path parameters

idstringrequired
Connection id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/connections/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"connection": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"provider": "provider",
"providerLabel": "providerLabel",
"displayName": "displayName",
"accountEmail": "accountEmail",
"status": "status",
"createdAt": "2026-10-01T12:00:00.000Z"
}
}

Disconnect#

Refuses while sources or destinations use it unless force=1.

DELETE/api/v2/connections/{id}

Requires connections:manage.

Path parameters

idstringrequired
Connection id.

Query parameters

force"1"

Responses

OK

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

List drives#

List drives

GET/api/v2/connections/{id}/drives

Requires connections:read.

Path parameters

idstringrequired
Connection id.

Query parameters

qstring
Search sites/drives by name.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/connections/{id}/drives" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"drives": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices"
}
]
}

Browse a drive folder#

Folders first. itemId or path picks the folder (root otherwise).

GET/api/v2/connections/{id}/items

Requires connections:read.cursor-paginated

Path parameters

idstringrequired
Connection id.

Query parameters

driveIdstringrequired
itemIdstring
pathstring
cursorstring

Responses

OK. Cursor-paginated: pass nextCursor back as cursor; null means the last page.

curl -X GET "https://docuflow.pendral.io/api/v2/connections/{id}/items?driveId=driveId" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"items": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"isFolder": false,
"supported": false,
"driveId": "clx9k2m4p0001qh8z3v7d5f2a"
}
],
"nextCursor": "clx9k2m4p0001qh8z3v7d5f2a",
"folderId": "clx9k2m4p0001qh8z3v7d5f2a"
}

List mail folders#

List mail folders

GET/api/v2/connections/{id}/mail-folders

Requires connections:read.

Path parameters

idstringrequired
Connection id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/connections/{id}/mail-folders" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"folders": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"displayName": "displayName"
}
]
}

List messages or attachments#

Messages in a folder; with messageId, that message's attachments instead.

GET/api/v2/connections/{id}/messages

Requires connections:read.cursor-paginated

Path parameters

idstringrequired
Connection id.

Query parameters

folderIdstring
searchstring
cursorstring
messageIdstring

Responses

OK. Cursor-paginated: pass nextCursor back as cursor; null means the last page.

curl -X GET "https://docuflow.pendral.io/api/v2/connections/{id}/messages" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"messages": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"subject": "subject",
"hasAttachments": false
}
],
"nextCursor": "clx9k2m4p0001qh8z3v7d5f2a"
}

Teams, channels, or a channel's files folder#

No params: teams. teamId: its channels. teamId + channelId: the channel's files folder.

GET/api/v2/connections/{id}/teams

Requires connections:read.

Path parameters

idstringrequired
Connection id.

Query parameters

teamIdstring
channelIdstring

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/connections/{id}/teams" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"teams": [
null
]
}

List Salesforce objects#

Searched and ranked on the server: an org describes thousands of objects, most of them plumbing, so the everyday ones come first and a search term wins over the ranking.

GET/api/v2/connections/{id}/salesforce/objects

Requires connections:read.

Path parameters

idstringrequired
Connection id.

Query parameters

qstring
Search API names and labels.
writableboolean
Only objects records can be written to.
customboolean
Only the org's own objects.
limitnumber
Default50

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/connections/{id}/salesforce/objects" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"objects": [
{
"name": "Invoices",
"label": "Invoice number",
"labelPlural": "labelPlural",
"custom": false,
"queryable": false,
"createable": false,
"updateable": false
}
],
"total": 1
}

Describe a Salesforce object#

One object's fields, with type, whether it can be written, whether it is required, its picklist values and what a relationship field points at.

GET/api/v2/connections/{id}/salesforce/objects/{object}

Requires connections:read.

Path parameters

idstringrequired
Connection id.
objectstringrequired
Object API name, e.g. Case or Claim__c.

Query parameters

qstring
writableboolean
requiredboolean
customboolean

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/connections/{id}/salesforce/objects/{object}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"name": "Invoices",
"label": "Invoice number",
"createable": false,
"updateable": false,
"fields": [
{
"name": "Invoices",
"label": "Invoice number",
"type": "type",
"createable": false,
"updateable": false,
"required": false,
"custom": false,
"externalId": false,
"calculated": false,
"length": 1,
"help": "help",
"referenceTo": [
"referenceTo"
],
"picklist": [
"picklist"
],
"restrictedPicklist": false
}
],
"fieldCount": 1,
"externalIdFields": [
"externalIdField"
],
"children": [
{
"object": "object",
"field": "field",
"relationshipName": "relationshipName"
}
]
}

Sample Salesforce records#

How many records a filter matches, and a few of them. Reads only.

POST/api/v2/connections/{id}/salesforce/sample

Requires connections:read.

Path parameters

idstringrequired
Connection id.

Body

application/json
objectstringrequired
filtersobject
fieldsstring[]
limitnumber
Default10

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/connections/{id}/salesforce/sample" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"object": "object"
}'
Response200
{
"fields": [
"field"
],
"where": "where",
"count": 1,
"records": [
{}
]
}

Test a connection#

Test a connection

POST/api/v2/connections/{id}/test

Requires connections:read.

Path parameters

idstringrequired
Connection id.

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/connections/{id}/test" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"ok": true,
"displayName": "displayName",
"accountEmail": "accountEmail"
}

Import files now#

Pull drive items and/or mail attachments into a queue. Duplicates are detected by content.

POST/api/v2/connections/{id}/import

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

Path parameters

idstringrequired
Connection id.

Body

application/json
queueIdstringrequired
itemsobject[]
messagesobject[]
priorityinteger
tagsstring[]

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/connections/{id}/import" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"priority": 0,
"tags": [
"urgent"
]
}'
Response201
{
"documents": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "invoice-1042.pdf",
"duplicate": false
}
],
"failed": [
{
"name": "Invoices",
"error": "error"
}
]
}

Connector availability#

Connector availability

GET/api/v2/nango/session

Requires connections:read.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/nango/session" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"configured": false,
"providers": [
"provider"
]
}

Start a connect session#

A short-lived Nango token for the connect UI.

POST/api/v2/nango/session

Requires connections:manage.

Body

application/json
provider"sharepoint-online" | "one-drive" | "outlook" | "microsoft-teams" | "salesforce" | "salesforce-sandbox"required

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/nango/session" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "sharepoint-online"
}'
Response200
{
"token": "dfk_live_7Hq2xV9mLr4tW8bN3cKp",
"expiresAt": "2026-10-01T12:00:00.000Z",
"provider": "provider"
}