Tokens

Generate a new API Token

Changed on

Creates a project API token for server-side REST authentication within the project. It remains usable until you delete it or remove required permissions. Client applications should receive a service-specific Chat, PubSub, Room, or Subscriber Token instead.

For the SignalWire REST API's project route, use Create API token.

<Warning title="Save the token secret now">The response is the only place the token secret is returned. No later request, including Update an API Token, can read it back. If you lose it, Regenerate API token issues a new value for the same token and keeps its ID.</Warning>

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: Management.

Learn more about API scopes.

post/Accounts/{AccountSid}/tokens

Request

  • Base URL
    https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01
  • URL
    https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/tokens
  • Auth
    HTTP basic

Path parameters

AccountSidstring uuid required

Universal Unique Identifier.

The unique identifier for the project you want to use to authenticate this request.

Request body application/x-www-form-urlencoded

namestring required

The name representing the project API token.

permissionsstring[] required

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_idstring uuid

Universal Unique Identifier.

Example request

{
  "name": "John Doe's Token",
  "permissions": [
    "calling",
    "fax",
    "messaging"
  ]
}

Response

The request has succeeded.

idstring uuid required

Universal Unique Identifier.

namestring required

The name of the API Token.

permissionsstring[] required

The permissions enabled for this token.

tokenstring required

The API token secret, used as the password in HTTP Basic auth alongside the project ID. Returned only in this response and cannot be retrieved again; store it securely. If you lose it, Regenerate API token issues a new value for the same token.

Example response

{
  "name": "John Doe's Token",
  "permissions": [
    "calling",
    "fax",
    "messaging"
  ],
  "token": "swapi_0123456789ab0123456789ab0123456789ab"
}

Changes

    • breaking

      added to the request property allOf list

    • breaking

      the response's property type changed from string to no type, and format from uuid to no format for status

    • info

      the request property type was generalized from string to no type, and format from uuid to no format

    • info

      added to the response property allOf list for the response status

    • breaking

      added 'unevaluatedProperties' constraint to the request body

    • info

      added 'unevaluatedProperties' constraint to the response body for the status

    • info

      added 'unevaluatedProperties' constraint to the response body for the status

    • info

      added 'unevaluatedProperties' constraint to the response body for the status

    • info

      added 'unevaluatedProperties' constraint to the response body for the status