Skip to main content
Rotation replaces a project ingest key. It does not change the project or its stored telemetry. Manage keys with account authentication. An ingest key can send telemetry only. It cannot manage keys. Before you start, install the CLI and sign in. Set LOGBREW_PROJECT_ID to the project UUID. Set LOGBREW_API_URL to https://api.logbrew.co. The examples use Bash, curl 7.76.0 or newer, and jq. For planned rotation, create, deploy, and test the replacement before you revoke the old key. Set the rotation interval in your security policy. If a key has an expiry date, replace it before that date.
An exposed key is a security incident. Revoke it immediately, even before the replacement is deployed. Applications that still use a revoked key cannot send telemetry.
1

Create the replacement key

POST /api/projects/{project_id}/ingest-keys accepts a non-empty label of up to 120 characters. kind is cli, sdk, browser, server, or artifact. An artifact key cannot send telemetry. An optional expires_at must be a future RFC3339 time.The CLI saves the one-time token to a new owner-only file outside source control. It prints metadata, not the token:
Continue only after the command succeeds. Set NEW_KEY_ID to the returned ingest_key.id.If the result is uncertain, run the exact command again. The CLI reuses its pending retry key. Do not use --abandon-retry for this retry.A direct API client receives the token once in the response. To retry, send the same Idempotency-Key header. Never print, commit, or share the token.
2

Deploy the new key while the old key stays active

Put the new token in the protected deployment setting. Deploy the app. Keep the old key active. Keep both tokens out of source, build output, and logs.
3

Send one synthetic event

Load the new token into the new_ingest_key shell variable. Do not print it. Send one synthetic log with the new key, then read it back:
Continue only when the read returns this log with the same occurred_at. An older rotation-check log does not prove that the new key works. Also confirm that the deployed app sends telemetry. If a command fails, stop and read the response. Keep the old key active unless it is exposed.
4

List secret-free key metadata

Set LOGBREW_ACCOUNT_BEARER from your account authentication. Find the old key ID. Confirm that NEW_KEY_ID is active:
The response is an array of key metadata without tokens. Status is active, expired, or revoked.
5

Revoke only the old key

Set OLD_KEY_ID from the list. The command revokes the old key only when the two IDs are different:
DELETE is idempotent. It returns the key metadata with status: "revoked" and revoked_at set. You can safely repeat it after an uncertain response.Run unset new_ingest_key. Handle the key file under your secret policy.

Recover safely

If rotation still fails, report a problem. Share only key metadata. Do not include credentials, headers, raw telemetry, customer data, local paths, or source code.