Reference data

Data sets used by lookups, dataset-match rules and enrichment.

Document enrichments#

Fields of the latest run filled from a data set, with the matched row.

GET/api/v2/documents/{id}/enrichments

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

Path parameters

idstringrequired
Document id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/documents/{id}/enrichments" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"enrichments": [
{
"path": "invoiceTotal",
"dataSetId": "clx9k2m4p0001qh8z3v7d5f2a",
"dataSetName": "dataSetName",
"keyPath": "keyPath",
"key": "invoiceNumber",
"column": "column",
"matchMode": "matchMode",
"score": 1,
"row": {}
}
]
}

List data sets#

List data sets

GET/api/v2/datasets

Requires datasets:read.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/datasets" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"dataSets": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"keyColumn": "keyColumn",
"columns": [
{
"name": "Invoices",
"type": "type"
}
],
"rowCount": 1,
"version": 1,
"sourceKind": "sourceKind",
"source": {},
"syncSchedule": "syncSchedule",
"lastSyncedAt": "2026-10-01T12:00:00.000Z",
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z"
}
]
}

Create a data set#

From a staged upload (uploadId, see POST /datasets/uploads), a SharePoint/OneDrive workbook (connectionId + itemId, imported in the worker), or a live source (source: an HTTP API, a read-only SQL query against PostgreSQL / SQL Server / MySQL, or a Salesforce object), read in full now and then on schedule.

POST/api/v2/datasets

Requires datasets:manage.

Body

application/json
namestring
slugstring
descriptionstring | null
uploadIdstring
fileNamestring
sheetstring | null
keyColumnstring
connectionIdstring
driveIdstring
itemIdstring
schedule"off" | "hourly" | "daily" | "weekly"
Default"daily"
sourceobject

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/datasets" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"uploadId": "clx9k2m4p0001qh8z3v7d5f2a",
"fileName": "fileName",
"keyColumn": "keyColumn"
}'
Response201
{
"dataSet": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"keyColumn": "keyColumn",
"columns": [
{
"name": "Invoices",
"type": "type"
}
],
"rowCount": 1,
"version": 1,
"sourceKind": "sourceKind",
"source": {},
"syncSchedule": "syncSchedule",
"lastSyncedAt": "2026-10-01T12:00:00.000Z",
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z"
},
"queued": false
}

Stage and preview a CSV/XLSX#

multipart file (+ sheet) stages a file and returns a typed preview (201). JSON { uploadId, fileName, sheet } re-previews another sheet (200).

POST/api/v2/datasets/uploads

Requires datasets:manage.

Body

application/json
uploadIdstringrequired
fileNamestringrequired
sheetstring | null

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/datasets/uploads" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"uploadId": "clx9k2m4p0001qh8z3v7d5f2a",
"fileName": "fileName"
}'
Response201
{
"uploadId": "clx9k2m4p0001qh8z3v7d5f2a",
"fileName": "fileName",
"columns": [
null
],
"rowCount": 1,
"sample": [
null
],
"sheets": [
"sheet"
],
"sheet": "sheet",
"suggestedKey": "suggestedKey",
"duplicateKeys": 1
}

Preview a live source#

Reads the first 200 rows of an API, database query or Salesforce object without saving anything: typed columns, a sample and a suggested key column. Pass dataSetId when editing a set so its stored secrets stand in for masked ones.

POST/api/v2/datasets/sources/preview

Requires datasets:manage.

Body

application/json
sourceobjectrequired
dataSetIdstring

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/datasets/sources/preview" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": {
"kind": "api",
"url": "https://hooks.example.com/docuflow",
"method": "GET",
"body": "Please confirm the PO number with the supplier."
}
}'
Response200
{
"columns": [
{
"name": "Invoices",
"type": "type"
}
],
"rowCount": 1,
"truncated": false,
"suggestedKey": "suggestedKey"
}

Get a data set#

Get a data set

GET/api/v2/datasets/{id}

Requires datasets:read.

Path parameters

idstringrequired
Data set id.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/datasets/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"dataSet": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"keyColumn": "keyColumn",
"columns": [
{
"name": "Invoices",
"type": "type"
}
],
"rowCount": 1,
"version": 1,
"sourceKind": "sourceKind",
"source": {},
"syncSchedule": "syncSchedule",
"lastSyncedAt": "2026-10-01T12:00:00.000Z",
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z",
"versions": [
1
]
}
}

Update a data set#

Rename, change the key column, or configure drive sync.

PATCH/api/v2/datasets/{id}

Requires datasets:manage.

Path parameters

idstringrequired
Data set id.

Body

application/json
namestring
descriptionstring | null
keyColumnstring
syncobject | null
remoteobject

Responses

OK

curl -X PATCH "https://docuflow.pendral.io/api/v2/datasets/{id}" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Invoices",
"description": "Supplier invoices from the accounts payable mailbox."
}'
Response200
{
"dataSet": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"keyColumn": "keyColumn",
"columns": [
{
"name": "Invoices",
"type": "type"
}
],
"rowCount": 1,
"version": 1,
"sourceKind": "sourceKind",
"source": {},
"syncSchedule": "syncSchedule",
"lastSyncedAt": "2026-10-01T12:00:00.000Z",
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z"
}
}

Delete a data set#

Delete a data set

DELETE/api/v2/datasets/{id}

Requires datasets:manage.

Path parameters

idstringrequired
Data set id.

Responses

OK

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

Browse rows#

Browse rows

GET/api/v2/datasets/{id}/rows

Requires datasets:read.cursor-paginated

Path parameters

idstringrequired
Data set id.

Query parameters

qstring
cursorstring
limitnumber

Responses

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

curl -X GET "https://docuflow.pendral.io/api/v2/datasets/{id}/rows" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"items": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a"
}
],
"nextCursor": "clx9k2m4p0001qh8z3v7d5f2a"
}

Version history#

Every import, append and sync, newest first, with how many rows each added and the total afterwards. A version records the change; rows are not kept per version.

GET/api/v2/datasets/{id}/versions

Requires datasets:read.cursor-paginated

Path parameters

idstringrequired
Data set id or slug.

Query parameters

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/datasets/{id}/versions" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"items": [
{
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"version": 1,
"mode": "replace",
"rowCount": 1,
"totalRows": 1,
"fileName": "fileName",
"createdAt": "2026-10-01T12:00:00.000Z",
"createdBy": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Ada Lovelace",
"email": "ada@example.com",
"image": null
}
}
],
"nextCursor": "clx9k2m4p0001qh8z3v7d5f2a"
}

Import a new version#

Replace or append rows from a staged upload. Large files import in the worker.

POST/api/v2/datasets/{id}/versions

Requires datasets:manage.

Path parameters

idstringrequired
Data set id.

Body

application/json
uploadIdstringrequired
fileNamestringrequired
sheetstring | null
mode"replace" | "append"required
keyColumnstring

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/datasets/{id}/versions" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"uploadId": "clx9k2m4p0001qh8z3v7d5f2a",
"fileName": "fileName",
"mode": "replace"
}'
Response201
{
"dataSet": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"name": "Invoices",
"slug": "invoices",
"description": "Supplier invoices from the accounts payable mailbox.",
"keyColumn": "keyColumn",
"columns": [
{
"name": "Invoices",
"type": "type"
}
],
"rowCount": 1,
"version": 1,
"sourceKind": "sourceKind",
"source": {},
"syncSchedule": "syncSchedule",
"lastSyncedAt": "2026-10-01T12:00:00.000Z",
"createdAt": "2026-10-01T12:00:00.000Z",
"updatedAt": "2026-10-01T12:00:00.000Z"
},
"queued": false
}

Sync now#

Re-read a synced set from its workbook, API, database or Salesforce object.

POST/api/v2/datasets/{id}/sync

Requires datasets:manage.

Path parameters

idstringrequired
Data set id.

Responses

OK

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

Test a key match#

Try a value against the key column: the matching row or the closest suggestion.

POST/api/v2/datasets/{id}/match

Requires datasets:read.

Path parameters

idstringrequired
Data set id.

Body

application/json
valuestringrequired
mode"exact" | "normalized" | "fuzzy"
Default"normalized"
thresholdnumber

Responses

OK

curl -X POST "https://docuflow.pendral.io/api/v2/datasets/{id}/match" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "1240.00",
"threshold": 0.9
}'
Response200
{
"match": null
}

Look up a row by key#

The row a key resolves to, the way a lookup() rule reads it: an exact key first, then ignoring case, spaces and punctuation. 404 when nothing matches; for fuzzy matching use POST …/match.

GET/api/v2/datasets/{id}/lookup

Requires datasets:read.

Path parameters

idstringrequired
Data set id or slug.

Query parameters

keystringrequired
The key-column value to look up: matched exactly, then ignoring case, spaces and punctuation — the same way a lookup() rule reads it.

Responses

OK

curl -X GET "https://docuflow.pendral.io/api/v2/datasets/{id}/lookup?key=key" \
-H "Authorization: Bearer $DOCUFLOW_API_KEY"
Response200
{
"row": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"key": "invoiceNumber",
"matched": "exact",
"data": {},
"dataSet": {
"id": "clx9k2m4p0001qh8z3v7d5f2a",
"slug": "invoices",
"version": 1
}
}
}