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
      • Compat
        • Accounts
        • Applications
        • Calls
        • Conferences
        • Faxes
        • LAML Bins
        • Messages
        • Phone Numbers
        • Queues
        • Recordings
        • Tokens
          • create
          • delete
          • update
        • Transcriptions
      • 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 ClientCompatTokens

create

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

delete

Next
Built with

Create a new API token.

Path parameters

AccountSidstringRequiredformat: "uuid"
The unique identifier for the project you want to use to authenticate this request.

Request

namestringRequired>=1 character
The name representing the project API token.
permissionslist of stringsRequired
The permissions you would like to enable for this project API token. Valid permissions are: calling, chat, datasphere, fax, management, messaging, numbers, pubsub, storage, tasking, and video.
subproject_idstringOptionalformat: "uuid"
The unique identifier of the subproject you would like to create a token for. Must belong to the parent project.

Response

idstringRequiredformat: "uuid"
The unique identifier of the created API Token.
namestringRequired>=1 character
The name of the created API Token.
permissionslist of stringsRequired
The permissions enabled for this token.
tokenstringRequired
The API token that can be used along with the project ID for basic authentication.

Response Example

Response
1{
2 "id": "ea14556a-984f-11ee-b9d1-0242ac120002",
3 "name": "John Doe's Token",
4 "permissions": [
5 "calling",
6 "fax",
7 "messaging"
8 ],
9 "token": "PT037258e533e87ac63174ee136ed0798dc85d4f4f9e6d7191"
10}

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com",
7});
8
9const token = await client.compat.tokens.create({
10 name: "my-token",
11 permissions: ["voice", "messaging"],
12});