Data sources
A data source reads a spreadsheet or JSON file from a connected drive into a form or a PDF template. The definition of a source is part of the form or template, so you set it with Update a form (schema.dataSources) or Update a template (dataSources), as the data source object below. The operations here tell you how the sources are doing, refresh them, and show what a file holds before you commit to it.
Headers on every call: X-Api-Key, X-Api-Secret.
The data source object
Section titled “The data source object”A form keeps its sources in schema.dataSources, and a PDF template in dataSources; a Word or SVG template has none and ignores them. Each is a list of up to 5 sources, the whole list at once: a source left out is removed with what it read, and one with a new id is added.
| Field | Type | Required | Rules |
|---|---|---|---|
id |
string | Yes | Letters, digits, _ and -, up to 64 characters, unique in the form or template. |
name |
string | Yes | Up to 120 characters. |
file |
object | No | integrationId (the drive), fileId and path. Without it the source reads nothing until a file is chosen. |
format |
string | No | auto (default), native (a Google Sheet), xlsx, xls, csv, ods or json. |
sheet |
string | No | A sheet of a spreadsheet. |
headerRow |
integer | No | 0 to 1000, default 1. |
columns |
array | No | Up to 50 column names to keep; all of them when empty. |
filters |
array | No | Rows to keep, each {column, operator, value}. column is required; operator is equals (default), not_equals, contains, not_contains, starts_with, ends_with, is_empty, is_not_empty, gt, gte, lt or lte. |
filtersMatch |
string | No | all (default): a row must match every filter; any: one is enough. |
limit |
integer | No | 1 to 5,000 rows, default 5,000. |
jsonPointer |
string | No | For JSON, where the rows are, such as /slots. |
refreshMinutes |
integer | No | 1, 5, 15 (default), 60 or 1440. |
variables |
array | Yes | 1 to 10 variables, see below. A variable’s name is unique across all the sources of the form or template. |
A variable:
| Field | Type | Required | Rules |
|---|---|---|---|
name |
string | Yes | A letter, then letters, digits and _, up to 64 characters. Read as _data.name. |
shape |
string | No | What it holds, as the shapes in the app: rows (default), column, first_row, cell or value (the JSON at the pointer, for the json format only). |
column |
string | With column and cell |
The column it reads. |
sendWithSubmission |
boolean | No | Keeps the value with each submission, under _data. false by default. |
Choosing a file the source didn’t have before also takes Browse cloud files (get_cloud_files) or Download cloud files (download_cloud_file) on the key, and a source the organization didn’t have before counts towards your plan’s limit of data sources. A drive that isn’t your organization’s answers 422.
{ "id": "6f0812aa-3649-4bfb-b9bc-35cb549be1ad", "name": "Price list", "file": { "integrationId": "01a1ab0c-4436-705d-84fa-23b997395c43", "fileId": "gd7FX", "path": "Sales/Price list.csv" }, "format": "csv", "sheet": "", "headerRow": 1, "columns": [], "filters": [ { "column": "Unit", "operator": "equals", "value": "per group" }, { "column": "Price EUR net", "operator": "gt", "value": "0" } ], "filtersMatch": "all", "limit": 5000, "jsonPointer": "", "refreshMinutes": 15, "variables": [ { "name": "prices", "shape": "rows", "column": "", "sendWithSubmission": true } ]}Status of the data sources
Section titled “Status of the data sources”GET/v1/forms/{id}/data_sources
GET/v1/templates/{id}/data_sources
Key permission: update_form for a form, update_template for a template.
Returns 200 OK with a list, one entry per source:
| Field | Type | Meaning |
|---|---|---|
sourceId |
string | The source’s id within the form or template. |
status |
string | fresh, failed, file_missing or reconnect_required. |
statusReason |
string or null | What went wrong, when something did. |
refreshing |
boolean | Whether a refresh is under way. |
refreshedAt |
time or null | When the data was last read. |
pictures |
object or null | A form’s source with a picture column only: prepared and total of the pictures being fetched now (both 0 when nothing is), and failed, those that cannot be shown. |
pictureAddresses |
object or null | A form’s source with a picture column only: for each picture Doxtly shows a copy of, the cell naming it as the sheet has it, and the address the copy is shown from. The address is signed and works for about two hours. |
values |
object or null | A form’s source only: what its last read stored, by variable, the same values the form’s public page is given (a picture cell as the sheet names it). Null until the first read. |
curl 'https://api.doxtly.com/v1/templates/01a1ce09-11e3-7abe-88d7-578b8adcf08d/data_sources' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"[ { "sourceId": "6f0812aa-3649-4bfb-b9bc-35cb549be1ad", "status": "fresh", "statusReason": null, "refreshing": false, "refreshedAt": "2026-11-12T08:19:09+01:00" }]reconnect_required means the drive’s connection needs renewing: see Cloud files.
Refresh a data source
Section titled “Refresh a data source”POST/v1/forms/{id}/data_sources/{sourceId}/refresh
POST/v1/templates/{id}/data_sources/{sourceId}/refresh
Key permission: update_form for a form, update_template for a template.
Asks for the file to be read again and returns 200 OK with that source’s status, as above. A source that doesn’t exist answers 404.
curl -X POST 'https://api.doxtly.com/v1/templates/01a1ce09-11e3-7abe-88d7-578b8adcf08d/data_sources/6f0812aa-3649-4bfb-b9bc-35cb549be1ad/refresh' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET"{ "sourceId": "6f0812aa-3649-4bfb-b9bc-35cb549be1ad", "status": "fresh", "statusReason": null, "refreshing": true, "refreshedAt": "2026-11-12T08:11:00+01:00"}Preview a data source
Section titled “Preview a data source”POST/v1/data_sources/preview
Key permission: get_cloud_files
Shows what a definition would read, without saving anything: the first 20 rows and the column names.
| Field | Type | Required | Rules |
|---|---|---|---|
source.id |
string | Yes | Letters, digits, _ and -, up to 64 characters. |
source.name |
string | Yes | Up to 120 characters. |
source.file |
object | Yes | integrationId (the drive), fileId and path. |
source.format |
string | No | auto (default), native, xlsx, xls, csv, ods or json. |
source.sheet |
string | No | A sheet of a spreadsheet. |
source.headerRow |
integer | No | 0 to 1000, default 1. |
source.columns |
array | No | Up to 50 columns to read. |
source.filters |
array | No | Row filters, as in the data source object. |
source.filtersMatch |
string | No | all (default) or any. |
source.limit |
integer | No | 1 to 5000 rows. |
source.jsonPointer |
string | No | For JSON, where the rows are, such as /slots. |
source.refreshMinutes |
integer | No | 1, 5, 15 (default), 60 or 1440. |
source.variables |
array | Yes | 1 to 10 variables, as in the data source object. |
Returns 200 OK with columns and rows. Without a file the call answers 422.
curl -X POST 'https://api.doxtly.com/v1/data_sources/preview' \ -H "X-Api-Key: $DOXTLY_API_KEY" -H "X-Api-Secret: $DOXTLY_API_SECRET" \ -H 'Content-Type: application/json' \ -d '{"source":{"id":"price-list","name":"Price list","file":{"integrationId":"01a1ab0c-4436-705d-84fa-23b997395c43","fileId":"gd7FX","path":"Sales/Price list.csv"},"format":"csv","variables":[{"name":"services","shape":"rows"}]}}'{ "columns": [ "Code", "Service", "Unit", "Price EUR net", "Notes" ], "rows": [ { "Code": "TR-NEG", "Service": "Negotiation Essentials workshop (1 day)", "Unit": "per group", "Price EUR net": "2400", "Notes": "Up to 12 people. Workbook and certificates included." }, { "Code": "TR-PRES", "Service": "Presenting with Confidence workshop (1 day)", "Unit": "per group", "Price EUR net": "2100", "Notes": "Up to 12 people. Workbook and certificates included." }, { "Code": "TR-MGR", "Service": "New Manager Programme (2 days)", "Unit": "per group", "Price EUR net": "4200", "Notes": "Up to 12 people. Workbook and certificates included." }, { "Code": "TR-ONL", "Service": "Same workshop delivered online", "Unit": "per group", "Price EUR net": "-300", "Notes": "Taken off the workshop price. Up to 12 people." }, { "Code": "TR-XTRA", "Service": "Extra participant above 12", "Unit": "per person", "Price EUR net": "160", "Notes": "At most 15 people in a group." } ]}Shortened: the preview shows 5 of the rows.