Skip to main content

Documents API

Endpoints for managing employee and company documents.

List All Employee Documents

Retrieves all employee documents. Admin users only.

GET /employees/documents

Response: 200 OK

{
"status": "SUCCESS",
"data": [
{
"id": 1,
"employee": 1,
"document": "Employment Contract",
"date_added": "2026-01-01",
"valid_until": "2027-12-31",
"status": "Active",
"visible_to": "Admin"
}
]
}

Get Documents for Specific Employee

GET /employees/{id}/documents

Response: 200 OK with all documents belonging to the specified employee.

Get Single Document

GET /employees/documents/{id}

Response: 200 OK

{
"status": "SUCCESS",
"data": {
"id": 1,
"employee": 1,
"document": "Employment Contract",
"date_added": "2026-01-01",
"valid_until": "2027-12-31",
"status": "Active",
"visible_to": "Admin",
"attachment": "contract_2026.pdf",
"details": "<p>Signed employment contract for 2026</p>"
}
}

Download Document File

Returns a signed download URL for the document attachment.

GET /employees/documents/{id}/file

Response: 200 OK

{
"status": "SUCCESS",
"data": {
"url": "https://your-icehrm-url.com/download?file=contract_2026.pdf&signature=abc123xyz"
}
}
info

Download URLs are temporary and should be used immediately after retrieval.

Document Status Values

  • Active: Document is current and valid
  • Expired: Document validity period has ended
  • Archived: Document has been archived

Visibility Options

The visible_to field controls who can view the document:

  • Admin: Only administrators
  • Manager: Administrators and direct managers
  • Employee: The employee, their managers, and administrators