Token management and legacy endpoints
Token management
GET /api/v1/tokens and POST /api/v1/tokens require an authenticated ADMIN or OWNER browser session. An integration bearer token cannot manage tokens. Use Settings → Integrations → API access for normal token administration.
GET returns { tokens: [...] }, newest first, with id, label, maskedToken, status (ACTIVE or REVOKED), createdAt, createdBy (id, name), lastUsedAt, and requestCount. maskedToken shows only the start of the secret, such as w1r_AbC123********. It never returns existing secrets.
POST creates a token. It also requires a same-origin Origin or Referer header and Content-Type: application/json:
{"label":"HR reporting","fieldAllowlist":["personal_email","phone"]}label must be a nonempty string. fieldAllowlist is optional; see supported employee fields. HTTP 201 returns { token, secret }, where token has the same fields as a GET entry. Copy secret immediately; it cannot be retrieved later. Missing label or invalid JSON returns 400; insufficient role or invalid/missing origin returns 403. An unauthenticated browser request follows the application's login behavior.
For an authenticated same-origin browser client:
const response = await fetch('/api/v1/tokens', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({label: 'HR reporting', fieldAllowlist: ['phone']})
});
const {token, secret} = await response.json();Revoke a token
POST /api/v1/tokens/{tokenId}/revoke
Requires the same admin/owner session and same-origin protections as creation. No body is required. Returns HTTP 200 with {"revoked":true}. A missing or already revoked token returns 404. Requests using that integration token subsequently receive 401. In settings, use Revoke on the token's row.
await fetch('/api/v1/tokens/TOKEN_ID/revoke', {method: 'POST'});Legacy employee track
POST /api?action=employee-track
Authenticates with the organisation API key, rather than an API Access integration token. Ask the organisation owner for this legacy credential.
curl -X POST 'https://YOUR-INSTANCE/api?action=employee-track' \
-H 'Authorization: Bearer ORGANISATION_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"first_name":"Alex","last_name":"Example","email":"alex@example.com","team":"Engineering"}'first_name and last_name must be nonempty, and email must be valid. team is optional and defaults to Default Team; a team with that name is created if it does not exist. If a user with the EMPLOYEE role already has that email, the endpoint returns their track link. Otherwise it creates or reuses an invitation and prepares a track. Success is HTTP 200 with {"redirect_url":"https://YOUR-INSTANCE/dashboard/employee/ID/track"}. The ID may be an invitation ID. Validation returns 400, invalid authentication 401, plan user limits 403, and a missing organisation owner 404. An unknown action returns 400.
POST /api?action=admin-login is retired and returns 403 after organisation authentication. Integration credentials cannot create browser sessions.
API tasks
External systems can send progress and completion updates through task status callbacks, authenticated with the execution-scoped callback key rather than an organisation integration token. See API tasks for completion and recovery behavior.