Tokens

Generate a new API Token

Creates a project API token for server-side REST authentication within the project. It remains usable until you delete it or remove required permissions. Client applications should receive a service-specific Chat, PubSub, Room, or Subscriber Token instead.

For the SignalWire REST API's project route, use Create API token.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: Management.

Learn more about API scopes.

post/Accounts/{AccountSid}/tokens

Path parameters

AccountSidstring uuid required

Universal Unique Identifier.

The unique identifier for the project you want to use to authenticate this request.

Response

The request has succeeded.

idstring uuid required

Universal Unique Identifier.

namestring required

The name of the created API Token.

permissionsstring[] required

The permissions enabled for this token.

tokenstring required

The API token that can be used along with the project ID for basic authentication.

Example response

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

Changes

Changed in 6 of the 40 revisions of this API.18219

  • 2916d5e3072e22See the full diff
    • added uuid to the subproject_id request property allOf list

      request-property-all-of-added

    • the id response's property type/format changed from string/uuid to / for status 200

      response-property-type-changed

    • the subproject_id request property type/format was generalized from string/uuid to /

      request-property-type-generalized

    • added uuid to the id response property allOf list for the response status 200

      response-property-all-of-added

  • 5344c0c93a4c14See the full diff
    • added 'unevaluatedProperties' constraint to the request body

      request-body-unevaluated-properties-added

    • added 'unevaluatedProperties' constraint to the response body for the status 200

      response-body-unevaluated-properties-added

    • added 'unevaluatedProperties' constraint to the response body for the status 400

      response-body-unevaluated-properties-added

    • added 'unevaluatedProperties' constraint to the response body for the status 401

      response-body-unevaluated-properties-added

    • added 'unevaluatedProperties' constraint to the response body for the status 422

      response-body-unevaluated-properties-added

  • d5fbaaddfa3e35See the full diff
    • the permissions request property's minItems was increased to 1

      request-property-min-items-increased

    • the name request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • the subproject_id request property type/format changed from string/ to string/uuid

      request-property-type-changed

    • added the non-success response with the status 400

      response-non-success-status-added

    • the response property id became required for the status 200

      response-property-became-required

    • the response property name became required for the status 200

      response-property-became-required

    • the response property permissions became required for the status 200

      response-property-became-required

    • the response property token became required for the status 200

      response-property-became-required

    This revision also has 11 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 479ede876c8953See the full diff
    • the response property code became optional for the status 422

      response-property-became-optional

    • the response property message became optional for the status 422

      response-property-became-optional

    • the code response's property type/format changed from integer/int32 to string/ for status 422

      response-property-type-changed

    • removed the required property more_info from the response with the 422 status

      response-required-property-removed

    • removed the required property status from the response with the 422 status

      response-required-property-removed

    • added the optional property attribute to the response with the 422 status

      response-optional-property-added

    • added the optional property type to the response with the 422 status

      response-optional-property-added

    • added the optional property url to the response with the 422 status

      response-optional-property-added

  • 07f73f74a61d11See the full diff
    • removed the media type application/json from the request body

      request-body-media-type-removed

    • added the media type application/x-www-form-urlencoded to the request body

      request-body-media-type-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 3c88f14db21e624See the full diff
    • added the new required request property name

      new-required-request-property

    • added the new required request property permissions

      new-required-request-property

    • the request's body type/format changed from / to object/

      request-body-type-changed

    • the code response's property type/format changed from string/ to integer/int32 for status 422

      response-property-type-changed

    • removed the required property type from the response with the 422 status

      response-required-property-removed

    • removed the required property url from the response with the 422 status

      response-required-property-removed

    • removed subschema #1 subschema #2 subschema #3 from the request body allOf list

      request-body-all-of-removed

    • removed the optional property attribute from the response with the 422 status

      response-optional-property-removed

    • added the new optional request property subproject_id

      new-optional-request-property

    • added the non-success response with the status 401

      response-non-success-status-added

    • added the required property more_info to the response with the 422 status

      response-required-property-added

    • added the required property status to the response with the 422 status

      response-required-property-added

    This revision also has 14 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog