Generate a new API Token

View as Markdown
Generate an API Token for a project to be used to authenticate requests within the project. #### 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 created API Token.
namestring
The name of the created 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

Errors