Skip to main content
Version: 2.3.0

Update document

Updated date: 18/08/2026
Updated by: VNPT eContract's team


Purpose​

The function updates the information of documents in the newly initialized state.

  • Request URL: /api/documents/update
  • HTTP method: POST
  • HTTP content-type: multipart/form-data
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
idstring[Required] Id of document
nostringNo of document
subjectstringSubject of document
filefileDocument file (docx, PDF format)
descriptionstringDescription
typeIdintId of document type
documentTemplateIdintId of document template
departmentIdintId of department
customerCodestringCustomer code
customerInformationstringCustomer information
relatedDocumentIdsArray[string]Array of related document Ids
attachmentsArray[file]Array of attached files

Sample response body​

{
"data": {
"id": "67f7f485-3c65-4e5a-a8fd-08dad7588424",
"createdDate": "2022-12-06T14:07:19.7166444+07:00",
"lastModifiedDate": "2022-12-06T14:07:19.7168438+07:00",
"no": "177667",
"subject": "Create document via API",
"hasVerified": false,
"hasSeal": false,
"requireVerifiedUserSigning": false,
"status": {
"value": 1,
"description": "New document"
},
"contractStatus": {
"value": 0,
"description": "Undefined"
},
"description": "Create sample document via API",
"createdByUserId": 2341,
"processRecipientCount": 0,
"processInOrder": false,
"isWaitToSignDraw": false,
"isWaitToSignDigital": false,
"isWaitToApprove": false,
"isWaitToFillData": false,
"isWaitToCoordinate": false,
"isWaitToESign": false,
"isWaitToEkyc": false,
"isFillable": false,
"type": {
"id": 46,
"code": "CKDS",
"name": "Sales discount",
"description": "Sales discount documents",
"documentCount": 1
},
"processes": [],
"histories": [
{
"createdDate": "2022-12-06T14:07:20.0170103+07:00",
"requestType": {
"value": 0,
"description": "Web"
},
"ipAddress": "10.70.39.66",
"activity": {
"value": 1,
"description": "Create document"
}
}
],
"attachments": [],
"relatedDocuments": [],
"messages": [],
"file": {
"name": "Document.pdf",
"size": 1194181
},
"downloadUrl": "{HOST}/Api/Download?token=..."
},
"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 success"])
dataobjectObject containing detailed information about the successfully created document (see details)

Common Errors​

MessageDescription
Document type not foundThe document type ID does not exist
Invalid file format. Only PDF and DOCX formats are supportedInvalid file format (only PDF or DOCX)
Existed document noThe document code already exists