Documents API

Upload, retrieve, and manage documents for employees through the CitoHR API.

Get Documents

Retrieve documents with filtering and pagination.

GET /api/documents

Query parameters:

  • search - Search documents by name (optional)
  • isMandatory - Filter by mandatory status (optional, true/false)
  • targetUserId - Filter by target user ID (optional)
  • targetRoleId - Filter by target role ID (optional)
  • targetDepartmentId - Filter by target department ID (optional)
  • readByDate - Filter by read-by date (optional, ISO format)
  • hasRead - Filter by read status (optional, true/false)
  • page - Page number (default: 1)
  • pageSize - Items per page (default: 10)

Authorization: Requires valid session. Returns documents accessible to the current user.

Get Document by ID

Retrieve a specific document by ID.

GET /api/documents/{id}

Download Document

Download a document file.

GET /api/documents/{id}/download

Read Document

Mark a document as read.

GET /api/documents/{id}/read

Delete Document

Delete a document. Requires appropriate permissions.

DELETE /api/documents/{id}

Get Employee Documents

Retrieve documents for a specific employee.

GET /api/users/{id}/documents

Authorization: Requires ADMIN role or manager relationship with the employee.