Create API token
Changed onCreates 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, PubSub Token, Room Token, or 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 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 and List API tokens, can read it back. If you lose it, Regenerate API token issues a new value for the same token.
With a project API token, the new token belongs to the authenticated project, or to one of its subprojects when subproject_id is given; project_id is ignored. With a Personal access token, project_id is required and names the project the token is created for, which is how a root project created with Create a project gets its first credential.
Permissions
With a project API token, the token must have the following scope(s) enabled to make a successful request: Management.
With a Personal access token there are no scopes. The token holder must be an owner or admin of the space, and the request reaches only the projects the holder is enabled for, plus their subprojects.
Learn more about API scopes.
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
Request
- Base URLhttps://{Your_Space_Name}.signalwire.com
- URLhttps://{Your_Space_Name}.signalwire.com/api/project/tokens
- Auth
- HTTP basic
- or HTTP basic
Request body
Example request
{
"name": "John Doe's Token",
"permissions": [
"calling",
"fax",
"messaging"
]
}Response
The request has succeeded.
Example response
{
"name": "John Doe's Token",
"permissions": [
"calling",
"fax",
"messaging"
],
"last_used_at": "2024-05-06T12:20:00Z",
"token": "swapi_0123456789ab0123456789ab0123456789ab"
}Changes
- breaking
response property
namelist-of-types was widened by adding typesnullto media typeapplication/jsonof response200 - info
added the required property
to the response with the status - info
added the required property
to the response with the status
- breaking
- info
the endpoint scheme security
SignalWireBasicAuthwas added to the API - info
the endpoint scheme security
SignalWirePersonalAccessTokenAuthwas added to the API - info
added the new optional request property
- info
Some revisions have not been checked yet.