Documents

Document Solution Create

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.

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 DocumentSolutionModel payload to create. Server-managed fields (ids, timestamps, links, isDeleted) are ignored.

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

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"        }      ]    },    "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."          }        ],        "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": "DATA_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": 403,    "message": "The caller is not authorized to perform this operation.",    "innerErrors": [      {        "code": "AUTHORIZATION_ERROR",        "message": "The caller is not authorized to perform this operation.",        "userMessage": "You do not have permission to do this. Contact your administrator."      }    ]  },  "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"}