Skip to main content
POST
/
realtime
/
v1
/
tokens
Mint a subscriber token
curl --request POST \
  --url https://api.voyant.travel/realtime/v1/tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "clientId": "user_42",
  "capabilities": {
    "orders:org_123": [
      "subscribe",
      "presence"
    ]
  },
  "ttlSeconds": 123
}
'
{
  "token": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Voyant Cloud API token, passed as Authorization: Bearer <token>. Each token carries a fixed set of scopes; an operation rejects tokens missing its required scope.

Body

application/json
clientId
string
required

Stable subscriber identity; surfaces as the presence clientId.

Example:

"user_42"

capabilities
object
required

Capability grants keyed by channel name or trailing-wildcard pattern (e.g. admin:*).

Example:
{
"orders:org_123": ["subscribe", "presence"]
}
ttlSeconds
integer

Token lifetime in seconds. Default 3600, max 86400.

Required range: x <= 86400

Response

Minted token

token
string
required
expiresAt
string<date-time>
required