Skip to content
Console
Menu

Getting Started

Authentication

KV Store

Issue in Tokens

Mints a connection or channel token for an end user.

Mints a connection or channel token for an end user. The customer's server calls it with the secret key after authenticating the user, and hands the token to the client.

Not available yet. Sylphx Realtime is declared in the registry but no backend serves it: every call answers 501 with the problem code UNIMPLEMENTED.

  • Path POST https://api.realtime.sylphx.com/v1/tokens:issue
  • Scope realtime:token
  • Effect write — a successful call changes state.
  • Collection tokens
  • Host https://api.realtime.sylphx.com

#Request

FieldTypeWhat it is
kindTokenKindWhich kind of token to mint. Required. One of connection, channel.
userstringThe end user's id. Required for a connection token.
grantsChannelGrant[]The channels and capabilities to grant. A channel token takes exactly one grant whose pattern has no *. At most 64 grants. Required.
ttldurationHow long the token lives; 1 minute to 24 hours, default 1 hour.

#ChannelGrant

FieldTypeWhat it is
patternstringA channel name or pattern: room:42, or room:* for every channel of the namespace. * is allowed only as the whole name part, and never in the namespace part. Required.
capabilitiesCapability[]The capabilities granted. At least one. Required. One of subscribe, publish, presence.

#Response

FieldTypeWhat it is
tokenstringThe token. Opaque; sent in the connect frame or the Authorization header, never in a URL. Never returned again.
expire_timetimestampWhen it expires.
claimsTokenClaimsThe claims the service put in it, for the caller to log or check.
connect_uristringThe realtime host the client connects to. Never hard-code it: it can change, with no port, and the protocol-v1 paths are fixed.
refresh_timetimestampThe earliest the client should ask for a replacement: the in-band refresh_required frame arrives at this time.

#TokenClaims

FieldTypeWhat it is
kindTokenKindThe token's kind. One of connection, channel.
environmentstringThe authoritative Access environment id, not a client-supplied value. Valid only within the organization, project and cell below.
userstringThe end user's id (sub). Required for a connection token; it is the user shown in presence.
grantsChannelGrant[]The channels the holder may use. A connection token holds the grants of every channel its connection may touch; a channel token holds exactly one.
issue_timetimestampWhen the token was issued.
expire_timetimestampWhen the token expires. Between issue time plus 1 minute and 24 hours. The service closes a connection whose token has expired and was not refreshed.
token_idstringA unique id; the service can revoke a token by it until it expires.
issuer_key_idstringThe issuing Access key id (not its secret). Required: the service rechecks its freshness, expiry, revocation and token-issuing authority through the Access verifier at admission, refresh and while the connection is open.
organizationstringThe authoritative Access organization id of the issuing tenant. Required.
projectstringThe authoritative Access project id of the issuing tenant. Required.
cellstringThe authoritative Access cell id of the issuing tenant. Required.

#ChannelGrant

FieldTypeWhat it is
patternstringA channel name or pattern: room:42, or room:* for every channel of the namespace. * is allowed only as the whole name part, and never in the namespace part. Required.
capabilitiesCapability[]The capabilities granted. At least one. Required. One of subscribe, publish, presence.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.realtime.sylphx.com/v1/tokens:issue" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"grants":[{"capabilities":["subscribe"],"pattern":"…"}],"kind":"connection"}'