# DocumentTemplate

## Performs the Get operation.

> Use this endpoint to execute the get workflow in DocumentTemplateController.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"DocumentTemplate"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"DocumentTemplateType2":{"type":"integer"}}},"paths":{"/v1/DocumentTemplate/Get/{companyId}/{type}":{"get":{"tags":["DocumentTemplate"],"summary":"Performs the Get operation.","description":"Use this endpoint to execute the get workflow in DocumentTemplateController.","parameters":[{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DocumentTemplateType2"}},{"name":"getAll","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Create document template.

> Use this endpoint to create document template.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"DocumentTemplate"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CreateDocumentTemplateViewModel":{"required":["name","documentTemplateType"],"type":"object","properties":{"name":{"type":"string","description":"Gets or sets the template name shown in the UI."},"description":{"type":"string","description":"Gets or sets the optional template description.","nullable":true},"mediaId":{"type":"string","description":"Gets or sets the media identifier of the uploaded template document.","format":"uuid"},"documentTemplateType":{"$ref":"#/components/schemas/DocumentTemplateType"}},"description":"Represents the payload for creating a new document template."},"DocumentTemplateType":{"type":"integer","description":"Gets or sets the template category."}}},"paths":{"/v1/DocumentTemplate/Create/{companyId}":{"post":{"tags":["DocumentTemplate"],"summary":"Create document template.","description":"Use this endpoint to create document template.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocumentTemplateViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateDocumentTemplateViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateDocumentTemplateViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Update document template.

> Use this endpoint to update document template.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"DocumentTemplate"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UpdateDocumentTemplateViewModel":{"required":["name","mediaId"],"type":"object","properties":{"name":{"type":"string","description":"Gets or sets the updated template name."},"description":{"type":"string","description":"Gets or sets the updated optional template description.","nullable":true},"mediaId":{"type":"string","description":"Gets or sets the replacement media identifier for the template file.","format":"uuid"},"active":{"type":"boolean","description":"Gets or sets whether the template remains active."}},"description":"Represents the payload for updating an existing document template."}}},"paths":{"/v1/DocumentTemplate/Update/{documentTemplateId}":{"put":{"tags":["DocumentTemplate"],"summary":"Update document template.","description":"Use this endpoint to update document template.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"documentTemplateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentTemplateViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentTemplateViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentTemplateViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Delete document template.

> Use this endpoint to delete document template.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"DocumentTemplate"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/DocumentTemplate/Delete/{documentTemplateId}":{"delete":{"tags":["DocumentTemplate"],"summary":"Delete document template.","description":"Use this endpoint to delete document template.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"documentTemplateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Updates team access for a document template.

> Replaces the template's current team assignments with the provided team list. Only authorized company users can change template sharing.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"DocumentTemplate"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UpdateTeamAppViewModel":{"required":["teamIds"],"type":"object","properties":{"teamIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Team identifiers that should be linked to the app user."}},"description":"Represents team assignments for an app user."}}},"paths":{"/v1/DocumentTemplate/EditTeams/{documentTemplateId}":{"post":{"tags":["DocumentTemplate"],"summary":"Updates team access for a document template.","description":"Replaces the template's current team assignments with the provided team list. Only authorized company users can change template sharing.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"documentTemplateId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamAppViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamAppViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateTeamAppViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.safegpt.nl/api-en/endpoints/documenttemplate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
