Regenerate API token
Changed onReplaces 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.
Learn more about API scopes.
Request
- Base URLhttps://{Your_Space_Name}.signalwire.com
- URLhttps://{Your_Space_Name}.signalwire.com/api/project/tokens/{token_id}/regenerate
- Auth
- HTTP basic
- or HTTP basic
Path parameters
Universal Unique Identifier.
The unique identifier of the token to regenerate.
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
- info
endpoint added
- info
Some revisions have not been checked yet.