Data Source Data Load
Markdown for LLMsLoads a data source's data and returns it exactly as document generation would receive it, without generating anything. Use it to check that a data source works, and to see the structure of its data — the objects and field names a document template can refer to — while building a template against it.
The data is read from wherever the data source points: a Storage, OneDrive or GoogleDrive file, or the endpoint a GraphQL data source calls. Files on OneDrive or Google Drive are read through the caller's connected accounts.
Loading leaves a Storage file in place, so a data source can be loaded any number of times before it is used to generate. Generation still uses the file up: once a document has been generated from it, loading the data source returns 404 DATA_SOURCE_DATA_NOT_FOUND until a new file is uploaded and the data source's urn updated.
The data comes back unchanged at result.data.dataSourceData, in Doctavian's data format: a JSON object whose data property holds the records, so the records themselves are at result.data.dataSourceData.data.
Send maxItems to keep only the first maxItems entries of every array in the data, which keeps the response small when only the structure is needed; result.data.truncated is true when that cut at least one array short. Without maxItems, every array comes back in full. For a data source that declares variables, send their values in variables, each matched to its declaration by name. The body is optional: an empty body, or none, loads the data with no variables and no cap.
JWT token to authenticate the request.
In: header
API key, sent as a request header.
In: header
Path Parameters
Id of the data source whose data to load, as returned by documents-data-source-create in result.data.dataSource.id.
uuidRequest Body
application/json
Optional. Values for the data source's declared variables, a cap on array lengths, and an externalContext to echo back. An empty body, or no body at all, is treated as {}; Content-Type: application/json is needed only when a body is sent.
TypeScript Definitions
Use the request body type in TypeScript.
Body for documents-data-source-data-load. Every field is optional, and so is the body itself: an empty body or none is treated as {}.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/documents/datasource/3f2504e0-4f89-41d3-9a0c-0305e82c3301/data/load" \ -H "Content-Type: application/json" \ -d '{ "variables": [ { "name": "customerId", "value": "C-1001" } ], "maxItems": 10, "externalContext": { "id": "789" } }'{ "result": { "statusCode": 200, "message": "OK", "data": { "dataSourceData": { "data": { "Invoice": [ { "InvoiceNumber": "INV-1001", "Total": 1250.5, "Paid": false } ] } }, "truncated": true } }, "origin": "POST https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/data/load", "dateTime": "2026-11-05T09:30:00.000Z", "externalContext": { "id": "789" }, "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d", "operationId": "4d7e2b19c0a64f8e9b3152a6c8f0d417"}{ "error": { "statusCode": 400, "message": "No connected account is available for this data source.", "innerErrors": [ { "code": "CONNECTOR_REQUIRED", "message": "No connected account is available for this data source.", "userMessage": "Connect your Microsoft account, then try again." } ] }, "origin": "POST https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/data/load", "dateTime": "2026-11-05T09:30:00.000Z", "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d", "operationId": "4d7e2b19c0a64f8e9b3152a6c8f0d417"}{ "error": { "statusCode": 401, "message": "The request could not be authenticated.", "innerErrors": [ { "code": "UNAUTHORIZED", "message": "The request could not be authenticated.", "userMessage": "Your session has expired or is invalid. Please sign in again." } ] }, "origin": "POST https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/data/load", "dateTime": "2026-11-05T09:30:00.000Z", "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d", "operationId": "4d7e2b19c0a64f8e9b3152a6c8f0d417"}{ "error": { "statusCode": 404, "message": "The data source data was not found.", "innerErrors": [ { "code": "DATA_SOURCE_DATA_NOT_FOUND", "message": "The data source data was not found.", "userMessage": "This data source's file is no longer available. Upload it again and try again." } ] }, "origin": "POST https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/data/load", "dateTime": "2026-11-05T09:30:00.000Z", "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d", "operationId": "4d7e2b19c0a64f8e9b3152a6c8f0d417"}{ "error": { "statusCode": 500, "message": "The data source data could not be loaded.", "innerErrors": [ { "code": "LOAD_DATA_SOURCE_DATA_ERROR", "message": "The data source data could not be loaded.", "userMessage": "Something went wrong. Please try again or contact support." } ] }, "origin": "POST https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/data/load", "dateTime": "2026-11-05T09:30:00.000Z", "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d", "operationId": "4d7e2b19c0a64f8e9b3152a6c8f0d417"}{ "error": { "statusCode": 502, "message": "The connected service returned an error.", "innerErrors": [ { "code": "CONNECTOR_PROVIDER_ERROR", "message": "The connected service returned an error.", "userMessage": "The connected service could not be reached. Please try again later." } ] }, "origin": "POST https://api.doctavian.com/v1/documents/datasource/{dataSourceId}/data/load", "dateTime": "2026-11-05T09:30:00.000Z", "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d", "operationId": "4d7e2b19c0a64f8e9b3152a6c8f0d417"}