Skip to main content
The External API uses JWT Bearer tokens (HS256 symmetric signing). All business routes expect:
There is no API-key-in-header pattern for data routes: you exchange the API key or password for a JWT using the token endpoints, then call /api/* with the Bearer token.

How to obtain credentials

Credentials are not passed on every data request—only the JWT.

Token endpoints

User login

POST /api/Authentication/token/user
  • Content-Type: application/x-www-form-urlencoded
  • Body fields: UserName, Password (see LoginRequest in code)

API key login

POST /api/Authentication/token/api-key
  • Content-Type: application/x-www-form-urlencoded
  • Body field: apiKey (string)

Successful token response

JSON fields (see JwtTokenResponse):

JWT claims

Claim types are the string names of JwtClaims (e.g. UserId, CompanyId, TimeZone). API key logins may also include Vehicles, Actions, and DateFormat for scoped keys.

Token expiry and refresh

Token caching strategy

Do not request a new token on every API call. Each token is valid for ~24 hours. Requesting tokens unnecessarily adds latency and risks hitting future rate limits.
Recommended approach:
  1. On startup, request a token and store it in memory with its expiry time (Date.now() + expires_in * 1000).
  2. Before each API call, check if the token expires within the next 5 minutes.
  3. If yes, re-authenticate and replace the cached token.
  4. If no, use the cached token.
Example (JavaScript):
Example (Python):

Token scoping

Every token is bound to a single company. The CompanyId claim in the JWT determines which resources the token can access.

User tokens

Scoped to the primary company associated with the Telemax user account. Multi-company users are pinned to their first company — if you need access to a different company, use an API key issued for that company instead.

API key tokens

API key tokens carry additional optional claims: To check which companies and vehicles your token can access, call POST /api/GetCompanies and POST /api/Devices after authenticating.

API key rotation

To rotate an API key without downtime:
  1. Create the new key in the Telemax dashboard (Webhooks and API Key section). Both keys are active simultaneously.
  2. Update your integration to use the new key and confirm tokens are being obtained successfully.
  3. Delete the old key in the dashboard. Existing tokens issued with the old key remain valid until they expire (up to 24 hours).
Deleting a key immediately invalidates future token requests with that key. Tokens already issued remain valid until their expires_in elapses.

Code examples