Destinations
Where approved data goes: drive folders, email, or a signed webhook.
List destinations#
List destinations
/api/v2/destinationsRequires 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"
{"destinations": [{"id": "clx9k2m4p0001qh8z3v7d5f2a","queueId": "clx9k2m4p0001qh8z3v7d5f2a","connectionId": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","kind": "kind","config": {},"format": "json","trigger": "approved","enabled": true}]}
Create a destination#
Create a destination
/api/v2/destinationsRequires destinations:manage on the queue it touches.queue-scoped
Body
application/jsonqueueIdstringrequiredconnectionIdstring | nullnamestringrequiredconfigobjectrequiredformat"json" | "csv" | "xlsx"- Default
"json" trigger"approved" | "extracted"- Default
"approved" enabledboolean- Default
true
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}'
{"destination": {"id": "clx9k2m4p0001qh8z3v7d5f2a","queueId": "clx9k2m4p0001qh8z3v7d5f2a","connectionId": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","kind": "kind","config": {},"format": "json","trigger": "approved","enabled": true}}
Get a destination#
Get a destination
/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"
{"destination": {"id": "clx9k2m4p0001qh8z3v7d5f2a","queueId": "clx9k2m4p0001qh8z3v7d5f2a","connectionId": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","kind": "kind","config": {},"format": "json","trigger": "approved","enabled": true}}
Update a destination#
Update a destination
/api/v2/destinations/{id}Requires destinations:manage on the queue it touches.queue-scoped
Path parameters
idstringrequired- Destination id.
Body
application/jsonqueueIdstringconnectionIdstring | nullnamestringconfigobjectformat"json" | "csv" | "xlsx"- Default
"json" trigger"approved" | "extracted"- Default
"approved" enabledboolean- Default
true
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}'
{"destination": {"id": "clx9k2m4p0001qh8z3v7d5f2a","queueId": "clx9k2m4p0001qh8z3v7d5f2a","connectionId": "clx9k2m4p0001qh8z3v7d5f2a","name": "Invoices","kind": "kind","config": {},"format": "json","trigger": "approved","enabled": true}}
Delete a destination#
Delete a destination
/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"
{"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.
/api/v2/destinations/previewRequires destinations:manage on the queue it touches.queue-scoped
Body
application/jsonconnectionIdstringrequiredqueueIdstringrequireddocumentIdstring- 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"}}'
{"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.
/api/v2/destinations/{id}/testRequires 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"
{"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.
/api/v2/destinations/{id}/deliveriesRequires 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.
cursorstringlimitinteger- Default
50
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"
{"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.
/api/v2/destinations/{id}/deliveries/{deliveryId}/retryRequires 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"
{"queued": true,"document": {"id": "clx9k2m4p0001qh8z3v7d5f2a","name": "invoice-1042.pdf"}}