Skip to main content

Generate a new API Token

POST 

/tokens

Generate an API Token for a project to be used to authenticate requests within the project.

Permissions

You must set 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, fax, management, messaging, numbers, pubsub, storage, tasking, and video

Request

Body

required

    namestringrequired

    The name representing the API token.

    Example: John Doe's Token
    permissionsarrayrequired

    The permissions you would like to enable for this token. Valid permissions are calling, chat, fax, management, messaging, numbers, pubsub, storage, tasking, and video

    Example: ["calling","fax","messaging"]
    subproject_idstring

    The unique identifier of the subproject you would like to create a token for. The subproject passed must be a child of the project used to authenticate the request.

    Example: 9a7fc048-984f-11ee-b9d1-0242ac120002

Responses

OK

Schema

    idstring

    The ID of the created API Token.

    Example: ea14556a-984f-11ee-b9d1-0242ac120002
    namestring

    The name of the created API Token.

    Example: John Doe's Token
    permissionsarray

    The permissions enabled for this token.

    Example: ["calling","fax","messaging"]
    tokenstring

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

    Example: PT037258e533e87ac63174ee136ed0798dc85d4f4f9e6d7191