Destinations

Where approved data goes: drive folders, email, or a signed webhook.

List destinations#

List destinations

GET/api/v2/destinations

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

Query parameters

queueIdstring

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/destinations" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"destinations": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"kind": "kind",
"config": {},
"format": "json",
"trigger": "approved",
"enabled": true
}
]
}

Create a destination#

Create a destination

POST/api/v2/destinations

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

Body

application/json
queueIdstringrequired
connectionIdstring | null
namestringrequired
configobjectrequired
format"json" | "csv" | "xlsx"
Default"json"
trigger"approved" | "extracted"
Default"approved"
enabledboolean
Defaulttrue

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/destinations" \
-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
{
"destination": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"kind": "kind",
"config": {},
"format": "json",
"trigger": "approved",
"enabled": true
}
}

Get a destination#

Get a destination

GET/api/v2/destinations/{id}

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

Path parameters

idstringrequired
Destination id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/destinations/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"destination": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"kind": "kind",
"config": {},
"format": "json",
"trigger": "approved",
"enabled": true
}
}

Update a destination#

Update a destination

PATCH/api/v2/destinations/{id}

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

Path parameters

idstringrequired
Destination id.

Body

application/json
queueIdstring
connectionIdstring | null
namestring
configobject
format"json" | "csv" | "xlsx"
Default"json"
trigger"approved" | "extracted"
Default"approved"
enabledboolean
Defaulttrue

Responses

OK

curl -X PATCH "https://docuflow.pendral.io/api/v2/destinations/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Invoices",
"enabled": true
}'
Response200
{
"destination": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"kind": "kind",
"config": {},
"format": "json",
"trigger": "approved",
"enabled": true
}
}

Delete a destination#

Delete a destination

DELETE/api/v2/destinations/{id}

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

Path parameters

idstringrequired
Destination id.

Responses

OK

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

Preview a Salesforce write#

Builds the record a mapping would write against a real document and checks it against the org's own schema — required fields, picklist values, formula fields, field lengths — and resolves the lookups. Creates nothing.

POST/api/v2/destinations/preview

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

Body

application/json
connectionIdstringrequired
queueIdstringrequired
documentIdstring
Defaults to the most recently processed document in the queue.
targetobjectrequired

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/destinations/preview" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"connectionId": "clx9k2m4p0001qh8z3v7d5f2a",
"queueId": "clx9k2m4p0001qh8z3v7d5f2a",
"target": {
"object": "object"
}
}'
Response200
{
"document": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "invoice-1042.pdf"
},
"object": "object",
"operation": "create",
"record": {},
"key": "invoiceNumber",
"children": [
{
"object": "object",
"parentField": "parentField",
"rows": [
{}
]
}
],
"problems": [
"problem"
],
"warnings": [
"warning"
],
"steps": [
{
"kind": "kind",
"label": "Invoice number",
"ok": true,
"detail": "detail"
}
]
}

Send a test delivery#

Delivers the most recent approved document.

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

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

Path parameters

idstringrequired
Destination id.

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/destinations/{id}/test" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"queued": true,
"document": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "invoice-1042.pdf"
}
}

Delivery history#

Every attempt to send a document to this destination, newest first, successful and failed. Each is the exported / export_failed event on the document's timeline.

GET/api/v2/destinations/{id}/deliveries

Requires destinations:read on the queue it touches.queue-scopedcursor-paginated

Path parameters

idstringrequired
Destination id.

Query parameters

status"delivered" | "failed"
Only successful (delivered) or failed attempts.
documentIdstring
Only attempts for this document.
cursorstring
limitinteger
Default50

Responses

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

curl -X GET "https://docuflow.pendral.io/api/v2/destinations/{id}/deliveries" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"items": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"status": "delivered",
"message": "message",
"detail": {},
"document": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "invoice-1042.pdf",
"status": "received",
"deleted": false
},
"createdAt": "2026-10-01T12:00:00.000Z"
}
],
"nextCursor": "clx9k2m4p0001qh8z3v7d5f2a"
}

Retry a delivery#

Sends that delivery's document to the destination again (with the document's current data). 409 when the document was deleted or the destination is disabled. The outcome lands in the delivery history.

POST/api/v2/destinations/{id}/deliveries/{deliveryId}/retry

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

Path parameters

idstringrequired
Destination id.
deliveryIdstringrequired
Delivery id from the history.

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/destinations/{id}/deliveries/{deliveryId}/retry" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response202
{
"queued": true,
"document": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "invoice-1042.pdf"
}
}