Skip to navigation

Update API token

View as MarkdownOpen in Claude

Changes the name or enabled permission categories of an existing project API token. Use it to change a token’s permissions without replacing its identifier; remove permissions that the token’s server-side caller no longer needs. For the account-scoped Compatibility API route, use Update an API Token.

Updating a token does not change its value. The response omits the token secret, which is returned only by Create API token and Regenerate API token.

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 can modify 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)
OR
AuthorizationBasic

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 and has no scopes. New tokens are prefixed swpat_; tokens created before that format are prefixed pat_ and keep working. 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(:swpat_...)

Path parameters

token_idstringRequiredformat: "uuid"
The unique identifier of the token to update.

Request

This endpoint expects an object.
namestringOptional
The name representing the API token.
permissionslist of enumsOptional
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

Response

The request has succeeded.
idstringformat: "uuid"
The ID of the API Token.
namestring or null

The name of the API Token. null when the token has no name.

permissionslist of enums
The permissions enabled for this token.
last_used_atdatetime or null

The date and time the token last authenticated a request. null if it never has.

revoked_atdatetime or null

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.

Errors

422
Unprocessable Entity Error
500
Internal Server Error