Skip to main content

Assign an API key to another user

POST 
/auth/api_keys/:id/assignment

Assigns an API key to a user. This controls what they are authorized to do in Mission Control.

Request

Path Parameters

    id stringrequired

    The id of the API Key

Body

required

    user_id string

    uuid for User.

Responses

200: Successful response

401: Authentication error

403: Authorization error

404: Resource not found

422: Invalid parameters supplied in request. See HTTP response body for details.

Request samples


curl -L 'https://api.telnyx.com/auth/api_keys/:id/assignment' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"user_id": "e74e0c5c-b185-4e40-8b4a-aae7fc8a9f1d"
}'

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"
}
}