Get the current key
GET/v1/integrations/api-keys/meKey needs Any keyUse it to check a key after setting it up, or to log which access a system has when it starts.
curl "https://api.kalhr.com/v1/integrations/api-keys/me" \
-H "Authorization: Bearer $KALHR_API_KEY"Response
{
"isSuccessful": true,
"code": "00",
"message": "Success",
"data": {
"apiKeyId": "3f2a9c1e-5b7d-4e8a-9c21-7d4e5f6a8b90",
"name": "Accounting system",
"organizationId": "8c1d0e2f-4a6b-4c8d-9e0f-1a2b3c4d5e6f",
"permissions": ["GetDepartment", "GetEmployee", "GetEmployeeSalary", "GetPayrollSchedule", "GetPayrollScheduleById"]
}
}
| Field | Type | Description |
|---|---|---|
apiKeyId | uuid | The key's id. This identifies the key; it isn't the key. |
name | string | The key's name in KalHR |
organizationId | uuid | The organisation the key acts for |
permissions | string array | What the key may do, by permission name, sorted |
Permissions
The access chosen when creating a key is a bundle of permissions. The ones the public API checks:
| Access on the key | Permissions the API checks |
|---|---|
| Employee Management: View | GetEmployee (employees and companies), GetDepartment |
| Leave: View | GetLeaveRequests, GetLeaveTypes, GetLeaveBalance |
| Attendance: View | GetEmployeeAttendanceById (records, reports, holidays), ViewAttendanceExceptions |
| Payroll: View | GetPayrollSchedule, GetPayrollScheduleById, GetEmployeeSalary (salaries in employee records) |
A level includes other permissions too, for parts of KalHR the API doesn't reach yet.
A key that is missing, revoked or expired gets 401 with the reason. See Errors.
Related
- Authentication: create, rotate and revoke keys