Create, rotate and revoke API keys
A team API key authenticates API requests as your team. Only team administrators see Audit Log → API Keys; anyone else asks an administrator. What a key can do is covered in Authentication.
Create a key
- Open Audit Log → API Keys and select New API Key.
- Name: up to 50 characters.
- Scope: one of the three in the next section.
- Expires in days: 1 to 3650, or one of 30 days, 90 days, 1 year, Never. Empty means the key does not expire.
- Trails: empty to allow every trail including ones created later, otherwise the key works for the listed trails only.
- Select Create.
The dialog "API key created" shows the key once — "Copy this key now. It won't be shown again." Copy it, tick I've stored this key somewhere safe, select Done. Afterwards the list shows the key masked.
Choose a scope
| On screen | Scope | Use it for |
|---|---|---|
| Read events | read | Reading, searching and exporting events |
| Emit and read events | write | Services that emit events |
| Read events, manage streams and the event catalog | manage | Creating trails, log streams and event definitions over the API |
Details in Authentication.
Rotate a key
Select Rotate, then Rotate key in "Rotate this key?". A replacement with the same name, scope and trails is shown once; the old key keeps working for 24 hours and its row reads "Rotated: stops working on …". Deploy the new key inside that window.
Revoke a key
Select Revoke, then Revoke key in "Revoke this key?". It takes effect at once, requests
with the key get 403, and it cannot be undone.
If a key leaks
Revoke it rather than rotating it: rotation leaves the old key valid for 24 hours. Then create a new key.