Skip to main content
Version: 2.3.0

Create document

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


Purpose​

The function performs the creation of new document information.

  • Request URL: /api/documents/create
  • HTTP method: POST
  • HTTP content-type: multipart/form-data
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
nostring[Required] No of document
subjectstring[Required] subject of document
filefile[Required] File of document (docx, PDF format)
descriptionstringDescription
typeIdint[Required] Id of document type
documentTemplateIdintId of document template
departmentIdint[Required] Id of department
customerCodestringCustomer code
customerInformationstringCustomer information
relatedDocumentIdsArray[string]Array of related document Ids
attachmentsArray[file]Array of attached files
expiryDatestringDocument processing expiration date

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",
"expiryDate": "2022-12-08T12:00: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": 1,
"waitingProcesses": [],
"processInOrder": true,
"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=...",
"fillingItems": [
{
"key": "{{name}}",
"displayName": "{{name}}",
"positions": []
},
{
"key": "{{gender}}",
"displayName": "{{gender}}",
"positions": []
}
],
"sharedUsers": [],
"isMarkStar": false,
"requiresSealSendConfirmation": false,
"fixedPosition": false,
"isLaborContractDocument": false
},
"success": true,
"code": 0,
"messages": [
"Create document 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., ["Create 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