For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
        • createToken
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Response Example
  • Example
REST ClientChatResource

createToken

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

Compat

Next
Built with

Chat API namespace — token creation.

Request

ttlintegerRequired1-43200
The maximum time, in minutes, that the access token will be valid for. Between 1 and 43,200 (30 days).
channelsobjectRequired
User-defined channel names with read/write permissions. Max of 500 channels. Channel names cannot start with the reserved prefix `sw_` and can be up to 250 characters.
member_idstringOptional<=250 characters
The unique identifier of the member. Up to 250 characters. If not specified, a random UUID will be generated.
stateobjectOptionalDefaults to {}
An arbitrary JSON object available to store stateful application information in. Must be valid JSON and have a maximum size of 2,000 characters.

Response

tokenstringRequired
The generated Chat Token.

Response Example

Response
1{
2 "token": "eyJ0eXAiOiJWUlQiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2MjIxMjAxMjMsI...wMCwicnNlIjo5MDB9-BqG-DqC5LhpsdMWEFjhVkTBpQ"
3}

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient();
4const result = await client.chat.createToken({ channels: ['general'] });
5console.log(result);