Project Tokens

Update API token

Changed on

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

patch/api/project/tokens/{token_id}

Request

  • Base URL
    https://{Your_Space_Name}.signalwire.com
  • URL
    https://{Your_Space_Name}.signalwire.com/api/project/tokens/{token_id}
  • Auth
    • HTTP basic
    • or HTTP basic

Path parameters

token_idstring uuid required

Universal Unique Identifier.

The unique identifier of the token to update.

Request body

namestring

The name representing the API token.

permissionsProjectTokenPermission[]

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

Example request

{
  "name": "John Doe's Token",
  "permissions": [
    "calling",
    "fax",
    "messaging"
  ]
}

Response

The request has succeeded.

idstring uuid required

Universal Unique Identifier.

namestring nullable required

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

permissionsProjectTokenPermission[] required

The permissions enabled for this token.

last_used_atstring date-time nullable required

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

revoked_atstring date-time nullable required

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.

Example response

{
  "name": "John Doe's Token",
  "permissions": [
    "calling",
    "fax",
    "messaging"
  ],
  "last_used_at": "2024-05-06T12:20:00Z"
}

Changes

    • breaking

      response property name list-of-types was widened by adding types null to media type application/json of response 200

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      the endpoint scheme security SignalWireBasicAuth was added to the API

    • info

      the endpoint scheme security SignalWirePersonalAccessTokenAuth was added to the API

Some revisions have not been checked yet.