Create API token

View as MarkdownOpen in Claude
Creates a project API token for server-side authentication to SignalWire REST APIs, with only the permission categories supplied in the request. Use it when a backend service needs durable project credentials; client applications should receive a service-specific token such as a [Chat Token](/docs/apis/rest/chat-tokens/create-chat-token), [PubSub Token](/docs/apis/rest/pubsub/create-token), [Room Token](/docs/apis/rest/video/room-tokens/create-room-token), or [Subscriber Token](/docs/apis/rest/subscribers/tokens/create-subscriber-token) instead. The token remains usable until you delete it or remove required permissions. The Compatibility API exposes the same project tokens through its account-scoped route. Use [Generate a new API Token](/docs/compatibility-api/rest/tokens/create-token) for that request format. The response is the only place the token secret is returned. Store it securely; no later request, including [Update API token](/docs/apis/rest/project-tokens/update-token), can read it back. #### 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](/docs/platform/your-signalwire-api-space). #### Token Permissions You must set the functions allowed by this API Token by selecting which types of requests this API Token is allowed to make. Valid options are: calling, chat, datasphere, fax, management, messaging, numbers, pubsub, storage, tasking, and video

Authentication

AuthorizationBasic
SignalWire Basic Authentication using Project ID and API Token. The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password. Example: ``` Authorization: Basic base64(project_id:token) ```

Request

This endpoint expects an object.
namestringRequired
The name representing the API token.
permissionslist of enumsRequired
The permissions you would like to enable for this 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. The subproject passed must be a child of the project used to authenticate the request.

Response

The request has succeeded.
idstringformat: "uuid"
The ID of the API Token.
namestring
The name of the API Token.
permissionslist of enums
The permissions enabled for this token.
tokenstring

The API token that can be used along with the project ID for basic authentication. It is returned only in this response and cannot be retrieved again; store it securely.

Errors

401
Unauthorized Error
422
Unprocessable Entity Error
500
Internal Server Error