AI ready
Open in Claude (opens in a new tab)View as Markdown

Authentication and scopes

How a request proves who sent it, how to make an API token in the panel, and which scope each operation needs.

Updated 5 November 20263 min read

On this page
  1. Send the token
  2. Make a token
  3. Scopes
  4. Tokens made by delegates
  5. Check and revoke a token

Every request carries an API token. The token belongs to one account and carries a set of scopes, and each operation needs one scope. Tokens are made only in the panel, never through the API, so a stolen token can never mint a wider or longer-lived one.

Send the token

Put the token in the Authorization header with the Bearer scheme:

Shell
curl https://api.clouduxe.com/v1/api-tokens/current \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY"

Any other scheme, a token in the query string or a token in a cookie is refused with 401 token_missing.

The API speaks HTTPS only. A request over plain HTTP is refused at the edge with no redirect, so a token sent that way never reaches the API, but it did cross the network in clear: treat it as leaked and revoke it.

A token is cxk_live_ followed by 46 letters and digits.

Make a token

  1. Open API tokens in the panel

    Go to API tokens in the panel. The same page lists your webhook endpoints beside your tokens.

  2. Confirm it is you

    Making a token needs a fresh confirmation: a passkey, or an email code entered in the last 10 minutes.

  3. Choose its scopes, expiry and addresses

    Give it only the scopes your code needs (the table below lists what each one opens). Choose an expiry of 7, 30, 90 or 365 days, or none; the panel suggests 90 days. A token that holds an elevated scope always expires, at most 365 days after it was made.

    Optionally, limit it to up to 20 IPv4 or IPv6 addresses or ranges. A request from anywhere else is refused with 403 ip_not_allowed, and the token's creator gets one email a day for each new address.

  4. Copy it once

    The token is shown once, when it is made. Store it in your secret manager or an environment variable right away. The account owner gets an email naming the token, who made it, its scopes and its expiry, but never the token itself.

A token's scopes cannot be changed after it is made: make a new token instead. Each person can hold up to 25 tokens per account. A token also keeps the API version that was current when it was made; see Versioning and changelog.

Scopes

Each operation in the reference names the scope it needs. A token without that scope gets 403 scope_missing. This is every scope in the contract, with the operations it opens:

account:read
api_tokens:write

Some scopes are elevated: services:lifecycle, services:destructive, ssh_keys:write, orders:write, webhooks:write and api_tokens:write. They move money, destroy data, send account data to a URL or revoke access, so the panel flags them and the creation email names them.

Tokens made by delegates

If you work on an account as a delegate, the panel offers only the scopes your role can use there:

RoleScopes offered
OwnerEvery scope.
Admin and Operatorservices:read, services:write, firewall:read, firewall:write and services:destructive.
Viewerservices:read and firewall:read.

For a delegate, services:destructive covers reinstalling only, and a delegate's reinstall takes no SSH keys; a root password reset or a termination answers 403 forbidden.

On every request, a token can do only what both its scopes and its person's current role allow. A role change takes effect on the next request, and removing a member revokes that person's tokens on the account.

Check and revoke a token

Any token can read itself, with no scope:

GET/api-tokens/currentReference

Get the current tokenLanguage
curl https://api.clouduxe.com/v1/api-tokens/current \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY"
200 example
{
  "object": "api_token",
  "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b",
  "name": "whmcs-production",
  "prefix": "cxk_live_",
  "lastFour": "Q7x2",
  "scopes": [
    "services:read",
    "services:write",
    "services:lifecycle",
    "services:destructive",
    "orders:read",
    "orders:write",
    "billing:read",
    "ssh_keys:read",
    "ssh_keys:write",
    "webhooks:read"
  ],
  "apiVersion": "2026-12-01",
  "ipAllowlist": [
    "203.0.113.0/24"
  ],
  "createdBy": {
    "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e",
    "name": "Asha Rao"
  },
  "createdAt": "2026-12-01T08:15:12Z",
  "expiresAt": "2027-12-01T08:15:12Z",
  "lastUsedAt": "2026-12-04T10:02:41Z",
  "lastUsedIp": "203.0.113.9",
  "revokedAt": null,
  "revokedReason": null,
  "livemode": true
}

Other responses

400Bad requestversion_invalid
{
  "error": {
    "type": "invalid_request_error",
    "code": "version_invalid",
    "message": "Clouduxe-Version does not name an API version.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#version_invalid"
  }
}
401Unauthorizedtoken_missing, token_invalid, token_expired, token_revoked
{
  "error": {
    "type": "authentication_error",
    "code": "token_missing",
    "message": "No API token was sent. Send it as Authorization: Bearer <token>.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#token_missing"
  }
}

Also answered with this status: token_invalid, token_expired, token_revoked.

403Forbiddenip_not_allowed, api_access_disabled
{
  "error": {
    "type": "permission_error",
    "code": "ip_not_allowed",
    "message": "This request came from an address outside the token's IP allowlist.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#ip_not_allowed"
  }
}

Also answered with this status: api_access_disabled.

429Too many requestsrate_limited
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limited",
    "message": "Too many requests.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#rate_limited"
  }
}
500Server errorinternal_error
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected error occurred. It has been logged with this request id.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#internal_error"
  }
}
503Unavailableunavailable
{
  "error": {
    "type": "api_error",
    "code": "unavailable",
    "message": "The API is briefly unavailable.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#unavailable"
  }
}

Revoking takes effect at once, from the panel or with the API. Revoking the token that makes the request needs no scope; revoking any other token needs api_tokens:write. A revoked token answers 401 token_revoked, and an expired one 401 token_expired.

DEL/api-tokens/{tokenId}Reference

Revoke an API tokenLanguage
curl -X DELETE https://api.clouduxe.com/v1/api-tokens/0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY" \
  -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f"
200 example
{
  "object": "api_token",
  "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b",
  "name": "whmcs-production",
  "prefix": "cxk_live_",
  "lastFour": "Q7x2",
  "scopes": [
    "services:read",
    "services:write",
    "services:lifecycle",
    "services:destructive",
    "orders:read",
    "orders:write",
    "billing:read",
    "ssh_keys:read",
    "ssh_keys:write",
    "webhooks:read"
  ],
  "apiVersion": "2026-12-01",
  "ipAllowlist": [
    "203.0.113.0/24"
  ],
  "createdBy": {
    "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e",
    "name": "Asha Rao"
  },
  "createdAt": "2026-12-01T08:15:12Z",
  "expiresAt": "2027-12-01T08:15:12Z",
  "lastUsedAt": "2026-12-04T10:02:41Z",
  "lastUsedIp": "203.0.113.9",
  "revokedAt": "2026-12-04T10:05:00Z",
  "revokedReason": "user",
  "livemode": true
}

Other responses

400Bad requestversion_invalid, idempotency_key_required, idempotency_key_invalid
{
  "error": {
    "type": "invalid_request_error",
    "code": "version_invalid",
    "message": "Clouduxe-Version does not name an API version.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#version_invalid"
  }
}

Also answered with this status: idempotency_key_required, idempotency_key_invalid.

401Unauthorizedtoken_missing, token_invalid, token_expired, token_revoked
{
  "error": {
    "type": "authentication_error",
    "code": "token_missing",
    "message": "No API token was sent. Send it as Authorization: Bearer <token>.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#token_missing"
  }
}

Also answered with this status: token_invalid, token_expired, token_revoked.

403Forbiddenforbidden, ip_not_allowed, api_access_disabled, scope_missing
{
  "error": {
    "type": "permission_error",
    "code": "forbidden",
    "message": "Your role on this service does not allow this action.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#forbidden"
  }
}

Also answered with this status: ip_not_allowed, api_access_disabled, scope_missing.

404Not foundnot_found
{
  "error": {
    "type": "not_found_error",
    "code": "not_found",
    "message": "No such object, or it is not visible to this token.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#not_found"
  }
}
409Conflictidempotency_in_progress
{
  "error": {
    "type": "idempotency_error",
    "code": "idempotency_in_progress",
    "message": "A request with this Idempotency-Key is still running.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#idempotency_in_progress"
  }
}
422Unprocessableidempotency_mismatch
{
  "error": {
    "type": "idempotency_error",
    "code": "idempotency_mismatch",
    "message": "This Idempotency-Key was already used with a different request.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#idempotency_mismatch"
  }
}
429Too many requestsrate_limited
{
  "error": {
    "type": "rate_limit_error",
    "code": "rate_limited",
    "message": "Too many requests.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#rate_limited"
  }
}
500Server errorinternal_error
{
  "error": {
    "type": "api_error",
    "code": "internal_error",
    "message": "An unexpected error occurred. It has been logged with this request id.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#internal_error"
  }
}
503Unavailableunavailable, outcome_unknown, limits_unavailable
{
  "error": {
    "type": "api_error",
    "code": "unavailable",
    "message": "The API is briefly unavailable.",
    "param": null,
    "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
    "docUrl": "https://docs.clouduxe.com/api/errors#unavailable"
  }
}

Also answered with this status: outcome_unknown, limits_unavailable.

Need a server, or a hand with one?

Pick a plan to deploy a server, or open a ticket in the panel. Support runs 24/7/365.