Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
Issue token on a realtime channel
Mints a subscribe token (`rtt_…`) for this channel alone, at most an hour long, for a browser or device that holds no key.
Mints a subscribe token (rtt_…) for this channel alone, at most an hour long, for a browser or device that holds no key. A token that names a client id enters the channel's presence while it is connected.
- Path
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel:issueToken - Scope
events:publish - Effect
write— a successful call changes state. - Collection realtime_channels
#Request
| Field | Type | What it is |
|---|---|---|
name | string | The name of the realtime channel. Required. |
ttl | duration | How long the token lives; default and at most 1 hour, at least 1 minute. |
client_id | string | The client this token is for; with it, the connection enters presence. |
client_data | value | The client's presence data, at most 4 KiB as JSON. |
#Response
| Field | Type | What it is |
|---|---|---|
token | string | The token (rtt_…); present it as Authorization: Bearer or the token query parameter of the connect URI. Never returned again. |
expire_time | timestamp | When it stops being accepted. |
connect_uri | string | The URI to connect to with it. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.INVALID_FIELD— A field failed validation.UNAVAILABLE— The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.
Every error arrives in the body Errors describes.
#Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/realtime_channels/realtime-channel:issueToken" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'