1
Create a token
In the client area, open Settings → API tokens and create one. Give it a name you’ll recognise later, and tick
services:read. That’s all this walkthrough needs.Copy the token straight away. It’s shown once and we only keep a hash, so if you lose it you revoke it and make another.Put it in an environment variable rather than pasting it into commands:2
Check the token
GET /v1/auth/whoami accepts any valid token, whatever its scopes. It tells you who the credential belongs to and what it may do:scopes isn’t what you expected, fix it now. Scopes are fixed when a token is created, so widening one means making a new token.3
List your cloud servers
/v1/dedicated for dedicated servers. Both need services:read.4
Read the envelope
Every response has the same outer shape, success or failure:Check
success first, then read data. On failure, error is a sentence written for a person. Log it or show it, but don’t branch on its wording. Branch on the HTTP status instead. Errors and rate limits lists every status code.Next steps
Pick your scopes
What each of the 14 scopes grants, and which ones can spend money or destroy data.
Drive your servers
Power, rescue, snapshots, reinstall and cancellation.