Documents

Solution Template Add

Markdown for LLMs
POST
/documents/solution/{documentSolutionId}/template/{documentTemplateId}/add

Attaches an existing template to a document solution. Both already exist — this only changes the link between them, and attaching does not copy or modify the template.

Unlike supplying ids when creating a solution, which skips anything it cannot find, this operation is strict: if either the solution or the template does not exist on this subscription, the request fails with a 404 and nothing changes. That 404 carries no body, so it does not distinguish a missing solution from a missing template — check both ids.

Authorization

AuthorizationBearer <token>

JWT token to authenticate the request.

In: header

X-Api-Key<token>

API key, sent as a request header.

In: header

Path Parameters

documentSolutionId*string

Id of the document solution, as returned by documents-solution-create in result.data.documentSolution.id.

Formatuuid
documentTemplateId*string

Id of the template, as returned by documents-template-create.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/documents/solution/d290f1ee-6c54-4b01-90e6-d701748f0851/template/2b7c9e14-5a63-4f08-9d21-7c4e0b8a3f52/add"
{  "result": {    "statusCode": 201,    "message": "Created",    "data": {      "documentSolutionId": "d290f1ee-6c54-4b01-90e6-d701748f0851",      "documentTemplateId": "2b7c9e14-5a63-4f08-9d21-7c4e0b8a3f52"    }  },  "origin": "POST https://api.doctavian.com/v1/documents/solution/{documentSolutionId}/template/{documentTemplateId}/add",  "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/{documentSolutionId}/template/{documentTemplateId}/add",  "dateTime": "2026-09-18T12:15:53.000Z",  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "b5e0c31a7d92483fa4c61e08d7b3f925"}
{  "error": {    "statusCode": 404,    "message": "Not Found",    "innerErrors": [      {        "code": "TEMPLATE_SOLUTION_LINK_NOT_FOUND",        "message": "Template solution link not found",        "userMessage": "The specified template is not linked to this solution."      }    ],    "externalErrors": []  },  "origin": "POST https://api.doctavian.com/v1/documents/solution/{documentSolutionId}/template/{documentTemplateId}/add",  "dateTime": "2026-10-09T11:31:58.000Z",  "userId": "f0ec0929-b907-4cc8-add1-21ef6482385b",  "operationId": "a068143357432c5812183d464e45fb74"}
{  "error": {    "statusCode": 500,    "message": "The link could not be changed.",    "innerErrors": [      {        "code": "ADD_TEMPLATE_TO_SOLUTION_ERROR",        "message": "The link could not be changed.",        "userMessage": "Something went wrong. Please try again or contact support."      }    ]  },  "origin": "POST https://api.doctavian.com/v1/documents/solution/{documentSolutionId}/template/{documentTemplateId}/add",  "dateTime": "2026-09-18T12:15:53.000Z",  "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d",  "operationId": "b5e0c31a7d92483fa4c61e08d7b3f925"}