An API key lets your own application talk to your agent. Each key belongs to a single agent and gives access to everything the agent can do: its systems, its documents and its long tasks.
What it's for
You don't need an API key to automate your systems: you connect them in Systems and talk to the agent from Qaalia Chat. The API key is for when you want to take your agent somewhere else:
- Your own chat: a widget on your website or a chat screen inside your app, with your design (your server calls Qaalia with the key; the browser never sees it).
- Your channels: a WhatsApp, Telegram or support bot that answers with your agent.
- Your system asks it for work: for example, at the end of the day your system asks it to «generate the sales report» and the agent does it with its systems.
- Events for triggers: your system reports that something happened and the agent gets to work.
How to send messages with it: API reference.
Create an API key
Choose the agent
In API Keys, select the agent the key will give access to.
Click Create api
Write a name that identifies the system (for example, «Online store»), an optional descriptionand when it should expire.
Copy the key
The full key starts with qlk_live_and is shown only once. Store it in an environment variable on your server; afterwards, in the dashboard you'll only see its prefix.
QAALIA_API_KEY="qlk_live_tu_clave"Expiration
You can create keys with no expiration or that expire in 1 hour, 1 day, 7, 30, 90 or 180 days, or 1 year. An expired key stops working instantly; from its card you can renew it when you need it again.
Use the API key
Send it in the Authorization header of every request:
Authorization: Bearer qlk_live_tu_claveMultiple API keys per agent
Create one key for each application that talks to your agent: your website, your app, your WhatsApp bot. That way you can deactivate one without affecting the others and see in the logs which application made each request.
Only active keys count. The Chat interno key that Qaalia creates for Qaalia Chat doesn't count.
Manage your keys
- Deactivate: with the switch on its card. The key stops working instantly and you can activate it again whenever you want.
- Renew: re-enables an expired key.
- Delete: removes it forever. Systems that use it will lose access.
Authentication errors
If the key isn't valid, the API responds with 401 and the reason:

