List Documents API
Overview
Retrieves a paginated list of uploaded document metadata with filters.
- Endpoint:
/api/documents/list - Method:
POSTorGET
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
page | Number | No | Page number (Default: 1) |
limit | Number | No | Items per page (Default: 10) |
companyId | UUID String | No | Filter by company ID |
uploadById | UUID String | No | Filter by uploader user ID |
active | Boolean | No | Filter by active status (Default: true) |
search | String | No | Search query matching document name |
Request Body Example
{
"page": 1,
"limit": 10,
"active": true
}
Response Example (200 OK)
{
"success": true,
"data": [
{
"id": "d1234567-89ab-cdef-0123-456789abcdef",
"name": "Company Registration Certificate.pdf",
"path": "documents/companies/c1234567/2026-09-07/uuid_cert.pdf",
"mimeType": "application/pdf",
"size": 1048576,
"companyId": "c1234567-89ab-cdef-0123-456789abcdef",
"active": true,
"createdAt": "2026-09-07T16:30:00.000Z",
"url": "http://localhost:4000/media/documents/companies/c1234567/2026-09-07/uuid_cert.pdf"
}
],
"pagination": {
"total": 1,
"page": 1,
"limit": 10,
"totalPages": 1
},
"message": "Documents retrieved successfully"
}