API Tokens
API tokens provide bearer token authentication for the UpCloud API. Tokens can be restricted by IP address and have configurable expiration times up to 365 days.
Use bearer tokens by setting the Authorization header:
Authorization: Bearer ucat_01DQE3AJDEBFEKECFM558TGH2F
List tokens
Returns a paginated list of all API tokens for the account.
Query parameters
- Name
limit- Type
- integer
- Description
Number of entries to return (1-100). Default: 20.
- Name
offset- Type
- integer
- Description
Offset for pagination. Default: 0.
- Name
sort- Type
- string
- Description
Sort order: created_at, expires_at, last_used_at, name. Prefix with + or - for order.
- Name
gui- Type
- boolean
- Description
Filter hub session tokens. true returns session tokens only, false returns API tokens only.
Request
curl -X GET "https://api.upcloud.com/1.3/account/tokens?limit=20" \
-u your_username:your_password
Create token
Creates a new bearer token. Maximum validity is 365 days (8760 hours).
Attributes
- Name
name- Type
- string
- Description
Token name (1-1024 characters). Required.
- Name
expires_at- Type
- string
- Description
RFC 3339 expiry timestamp (max 365 days in future). Required.
- Name
can_create_tokens- Type
- boolean
- Description
Allow this token to create new tokens. Default: false.
- Name
allowed_ip_ranges- Type
- array
- Description
IP/CIDR addresses from which the token is accepted (0-100 entries). Empty array denies all access. Default: account IP filters or ["0.0.0.0/0", "::/0"].
Request
curl -X POST https://api.upcloud.com/1.3/account/tokens \
-u your_username:your_password \
-H "Content-Type: application/json" \
-d '{
"name": "my-token",
"expires_at": "2025-11-30T08:03:15.944Z",
"allowed_ip_ranges": ["0.0.0.0/0", "::/0"]
}'
Get token details
Returns details of a specific token. The actual token value is only available when creating a new token.
Request
curl -X GET https://api.upcloud.com/1.3/account/tokens/0c0f1d0e-ccba-48bf-a2c2-b267e8a58597 \
-u your_username:your_password
Delete token
Deletes a token, immediately revoking its access.
Request
curl -X DELETE https://api.upcloud.com/1.3/account/tokens/0c8bc50b-968e-4dc3-b9c2-1a4a5298b652 \
-u your_username:your_password