Get list of documents
Updated date: 18/08/2026
Updated by: VNPT eContract's team
Purpose
Function to retrieve the document list of the user or documents shared by other users in the system.
- Request URL:
/api/documents - HTTP method:
GET - Authorize:
Bearer token - Parameter: Not required, but additional options can be added below to filter or search the list of documents.
| Key | Type | Description |
|---|---|---|
status | int | Document status: 1: New document 2: Ready 3: In progress 4: Completed 5: Correcting -4: Expired document -3: Cancelled -2: Deleted -1: Rejected |
contractStatus | int | Contract status: 0: Not specified 1: Active 2: Nearly expired -2: Not yet effective -1: Expired |
documentTemplateId | int | Id of document template |
departmentId | int | Id of department |
documentTypeId | int | Id of document type |
recipientIds | Array[int] | Array of recipient IDs |
createdByUserId | int | Id of creator |
batchImportId | int | Id batch import |
createdFrom | string | Create from date |
createdTo | string | Create to date |
completedFrom | string | Completed from date |
completedTo | string | Completed to date |
customerCode | string | Customer code |
waitToApprove | boolean | Wait to approve |
waitToSignDigital | boolean | Wait to digital sign |
waitToSignDraw | boolean | Wait to sign draw |
contractValueFrom | string | Contract value from |
contractValueTo | string | Contract value to |
search | string | Search information by document code or document name |
page | int | Page number (default is 1) |
pageSize | int | Page size (default is 10 records) |
Sample request
Query param:
page: 1
pageSize:10
search: FA902
Request: /api/documents?page=1&pageSize=10&search=FA902
Sample response body
{
"data": {
"items": [
{
"id": "fa07d61e-0fff-41a3-e618-08dad69d1b1b",
"createdDate": "2022-12-05T15:45:47.8532528",
"lastModifiedDate": "2022-12-05T15:46:07.5741114",
"no": "177667",
"subject": "Create document via API",
"hasVerified": false,
"hasSeal": false,
"requireVerifiedUserSigning": false,
"status": {
"value": 2,
"description": "Ready document"
},
"contractStatus": {
"value": 0,
"description": "Undefined"
},
"description": "Create sample document via API",
"department": {
"id": 33,
"name": "VNPT eContract Center",
"code": "DHB",
},
"createdByUserId": 1163,
"processRecipientCount": 2,
"waitingProcess": {
"id": "cfa4f1cd-7db3-477d-8de7-08dad69d1b3b",
"createdDate": "2022-12-05T15:45:47.8532366",
"comId": 164,
"isOrder": true,
"orderNo": 1,
"pageSign": 1,
"position": "28,672,208,762",
"displayType": {
"value": 0,
"description": "0"
},
"accessPermission": {
"value": 2,
"description": "Sign draw"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 1163,
"documentId": "fa07d61e-0fff-41a3-e618-08dad69d1b1b"
},
"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
},
"documentTemplate": {
"id": 1141,
"name": "Sales discount template",
"createdDate": "2022-11-18T16:07:18.1590328",
"fileName": "DocTemplate.docx",
"downloadUrl": "{HOST}/Api/Download?token=...",
"pdfDownloadUrl":"{HOST}/Api/Download?token...",
},
"batchImport": {
"id": 1232,
"createdDate": "2022-12-05T15:45:44.199619",
"uploadedByUserId": 1163,
"numberOfRecords": 2,
"name": "20221205.A5BO",
},
"processes": [
{
"id": "cfa4f1cd-7db3-477d-8de7-08dad69d1b3b",
"createdDate": "2022-12-05T15:45:47.8532366",
"comId": 164,
"isOrder": true,
"orderNo": 1,
"pageSign": 1,
"position": "28,672,208,762",
"displayType": {
"value": 0,
"description": "0"
},
"accessPermission": {
"value": 2,
"description": "Sign draw"
},
"status": {
"value": 1,
"description": "Waiting"
},
"processedByUserId": 1163,
"documentId": "fa07d61e-0fff-41a3-e618-08dad69d1b1b"
}
],
"histories": [
{
"createdDate": "2022-12-05T15:45:47.8532366",
"requestType": {
"value": 0,
"description": "Web"
},
"ipAddress": "::1",
"user": {
"id": 1163,
"code": "SYSADMIN",
"name": "System admin",
"email": "admin@dochub.vn",
"comId": 164,
"username": "admin@dochub.vn"
},
"activity": {
"value": 1,
"description": "Create document"
}
},
],
"attachments": [],
"relatedDocuments": [],
"messages": [],
"file": {
"name": "FA902.pdf",
"size": 186793
},
"downloadUrl": "{HOST}/Api/Download?token=...",
"isMarkStar": false,
"isLaborContractDocument": false
}
],
"totalCount": 1,
"pageCount": 1,
"page": 1,
"pageSize": 10,
"hasNextPage": false,
"hasPreviousPage": false
},
"success": true,
"code": 0,
"messages": []
}
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 |
data | object | Object containing the list of documents and pagination information (see details below) |
Details of data:
| Key | Type | Description |
|---|---|---|
items | array | List of documents (Array[object]) (see details below) |
totalCount | int | Total number of records found |
pageCount | int | Total number of pages |
page | int | Current page |
pageSize | int | Number of records per page |
hasNextPage | boolean | Whether there is a next page (true: Yes, false: No) |
hasPreviousPage | boolean | Whether there is a previous page (true: Yes, false: No) |
Details of items:
The list contains document objects with the following properties for each element:
| Key | Type | Description |
|---|---|---|
id | string | Document ID (GUID format) |
createdDate | string | Document creation time (ISO 8601 format) |
lastModifiedDate | string | Last modified time (ISO 8601 format) |
no | string | Document code |
subject | string | Document subject |
hasVerified | boolean | Document verification status (true: Verified, false: Not verified) |
hasSeal | boolean | Indicates whether the document will be certified by VNPT SEAL (true: Yes, false: No) |
requireVerifiedUserSigning | boolean | Requires signers to have verified their identity (true: Required, false: Optional) |
status | object | Document status: {"value": int, "description": string}-4: Expired document -3: Canceled document -2: Deleted document -1: Rejected document 1: New document 2: Ready document 3: Processing document 4: Completed document 5: Correcting document 6: InQueue document 7: Auto Sign processing document |
contractStatus | object | Contract validity status: {"value": int, "description": string}0: Undefined 1: Contract Valid 2: Contract almost expired -2: Contract not valid yet -1: Contract expired |
description | string | Detailed description of the document |
department | object | Department information:{"id": int, "name": string, "code": string} |
createdByUserId | int | ID of the user who created the document |
processRecipientCount | int | Total number of participants involved in processing the document |
waitingProcess | object | Detailed information about the pending process (see details below) |
processInOrder | boolean | Sequential processing configuration (true: In order, false: Parallel) |
isWaitToSignDraw | boolean | Whether the document is waiting for a drawn signature (true/false) |
isWaitToSignDigital | boolean | Whether the document is waiting for a digital signature (true/false) |
isWaitToApprove | boolean | Whether the document is waiting for approval (true/false) |
isWaitToFillData | boolean | Whether the document is waiting for data entry (true/false) |
isWaitToCoordinate | boolean | Whether the document is waiting for coordination (true/false) |
isWaitToESign | boolean | Whether the document is waiting for an electronic signature (E-Sign) (true/false) |
isWaitToEkyc | boolean | Whether the document is waiting for eKYC verification signing (true/false) |
isFillable | boolean | Whether data can be entered into the document form (true/false) |
type | object | Document type: {
"id": int,
"code": string,
"name": string,
"description": string,
"documentCount": int
} |
documentTemplate | object | Document template used: {
"id": int,
"name": string,
"createdDate": string,
"fileName": string,
"downloadUrl": string,
"pdfDownloadUrl": string
} |
batchImport | object | Import batch information (if any): {
"id": int,
"createdDate": string,
"uploadedByUserId": int,
"numberOfRecords": int,
"name": string
} |
processes | array | List of processing steps in the workflow (Array[object]) (see details below) |
histories | array | History of actions performed on the document (Array[object]) (see details below) |
attachments | array | List of attachments included with the document (Array[object]) |
relatedDocuments | array | List of related documents (Array[object]) |
messages | array | List of messages/conversations in the document (Array[object]) |
file | object | Original document file information: {"name": string, "size": int} |
downloadUrl | string | URL to download the document file |
isLaborContractDocument | boolean | Indicates whether this is a labor contract document (true: Yes, false: No) |
Details of processes:
The list contains process objects with the following properties for each element:
| Key | Type | Description |
|---|---|---|
id | string | Process ID |
createdDate | string | Process creation time |
comId | int | Processing company/organization ID |
isOrder | boolean | Whether the processing follows an order |
orderNo | int | Processing order in the workflow |
pageSign | int | Page where the signature box is placed |
position | string | Coordinates of the signature box position |
displayType | object | Signature display type: { "value": int, "description": string } |
accessPermission | object | Document processing permission: {"value": int, "description": string}1: View only 2: Sign draw 3: Approve 4: Sign digital 5: Fill data 6: Coordinate 7: E-Sign 8: eKYC sign |
status | object | Process status: { "value": int, "description": string }-1: Rejected 1: Waiting 2: Viewed 3: Signed 4: Approved 5: Filled 7: Coordinated 8: In Queue |
processedByUserId | int | ID of the user performing the processing |
documentId | string | Related document ID |
Details of histories:
| Key | Type | Description |
|---|---|---|
createdDate | string | Time when the action was performed (ISO 8601 format) |
requestType | object | Request source: {"value": int, "description": string} -1: Unspecified 0: Web 1: Api 3: Service 4: Mobile |
ipAddress | string | IP address from which the action was performed |
user | object | Information about the user who performed the action: {
"id": "User ID",
"code": "User code",
"name": "User name",
"email": "User email",
"comId": "Company ID",
"username": "Username"
} |
activity | object | Action performed: {"value": int, "description": string}-3: Cancel document -2: Delete document -1: Reject document 1: Create document 2: Update document 3: Invite recipient 4: View document 5: Sign document 6: Download document |