Create an access token
POST/auth/access_tokens
Creates a new access token object.
Request
- application/json
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
- application/json
401: Authentication error
- application/json
403: Authorization error
- application/json
404: Resource not found
- application/json
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"
}
}
{
"errors": [
{
"code": "10001",
"title": "error title",
"detail": "additional detail about the error",
"pointer": "/pointer/to/field"
}
]
}
{
"errors": [
{
"code": "10001",
"title": "error title",
"detail": "additional detail about the error",
"pointer": "/pointer/to/field"
}
]
}
{
"errors": [
{
"code": "10001",
"title": "error title",
"detail": "additional detail about the error",
"pointer": "/pointer/to/field"
}
]
}