Get User Projects API¶
Retrieves all projects owned by the authenticated user.
Endpoint¶
GET /api/documents/getUserProjects
Request¶
Query Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | number | No | Page number for pagination (default: 1) |
| limit | number | No | Number of projects per page (default: 20) |
| sort | string | No | Sort field (name, date, documentCount) |
| order | string | No | Sort order (asc, desc) |
| search | string | No | Search term for project names |
Example Request¶
Response¶
Success Response¶
{
"success": true,
"projects": [
{
"id": "proj_789",
"name": "Q4 Tenders",
"description": "All tender documents for Q4 2023",
"createdAt": "2023-10-01T12:00:00Z",
"lastModified": "2023-10-05T08:15:00Z",
"documentCount": 15,
"totalSize": 52428800,
"status": {
"processed": 12,
"processing": 2,
"failed": 1
}
}
],
"pagination": {
"currentPage": 1,
"totalPages": 3,
"totalProjects": 45,
"hasMore": true
},
"stats": {
"totalProjects": 45,
"totalDocuments": 450,
"totalSize": 4294967296
}
}
Error Response¶
Error Codes¶
| Code | Description |
|---|---|
| UNAUTHORIZED | User not authorized |
| INVALID_PAGINATION | Invalid page or limit values |
| INVALID_SORT | Invalid sort field or order |
Notes¶
- Requires authentication
- Supports pagination and search
- Includes project statistics
- Returns document counts and status
- Supports sorting by multiple fields
- Includes total storage usage