Skip to content

API - Auth

Token management endpoints.

Current Token Identity

GET /v1/auth/me
bash
curl http://localhost:7200/v1/auth/me \
  -H "Authorization: Bearer YOUR_TOKEN"

Returns the current token's identity, role, and capabilities.

Create Token

POST /v1/auth/token
bash
curl -X POST http://localhost:7200/v1/auth/token \
  -H "Authorization: Bearer $ROOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "developer",
    "expires_in": 2592000,
    "metadata": {
      "name": "myapp-service",
      "description": "Token for myapp service"
    }
  }'

Legacy Scoped

bash
curl -X POST http://localhost:7200/v1/auth/token \
  -H "Authorization: Bearer $ROOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "scopes": [
      {"namespace": "myapp/*", "read": true, "write": false}
    ],
    "expires_in": 2592000
  }'
FieldTypeDescription
rolestringRBAC role name
scopesarrayLegacy namespace scopes
expires_inintToken lifetime in seconds
metadataobjectOptional name/description

List Tokens

GET /v1/auth/tokens
bash
curl http://localhost:7200/v1/auth/tokens \
  -H "Authorization: Bearer $ROOT_TOKEN"

Revoke Token

DELETE /v1/auth/token/{token}
bash
curl -X DELETE http://localhost:7200/v1/auth/token/TOKEN_VALUE \
  -H "Authorization: Bearer $ROOT_TOKEN"

See Guide - Authentication for role details.

Apache License 2.0