API tokens: create and revoke
An API token lets another system, such as the client's fleet system or attendance app, read employee data and the org structure. Access is read-only, and only for the companies you choose. This page explains how to create a token and revoke it.
This guide covers only the admin screens. API documentation for developers is not available yet.
Before you start
- You need the permission to read and manage API tokens across the whole organization. By default, only HRIS admin holds it.
- Ask the owner of the other system what data they need, for which companies, and until when.
- Prepare a safe place in the other system to store the token's secret.
- Use a computer or tablet. On a phone, you can only read the token list.
Create a token
- Open Integrations in the side menu. The API tokens and webhooks page opens.
- Select New API token.
- Fill in Name, up to 45 characters, such as "Fleet system sync".
- In Scopes, tick only what is needed:
- employees:read: name, job and place in the organization, without pay or NIK (national ID number)
- org:read: the org tree and positions
- events:subscribe: webhooks for employees who join, transfer and leave
- employees.sensitive:read: pay and NIK. This scope also needs employees:read.
- If you choose employees.sensitive:read, fill in Why the sensitive scope with the reason the system needs pay or NIK.
- In Companies, choose the companies the token may read, or All companies.
- Fill in Expires. It can be at most 1 year from today. The token stops at the end of that day, WIB.
- Select Create token.
Copy the secret
Once the token is created, Copy the secret now appears. The secret shows only this once.
- Select Copy.
- Store the secret in the other system's secret store. Do not send it by chat or email.
- Tick I copied the secret, then select Done.
The app shows Token created. The app does not keep the secret, only its last 4 characters. So it cannot be shown again. If it is lost, revoke the token and create a new one.
Read the token list
Each token shows its Scopes, Companies, Expires and status:
- Active: the token works.
- Expires soon: the token ends within 14 days. The app sends no reminder, so check this list regularly.
- Expired: the token is past its end date.
- Revoked: the token has been revoked.
Revoke a token
- On the token's row, select Revoke.
- Read the confirmation, then select Revoke token.
The app shows the token name followed by is revoked. The next call with that token is refused at once, and its webhooks stop sending. You cannot undo a revoke.
To rotate a token regularly, revoke the old token and create a new one. There is no button to renew a token yet.
The result
- The token reads only the chosen companies. A request outside them gets an answer as if the data did not exist, and it is logged.
- One token can make at most 600 calls a minute.
- Calls refused today show in Webhooks and API log. See webhooks and the API log.
Common problems
- The sensitive scope needs employees:read too. Tick employees:read as well.
- Say why the system needs salary or NIK, or untick the scope. Fill in the reason, or untick the sensitive scope.
- Choose at least one company. Choose at least one company.
- Choose a day at most 1 year from today. Choose an end date no more than 1 year away.
- Couldn't copy. Select the secret and copy it by hand. Select the secret, then copy it by hand.
- The Integrations menu does not show. You do not have the API token permission, or the feature is not turned on for this environment.
Do not confuse this with the Integrations tab in Admin › Access. That tab is for ERP journals and cost centres. See GL account mapping.