Update document template
Updated date: 18/08/2026
Updated by: VNPT eContract's team
Purpose
The function updates the information of a previously created document template.
- Request URL:
/api/document-templates/update - HTTP method:
POST - HTTP content-type:
multipart/form-data - Authorize:
Bearer token - Parameter:
| Key | Type | Description |
|---|---|---|
id | int | [Required] Id of document template |
file | file | Document template file |
name | string | Document template name |
description | string | Document template description |
Sample response body
{
"data": {
"id": 1149,
"name": "FILE MẪU IMPORT LÔ TEST ",
"createdDate": "2022-11-22T14:18:25.3990136",
"fillableFields": [
{
"key": "{{day}}",
"name": "day",
"description": "Day"
},
{
"key": "{{month}}",
"name": "month"
},
{
"key": "{{year}}",
"name": "year"
}
],
"fileName": "HĐ Dịch vụ Cấp nước Test Dochub.docx",
"downloadUrl": "{HOST}/Api/Download?token=...",
"pdfDownloadUrl": "{HOST}/Api/Download?token=...",
"isDisabled": false,
"isLaborContractTemplate": false
},
"success": true,
"code": 0,
"messages": [
"Update document template success"
]
}
Response Body Description
| Key | Type | Description |
|---|---|---|
success | boolean | Response status (true: Success, false: Failure) |
code | int | Response code from the system |
messages | array | List of messages or errors returned by the system (e.g., ["Update document template success"]) |
data | object | Object containing detailed information about the document template after the update (see details below) |
Details of data:
| Key | Type | Description |
|---|---|---|
id | int | ID of the newly created document template |
name | string | Document template name |
createdDate | string | Document template creation time (ISO 8601 format) |
fillableFields | array | List of dynamic data fields that can be filled in (Array[object]) (see details below) |
fileName | string | Name of the original uploaded file |
downloadUrl | string | URL to download the original template file (.docx) |
pdfDownloadUrl | string | URL to download the file in PDF format |
isDisabled | boolean | Template status (true: Disabled, false: Active) |
isLaborContractTemplate | boolean | Whether this is a labor contract template (true: Yes, false: No) |
Details of fillableFields:
The list contains the dynamic data fields in the document template, with the following properties for each element:
| Key | Type | Description |
|---|---|---|
key | string | Identifier key of the data field in the template (e.g., {{day}}, {{month}}) |
name | string | Data field name |
description | string | Detailed description of the meaning of the data field |