Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

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

FieldTypeWhat it is
namestringThe name of the realtime channel. Required.
ttldurationHow long the token lives; default and at most 1 hour, at least 1 minute.
client_idstringThe client this token is for; with it, the connection enters presence.
client_datavalueThe client's presence data, at most 4 KiB as JSON.

#Response

FieldTypeWhat it is
tokenstringThe token (rtt_…); present it as Authorization: Bearer or the token query parameter of the connect URI. Never returned again.
expire_timetimestampWhen it stops being accepted.
connect_uristringThe 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 '{}'