Skip to main content

Create an access token

POST 
/auth/access_tokens

Creates a new access token object.

Request

Body

required

    api_key_id stringrequired

    API Key for which to create the Access Token.

    expiration stringrequired

    Expiration datetime in ISO 8601 format

    permission_groups string[]required

    Array of ids of Permission Groups on the Access Token.

Responses

200: Successful response

401: Authentication error

403: Authorization error

404: Resource not found

Request samples


curl -L 'https://api.telnyx.com/auth/access_tokens' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"api_key_id": "f30e7596-586e-44e1-ae7d-53db10f144d3",
"expiration": "2018-02-09T00:00:00.000000Z",
"permission_groups": [
"string"
]
}'

Response samples


{
"data": {
"token": "XXXXXXXXXXXXX",
"api_key_id": "f30e7596-586e-44e1-ae7d-53db10f144d3",
"expiration": "2018-02-09T00:00:00.000000Z",
"permission_groups": [
"string"
],
"record_type": "access_token",
"created_at": "2018-02-08T18:49:22.998023Z",
"updated_at": "2018-02-08T18:49:22.998023Z"
}
}