Authentication Method
Olimi’s external API uses a static API key sent in a request header. There is no token-exchange step — you include the same key on every request.Obtaining an API Key
API keys are provisioned for your company by the Olimi team and can be managed from the Dashboard. Each key is tied to a single company and remains valid until it is deactivated. There is no self-servicegenerate-token endpoint — you do not exchange credentials for a short-lived bearer token. The API key itself is what you send on every request.
Using the API Key
Include your API key in theX-API-KEY header of every request to /api/v2/*.
Example using cURL
Example using JavaScript (fetch)
Example using Python (requests)
Do not use the
Authorization: Bearer ... header when authenticating with API keys. The endpoints validate API keys sent directly in the X-API-KEY header; Bearer tokens are reserved for JWT-based user session authentication.Best Practices
To keep your Olimi account and data secure:- Keep your API key secret. Never share it publicly or commit it to version control.
- Use environment variables. Store the key in environment variables or a secrets manager rather than hardcoding it.
- Rotate keys periodically. Ask the Olimi team to issue a new key and deactivate the old one.
- Use HTTPS only. Never send the key over plain HTTP.
- Server-side only. The API key grants full access to your company’s external API surface — never ship it in client-side JavaScript, mobile apps, or any context a user can inspect.
Error Handling
If authentication fails, the API responds with HTTP401 Unauthorized and a JSON body:
- The
X-API-KEYheader is missing. - The key value does not match any record in the database.
- The key exists but is no longer linked to a company (e.g. the company has been removed).