Documents

Solution Create

Markdown for LLMs
POST
/documents/solution/create

Creates a document solution: the pairing of templates, data sources and output configurations that document generation runs against. A solution is the unit a generate request names, so this is the object everything else in the Documents API hangs off.

Only name is mandatory. Templates, data sources, configurations and full configuration definitions can all be supplied here to build the solution in one call, or attached afterwards. Linking by id is best-effort: an entry that cannot be found is skipped rather than failing the request, so compare the returned lists with what you sent. configurations attaches only configurations that do not already belong to a live solution. configurationDetails is the exception to best-effort: every entry is validated first, and one invalid entry fails the whole request with a 400.

Identifiers, ownership, folder, usage counts and timestamps are all server-assigned and returned in the response; sending them has no effect.

Authorization

AuthorizationBearer <token>

JWT token to authenticate the request.

In: header

X-Api-Key<token>

API key, sent as a request header.

In: header

Request Body

application/json

The document solution to create, as a DocumentSolutionCreateInput. Identifiers, ownership, folder, usage counts and timestamps are server-assigned and ignored if sent.

TypeScript Definitions

Use the request body type in TypeScript.

Body for creating a document solution, following the standard request envelope: the resource under its own name alongside an optional externalContext.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/documents/solution/create" \  -H "Content-Type: application/json" \  -d '{    "documentSolution": {      "name": "Quarterly Invoicing",      "description": "Invoice run for quarterly billing.",      "templates": [        {          "id": "2b7c9e14-5a63-4f08-9d21-7c4e0b8a3f52"        }      ],      "dataSources": [        {          "id": "3f2504e0-4f89-41d3-9a0c-0305e82c3301"        }      ],      "configurationDetails": [        {          "name": "Invoice - PDF to Storage",          "description": "Quarterly invoice rendered as PDF and written to Storage.",          "title": "Invoice",          "fileFormat": "pdf",          "deliveryMethod": "Storage",          "path": "root",          "language": "en",          "locale": "en_IE_EURO",          "timeZone": "(GMT+00:00) Greenwich Mean Time (Europe/Dublin)",          "isDefault": true,          "embeddedData": "{\\"costCentre\\":\\"CC-4410\\"}",          "optionValues": {            "fd4d6425-a871-4bcd-8f16-a088146bd924": "PdfA2b",            "8d254f60-aa38-4509-87de-74fa14702764": "750"          }        }      ]    },    "externalContext": {      "id": "789"    }  }'
{  "result": {    "statusCode": 201,    "message": "Created",    "data": {      "documentSolution": {        "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",        "subscriptionId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",        "ownerId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",        "lastModifiedUserId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",        "name": "Quarterly Invoicing",        "description": "Invoice run for quarterly billing.",        "templates": [          {            "id": "2b7c9e14-5a63-4f08-9d21-7c4e0b8a3f52",            "name": "Standard Invoice",            "description": "Company standard invoice layout.",            "fileFormat": "docx"          }        ],        "dataSources": [          {            "id": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",            "name": "Q3 Sales Report Data",            "description": "Account records used for quarterly reports."          }        ],        "configurationDetails": [          {            "id": "7f1b2c3d-4e5f-4a6b-9c8d-0e1f2a3b4c5d",            "documentSolutionId": "d290f1ee-6c54-4b01-90e6-d701748f0851",            "subscriptionId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",            "ownerId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",            "lastModifiedUserId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",            "name": "Invoice - PDF to Storage",            "description": "Quarterly invoice rendered as PDF and written to Storage.",            "title": "Invoice",            "fileFormat": "pdf",            "deliveryMethod": "Storage",            "path": "root",            "language": "en",            "locale": "en_IE_EURO",            "timeZone": "(GMT+00:00) Greenwich Mean Time (Europe/Dublin)",            "isDefault": true,            "embeddedData": "{\"costCentre\":\"CC-4410\"}",            "optionValues": {              "fd4d6425-a871-4bcd-8f16-a088146bd924": "PdfA2b",              "8d254f60-aa38-4509-87de-74fa14702764": "750"            },            "createdDate": "2026-09-28T09:14:22.000Z",            "lastModifiedDate": "2026-09-28T09:14:22.000Z"          }        ],        "ownerName": "Jane Doe",        "lastModifiedUserName": "Jane Doe",        "generatedDocumentCount": 0,        "lastRequests": [],        "createdDate": "2026-09-18T12:15:53.000Z",        "lastModifiedDate": "2026-09-18T12:15:53.000Z",        "lastRequestDate": ""      }    }  },  "origin": "POST https://api.doctavian.com/v1/documents/solution/create",  "dateTime": "2026-09-18T12:15:53.000Z",  "externalContext": {    "id": "789"  },  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "b5e0c31a7d92483fa4c61e08d7b3f925"}
{  "error": {    "statusCode": 400,    "message": "Name is required.",    "innerErrors": [      {        "code": "DOCUMENT_SOLUTION_NAME_REQUIRED",        "message": "Name is required.",        "userMessage": "Give the solution a name before saving it."      }    ]  },  "origin": "POST https://api.doctavian.com/v1/documents/solution/create",  "dateTime": "2026-09-18T12:15:53.000Z",  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "b5e0c31a7d92483fa4c61e08d7b3f925"}
{  "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/solution/create",  "dateTime": "2026-09-18T12:15:53.000Z",  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "b5e0c31a7d92483fa4c61e08d7b3f925"}
{  "error": {    "statusCode": 500,    "message": "The document solution could not be created.",    "innerErrors": [      {        "code": "CREATE_DOCUMENT_SOLUTION_ERROR",        "message": "The document solution could not be created.",        "userMessage": "Something went wrong. Please try again or contact support."      }    ]  },  "origin": "POST https://api.doctavian.com/v1/documents/solution/create",  "dateTime": "2026-09-18T12:15:53.000Z",  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "b5e0c31a7d92483fa4c61e08d7b3f925"}