API tokens

Create and revoke API tokens. The secret is returned once.

3 endpoints

List API tokens

#

GET/api/v1/users/{id}/tokens

Token metadata; secrets are never returned again.

Path parameters

  • id integer> 0

Example

curl "https://panel.example.com/api/v1/users/42/tokens" \
  -H "Authorization: Bearer $TRIXOS_TOKEN"

Create an API token

#

POST/api/v1/users/{id}/tokens

The response contains the token (<id>|<secret>) once.

Path parameters

  • id integer> 0

Request body

  • namestringrequired

    min. 1 chars, max. 100 chars

  • scopesstring[]

    min. 1 items, default ["*"]

  • expiresAtstring | null

    date-time

  • allowedHostsstring[]

    default []

Example

curl -X POST "https://panel.example.com/api/v1/users/42/tokens" \
  -H "Authorization: Bearer $TRIXOS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"billing","scopes":["servers:read","servers:power"],"expiresAt":"2027-12-31T23:59:59Z","allowedHosts":["198.51.100.7"]}'

Revoke an API token

#

DELETE/api/v1/users/{id}/tokens/{tokenId}

Path parameters

  • id integer
  • tokenId integer

Example

curl -X DELETE "https://panel.example.com/api/v1/users/42/tokens/5" \
  -H "Authorization: Bearer $TRIXOS_TOKEN"