Authentication
API keys with permissions (scopes), zero-downtime rotation and instant revocation.
The API key
Send the key in the Authorization header with every request, over HTTPS only. Keys start with aik_live_, which makes them easy for secret scanners such as GitHub secret scanning to find.
curl https://aichat.md/api/public/v1/me \
-H "Authorization: Bearer $AICHAT_API_KEY"We only keep a cryptographic fingerprint of the key, not the key itself. That is why we show it once: if you lose it, create another.
Permissions
| Scope | Allows |
|---|---|
agents:read / agents:write | agents: list, details / name, pause, resume |
conversations:read / conversations:write | conversations and messages / send as an operator, take over, hand back |
leads:read / leads:write | leads / status, tags, external ID, metadata |
contacts:read / contacts:write | contacts / tags, metadata |
channels:read | connected channels and their state |
knowledge:read / knowledge:write | knowledge sources / add a URL or text, archive |
webhooks:manage | webhooks, deliveries, /events |
A call without the required permission gets 403 permission_error with code scope_missing and the name of the missing scope. Give each integration only what it needs.
Rotation and revocation
- Rotate — you get a new key with the same permissions; the old one keeps working for the time you choose (none, one hour, 24 hours or 7 days), so you can switch without downtime.
- Revoke — the key stops immediately. This cannot be undone.
- Expiry — optional, at creation: 30, 90 or 365 days.
Every creation, rotation or revocation sends a security e-mail to the person who did it. A workspace can have up to 20 active keys. If an account is suspended, all its keys get 401.
Pushed a key to a repository or pasted it in a chat by mistake? Revoke it right away in Settings → Developers, then create a new one.