Regenerate API token
Replaces a project API token’s value and returns the new value. Use it to rotate a credential on a schedule, after it has been exposed, or when its value has been lost. The token keeps its id, name, and permissions, so there is nothing to re-enter; to change those, use Update API token.
The previous value stops working immediately, on every API that accepts a project API token. Anything still using it receives 401 Unauthorized until you give it the new value.
The response is the only place the new value is returned; store it securely. If you lose it, regenerate the token again.
The new value always uses the current token format: 42 characters beginning with swapi_. A token issued in the legacy format, 50 characters beginning with PT, changes format and length when regenerated, so update anything that validates or stores token values by length or prefix.
You can regenerate the token you are authenticating with. The request succeeds, but the value you sent is no longer valid once it does, so save the new value from the response before making any further request.
A token the caller cannot reach returns 404 Not Found. Use List API tokens to find the id of each token you can manage.
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.
Authentication
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)
Personal access token authentication for space-wide administration.
Send HTTP Basic auth with an empty username and the Personal access token as
the password. A Personal access token carries your own authority rather than a
project’s: it is created from your user menu in the Dashboard, is prefixed
pat_, and has no scopes. The holder must be an owner or admin of the space
named by the subdomain, and the token acts only on that space.
Example:
Authorization: Basic base64(:pat_...)
Path parameters
Response
The name of the API Token. null when the token has no name.
The date and time the token last authenticated a request. null if it never has.
The date and time SignalWire revoked the token’s value, for example after detecting that the value was exposed. null if it has not been revoked. A revoked token keeps its id and still appears in List API tokens, but its previous value no longer authenticates and no replacement value has been issued to you. To get a working value, regenerate the token, which also clears revoked_at.
The API token that can be used along with the project ID for basic authentication. It is returned only when the token is created or regenerated and cannot be retrieved again; store it securely.