Create an API key
POST/auth/api_keys
Creates a new API key object.
Request
- application/json
Body
required
description stringrequired
Human readable identifier.
permission_groups string[]required
Array of ids of Permission Groups on the API Key.
admin booleanrequired
True if the API Key has admin rights, false otherwise.
Responses
200: Successful response
- application/json
401: Authentication error
- application/json
403: Authorization error
- application/json
422: Invalid parameters supplied in request. See HTTP response body for details.
- application/json
Request samples
curl -L 'https://api.telnyx.com/auth/api_keys' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"description": "Tommy'\''s Key",
"permission_groups": [
"string"
],
"admin": true
}'
Response samples
{
"data": {
"id": "f30e7596-586e-44e1-ae7d-53db10f144d3",
"description": "Tommy's Key",
"secret": "XXXXXXXXXXXXX",
"backup_secret": "XXXXXXXXXXXXX",
"status": "active",
"permission_groups": [
"string"
],
"admin": true,
"record_type": "api_key",
"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"
}
]
}