API tokens
Create, rotate and revoke the API tokens your CI pipelines, the MCP server and scripts use to authenticate to CloudBooster Guard.
API tokens
API tokens authenticate your CI pipelines, the MCP server and scripts to CloudBooster Guard. They belong to your organisation. Owners and admins manage them in Settings → API tokens.
On Free you can create a token for the MCP server only: pick MCP / AI agent. Tokens for CI and the API are part of Pro. See The MCP server.
Guard shows a token's secret once, when it is created or rotated, and stores only a hash of it. Keep the secret in your CI/CD variables or a secret manager.
Expiry
A token lasts 30 days, 90 days (the default) or 1 year. Only an owner can create a token that never expires. Guard emails the token's creator and your organisation's owners and admins 14 days and 3 days before a token expires.
Rotate a token
Rotate a token when it is about to expire, on a regular schedule, or when the person who set it up is moving on. Rotating replaces the secret without an outage, because the old token keeps working while you switch over.
- In Settings → API tokens, select Rotate on the token.
- Under Keep the old token working for, pick the overlap: 24 hours (the default), 1 hour, 7 days or End now.
- Select Rotate token. If you have a second factor, Guard asks you to confirm it's you.
- Copy the new token. You will not see it again.
- Update everything that uses the old token, such as the CI variable, and run a pipeline to check it.
The new token has the same name, scopes and lifetime as the old one. For example, a 90-day token is replaced by a token that lasts 90 days from the rotation. You tell the two apart by their prefix.
During the overlap both tokens work. The old token reads Rotated in the list, with the time left before it stops and the prefix of the token that replaced it. When the overlap ends, the old token is refused with a 401 and reads Expired. To end the overlap early, select Revoke on the old token.
What to know before you rotate
- The overlap never extends a token. If a token has 2 hours left and you pick 7 days, it still stops in 2 hours.
- End now is immediate. Anything still using the old token gets a 401 straight away. Use it if a token may have leaked.
- A token rotates once. You can't rotate a token that is already rotated, revoked or expired. Rotate its replacement instead.
- A token that never expires can only be rotated by an owner. Its replacement never expires either. The old token stops after the overlap you pick.
- The new token belongs to you. A token is revoked when the member who created it leaves the organisation, and the person who rotates a token becomes the creator of the new one. Rotate long-lived tokens from an account that will stay.
- It needs a plan with API tokens. Rotating creates a token, so a plan without API tokens can't rotate, except a token for the MCP server only, which rotates on Free. You can still list and revoke tokens on any plan.
Your organisation's audit log records each rotation under issued an API token and rotated an API token. With End now it also records revoked an API token. The log names the token and its prefix, never the secret.
Revoke a token
Select Revoke on the token. Anything using it stops working at once, and this can't be undone.
From the API
A session with the admin or owner role, which has cleared any second factor, can rotate with:
overlapHours is a whole number from 0 to 168. 0 ends the old token now. Leave it out, or send no
body, for the default of 24. The 201
response carries the new secret in token, the new token in summary and the old one in previous.
| Status | Code | Meaning |
|---|---|---|
| 403 | factor_required | Confirm your second factor first. |
| 403 | never_expiry_owner_only | Only an owner can rotate a token that never expires. |
| 404 | not_found | No such token in this organisation. |
| 409 | token_already_rotated | Rotate its replacement instead. |
| 409 | token_not_active | The token is revoked or expired. Create a new one. |
| 402 | plan_upgrade_required | The plan doesn't include API tokens. On Free, only a token for the MCP server alone rotates. |