Authentication and API tokens
Every request carries a bearer token: an API token for your scripts and systems, or an OAuth access token.
ReferenceAPI: authentication — Overview
Every request to https://talos.evalink.io/api/... must carry an Authorization: Bearer <token> header. Two kinds of bearer token are accepted: a long-lived API token (created through the API token endpoints, always prefixed API-) and an OAuth access token, a short-lived signed JWT issued either by evalink talos's own token service or by the identity provider used for login. The API gateway recognizes an API token by its API- prefix and exchanges it for an access token; any other bearer value is validated as a JWT. This page covers how to obtain, send and revoke each kind, and what a 401 versus a 403 response means.
ReferenceAPI: authentication — API tokens
An API token is a per-company credential meant for scripts, servers and integrations that act independently of a user's login session. Creating a token (POST /api/api-token-service/api-tokens) returns a token field of the form API- followed by 32 random alphanumeric characters, generated server-side. Store it securely. A token is scoped to one company (companyId). The description is required when creating a token. It carries boolean grants (readAlarms, writeAlarms, readDevices, writeDevices, readCompany, readContacts, writeContacts, manageSettings, sendEmails, viewAnalytics, and further read/write pairs per resource area). Three grants cover AI agents:
| Grant | Allows |
|---|---|
chatWithAgents |
Chatting with agents. |
readAgents |
Reading agents and their knowledge, connectors, rules, activity and usage. |
writeAgents |
Changing agents, knowledge, connectors and rules, terminating agent activity, managing agent settings; it also includes the read access. |
All grants default to false, so a new token can do nothing until grants are enabled. An optional whitelistedIPs field (comma-separated single IPv4 addresses or ranges written from-to) restricts the addresses the token may be used from; if empty, any address is allowed.
There is no published endpoint that exchanges an API token for a JWT, and you do not need one: the gateway does the exchange for you. Send the API token exactly as issued, including the API- prefix:
curl -H 'Authorization: Bearer API-<your-token>' 'https://talos.evalink.io/api/alarm-service/alarms'
Create, list, update or delete tokens:
curl -X POST -H 'Authorization: Bearer <token>' -H 'Content-Type: application/json' \
-d '{"companyId":"<companyId>","enabled":true,"description":"CRM sync","readAlarms":true,"chatWithAgents":true}' \
'https://talos.evalink.io/api/api-token-service/api-tokens'
curl -H 'Authorization: Bearer <token>' 'https://talos.evalink.io/api/api-token-service/api-tokens/search/findByCompanyId?companyId=<companyId>'
curl -X PATCH -H 'Authorization: Bearer <token>' -H 'Content-Type: application/json' \
-d '{"enabled": false}' \
'https://talos.evalink.io/api/api-token-service/api-tokens/<id>'
curl -X DELETE -H 'Authorization: Bearer <token>' 'https://talos.evalink.io/api/api-token-service/api-tokens/<id>'
ReferenceAPI: authentication — OAuth access tokens
The alternative to an API token is to send an OAuth access token directly — a signed JWT that the gateway validates itself instead of exchanging. The gateway accepts two token issuers, selected by the JWT's issuer claim: tokens issued by evalink talos's own token service (urn:oauth-service, validated against talos's own JWKS endpoint) and tokens issued by the identity provider used for interactive login (validated against its JWKS endpoint). In practice this is the bearer token a signed-in user's browser session or a first-party client already holds after logging in through the web UI; it is short-lived (its lifetime is set by the issuer at mint time and returned as expires_in alongside the token) and is not meant to be typed in by hand for scripted access — for unattended/integration use, prefer an API token, which the gateway exchanges for one of these access tokens on every call. Send it the same way as an API token:
curl -H 'Authorization: Bearer <access-token>' 'https://talos.evalink.io/api/device-service/devices/search/findByCompanyId?companyId=<companyId>'
An access token that has expired, or that fails signature/issuer validation, is rejected before the request reaches any backend service.
ReferenceAPI: authentication — 401 vs. 403
A 401 Unauthorized means the caller could not be identified: no Authorization header, a malformed or expired bearer token, a JWT failing signature or issuer validation, or an API- token that does not exist, is disabled, or could not be exchanged after three attempts. Retrying with the same credential will not help; send a valid, current one.
A 403 Forbidden means the caller was identified but is not allowed to perform the request, for example because the token's or user's permissions lack the required action, or an endpoint requires a specific role. Fix it by changing the token's grants or using a credential with the right role; the request itself does not need to change.
ReferenceCreating and managing API tokens — Creating a token
- Go to Company Admin → Integrations, then click "Manage Tokens" next to the "API Tokens" entry (only visible if your role may view tokens).
- Click Create Token in the toolbar (only visible if your role may create tokens), or use the same-labelled button in the empty-state message if no tokens exist yet. In the "Create API Token" dialog give the token a clear Description (e.g. "Nightly billing export"); it is required. Pick the Permissions the integration needs; at least one is required. Use "Select All" only if the integration genuinely needs full access.
- Optionally fill in Allowlisted IPs with comma-separated IP addresses or ranges. Leave it blank to allow any source IP. Entries that are not valid IP addresses are rejected.
- Save. The token appears as a card in the list, with its full value as the subtitle and its granted permissions listed with icons below it.
- Click the token's description or value (or the "Copy API Token" button) to copy it. Use it exactly as displayed, including the
API-prefix. See the next section and API authentication. - The company's own ID, needed by some integrations alongside the token, is shown and copyable at the top of the API Tokens screen.
ReferenceCreating and managing API tokens — Scoping a token with grants
Every token carries its own set of boolean grants, mostly one read/write pair per resource area: alarms, sites, contacts, schedules, event logs, files, workflow templates, workflows, integrations, alarm dispatchers, and integration resources. There are also single-purpose grants for reading company info, reading logs, managing company settings, sending emails, sending chat messages, viewing analytics, reading operator activity, and reading/writing jobs. Three grants cover AI agents: Chat with Agents, Read Agents and Write Agents. All grants default to off when omitted, so a freshly created token can do nothing until specific permissions are switched on. The create/edit dialog requires at least one permission before it can be saved, and a "Select All" link grants everything at once.
Note on labels: the sites grants appear as "Read Devices" / "Write Devices" in the create/edit dialog, while the token cards list them as "Read Sites" / "Write Sites". They are the same grants.
An optional "Allowlisted IPs" field restricts which source addresses the token can be used from. It accepts a comma-separated list where each entry is a single IPv4 or IPv6 address, or a hyphenated range of two addresses. Leaving it blank allows use from anywhere. Set grants and the IP list to the minimum an integration needs.
| Field | Purpose |
|---|---|
| Description | Required free-text label |
| Permissions | One or more grants; at least one is required |
| Allowlisted IPs | Optional comma-separated IPs and/or ranges |
| Enabled (toggle) | Master on/off switch, changeable from the card |
| Last Access | Read-only; time of the most recent token exchange, or "Never" |
Permission examples:
- Read Alarms / Write Alarms cover reading alarms and creating, updating or deleting alarms and follow-ups.
- Write Sites (Write Devices in the dialog) additionally covers putting devices into test mode.
- Manage Settings is a broad grant covering custom roles, schedule special days/roles, PDF settings, custom attributes, site templates, job types, custom queries, custom SLAs, alarm/workflow settings and virtual device types.
- Chat with Agents allows chatting with AI agents.
- Read Agents allows viewing agents and their knowledge, connectors, rules, activity and usage.
- Write Agents allows changing agents, knowledge, connectors and rules, and includes the matching read access.
ReferenceCreating and managing API tokens — Using a token in API calls
Send your token in the Authorization header of every request, as Bearer API-.... Use the value exactly as shown on the API Tokens screen, including the API- prefix.
The platform exchanges the token for a temporary access token behind the scenes, so you don't have to do this yourself. Requests whose Authorization header does not start with Bearer API- are not exchanged and are passed on unchanged. See API authentication for other ways to authenticate.
If the token is unknown, deleted or disabled, the request is answered with 401 Unauthorized ("Invalid or disabled API Token!"). If the platform cannot complete the exchange, it retries up to three times and then returns 401 with a message that the exchange failed after 3 attempts.
A token has no permissions until you switch them on. Grants that you leave out stay off.
ReferenceCreating and managing API tokens — Rotating, disabling and revoking tokens
The token screen offers edit, copy, enable/disable and delete; the secret of an existing token cannot be changed. To rotate a token, create a new one with the same or updated grants, switch the integration over, and then delete the old one.
To temporarily suspend a token without losing its configuration, flip its slide-toggle to off. This is reversible and keeps the grants, description and IP list. To permanently revoke it, delete it; a confirmation dialog ("Are you sure you want to delete this API token?") is shown first.
Disabling, deleting and editing grants evict cached copies of the token, so the next exchange is checked against the current record.
Limit: an access token that was already exchanged and handed to a caller keeps working until its own short lifetime ends.
ReferenceAPI: authentication — Revoking or changing an API token
To revoke a token, delete it (DELETE /api/api-token-service/api-tokens/{id}) or disable it by setting enabled to false (PATCH /api/api-token-service/api-tokens/{id}). Updating or deleting the token record evicts its cached copy and cached exchange, so the next request is re-checked against the current record. Changing grants likewise evicts the cache, so the next exchange derives permissions from the current record. The gateway's own short cache (up to 15 seconds) may still serve an already-exchanged access token briefly.
Internally a disabled token fails the exchange with 'Token is disabled' and an unknown or deleted token with 'Invalid token'. When the gateway's call to the exchange receives a 4xx response, it returns 401 Unauthorized with the message "Invalid or disabled API Token!", so both cases appear as 401 to the caller. Other failures (for example server errors or connection problems) are retried up to three times and then return 401 with "Unexpected error during API Token exchange - failed after 3 attempts!".
An already-exchanged access token cannot be revoked before its own expiry; only the exchange step is cache-evicted.
ReferenceCreating and managing API tokens — Troubleshooting
Calls return 401 Unauthorized. The token doesn't exist, was deleted, is disabled, is malformed, or the exchange failed after 3 attempts. Disabled and deleted tokens produce the same 401 message from the gateway. Check the token's Enabled toggle on the API Tokens screen. Check that the value you send, with the API- prefix, matches a listed token.
A newly disabled or edited token still seems to work briefly. A caller that already holds a previously exchanged access token can keep using it until that short-lived token expires.
"I lost the token value." The value stays visible. Open Company Admin → Integrations → Manage Tokens and click the token's card to copy it again. A deleted token cannot be restored, so create a new one.