Skip to main content

HCM Cafe Public API

The Public API lets your systems read and update one HCM Cafe tenant's data: employees, organisation reference data, holidays, leave balances and attendance punches. It is a server-to-server REST API over HTTPS that sends and receives JSON.

Base URLhttps://api.hcmcafe.com
Token URLhttps://api.hcmcafe.com/oauth/token
Versionv1, in every path, for example /v1/employees
ReferenceAPI reference, with every route, field and error

How access works​

Each client belongs to exactly one tenant. The tenant comes from your client record, so no request carries a tenant or account ID, and records of other tenants never appear.

  1. Ask for access. Contact HCM Cafe with the tenant you are integrating for and what your integration needs to do. The tenant's administrator approves the scopes.
  2. Create a key pair. You keep the private key. It never leaves your systems.
  3. Send the public key, and the IP ranges your servers call from if you want token requests limited to them.
  4. Receive your client ID and scopes. HCM Cafe registers the client and tells you which scopes it holds.
  5. Call the API. Sign a short assertion with your private key, exchange it for an access token, and send the token with each call.

Get started walks through steps 2 to 5 with working code.

Scopes​

A token can only call the routes its scopes allow. Ask only for what your integration needs.

ScopeAllows
employees.basic:readList employees and get one employee: IDs, names, codes and organisation links
employees.contact:readAdds officialEmail to employee reads. Use together with employees.basic:read
employees:writeCreate and update employees, and list the values they accept (/v1/employee-masters)
organisation:readDepartments, divisions, sub-departments, locations and designations
holidays:readHoliday calendars and their holidays
leave.balance:readLeave types, leave years and an employee's leave balances
attendance.punch:writeSubmit attendance punches, and list the time zones they accept

Guides​