Skip to main content
Version: 2.3.0

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:
KeyTypeDescription
idint[Required] Id of document template
filefileDocument template file
namestringDocument template name
descriptionstringDocument 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​

KeyTypeDescription
successbooleanResponse status (true: Success, false: Failure)
codeintResponse code from the system
messagesarrayList of messages or errors returned by the system (e.g., ["Update document template success"])
dataobjectObject containing detailed information about the document template after the update (see details below)

Details of data:​

KeyTypeDescription
idintID of the newly created document template
namestringDocument template name
createdDatestringDocument template creation time (ISO 8601 format)
fillableFieldsarrayList of dynamic data fields that can be filled in (Array[object]) (see details below)
fileNamestringName of the original uploaded file
downloadUrlstringURL to download the original template file (.docx)
pdfDownloadUrlstringURL to download the file in PDF format
isDisabledbooleanTemplate status (true: Disabled, false: Active)
isLaborContractTemplatebooleanWhether 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:

KeyTypeDescription
keystringIdentifier key of the data field in the template (e.g., {{day}}, {{month}})
namestringData field name
descriptionstringDetailed description of the meaning of the data field