- your audit log must show which integration made a call, not which person happened to create the key;
- the integration must keep working when that person leaves (a personal key stops working when its owner is removed or demoted);
- you need to give an integration narrower access than the person who sets it up.
Create a service account
- Open Settings → Service accounts and select Create service account.
- Give it a name (shown in the audit log), an optional description, a role and an owner. The owner is the person accountable for the integration. If they leave, the account keeps working and is flagged so an admin can pick a new owner.
- To open private folders, add the service account to groups in Settings → Access control, the same way you would for a person.
Issue and rotate keys
From the service account, choose Manage keys and create a key. You can also create one from Developers → API keys: under Acts as, pick the service account instead of yourself. Copy the key into your integration’s secret store: it is shown only once. Pick an expiry of up to one year, or Never for a key you rotate yourself. Keys default to 90 days. To rotate without downtime, create a new key with the same access shown on the old key, switch the integration to it, then revoke the old key. A service account can hold several keys at once. Keys are issued by a signed-in owner or admin. A service account’s key cannot create keys, change service accounts or manage members.What the audit log records
Calls made with a service account’s key name the service account:service_account.created, service_account.updated and
service_account.deleted, with the administrator as the actor. Issuing and
revoking its keys is recorded as api_key.created and api_key.revoked.