API tokens
What a token may do, how long it works, and how to stop it
Updated
API documentation pages
A token acts as you, in the projects you chose, up to the level you chose. What it may really do is the lower of that and what you may do in the project now.
Make one#
In the console, Account > API token > Create token. You confirm who you are each time. Choose:
- a name, to know it again;
- how long it works: 7, 30, 90 or 365 days;
- the projects it reaches;
- what it may do with each kind of thing.
The token is shown once. It starts with xver_pat_. Keep it in a secret store, never in code, a URL or a log. The projects, levels and end of a token cannot be changed later: make a new one.
Levels#
| Read | Manage (includes read) | Delete (includes manage) | |
|---|---|---|---|
| Servers | See | Create, start, stop, reboot, rename, resize, turn on deletion protection | Delete servers with all their backups; restore a backup over the disk (with backups: read) |
| Block Storage | See | Create, enlarge, rename, attach, detach | Delete volumes |
| Backups | See | Create, set automatic backups | Delete backups |
| SSH keys | See | Add, remove from the account | |
| Projects, balance | See |
servers:manage runs code as root on new servers through a startup script. Delete is off unless you choose it: give it only to a program you trust with your data.
Server passwords are a scope of their own, servers:password, in no level. It works only where your role in the project lets you see server passwords. Each reveal is one server, is recorded, and counts against 10 an hour per token.
curl -s -X POST -H "Authorization: Bearer $XVER_TOKEN" \
https://api.xver.cloud/v2/servers/SERVER_ID/password/revealWhat it may really do#
Your role in each project still counts on every request. Removed from a project, the token stops reaching it at once. Made admin later, the token gets more, but never above the levels it was made with. SSH keys belong to your account, not to a project.
Revoke, rotate, end#
- Revoke one token or all of them on the API token page, or a token itself with
DELETE /v2/token. It stops at the next request. - Make a new one in its place keeps the old one working 24 more hours, then revokes it.
- You get an email when a token is made, 7 days and 1 day before it ends, and when it is used from a new address.
After a password reset or a passkey recovery#
Resetting or changing your password, or recovering a passkey, does not revoke your tokens. If you think someone else had your account, revoke all tokens: the page after a reset and after a passkey recovery shows them with a Revoke all button.
History of commands#
GET /v2/audit-events lists what this token did, newest first, for a year: what it changed, password reveals and requests it was refused. In the console, Account > Command history shows the commands of all your tokens.