Skip to main content

Update API Key

PUT https://infrahub-api.nexgencloud.com/v1/api-key/{api_key_id}

Updates the name and optionally the description of a specified API key. Include the ID of the API key in the path and the new name and optional description in the body of the request. To retrieve the ID of the API key call the List API Keys API.


Path parameters


id integer   Required

Specify the ID of the API key to be modified.


Body parameters


name string   Required

The new name for the API key.
A string with a maximum length of 50 characters.


description string  optional

The new description for the API key.


Attributes


status boolean

Indicates the success or failure of the operation. true, indicates success, while false indicates error.


message string

A message confirming the status of the request to update the specified API key.


api_key object

Returns the api_key object, containing details of the updated API key.

For descriptions of the fields within the api_key object returned in response to your request, please refer to the documentation here.


Example request
curl -X PUT "https://infrahub-api.nexgencloud.com/v1/api-key/{api_key_id}" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"\
-H "content-type: application/json" \
-d '{
"name": "example-api-key",
"description": "This is an example API key."
}'
Response
{
"status": true,
"message": "API Key updated successfully",
"api_key": {
"created_at": "2024-06-14T13:29:50",
"key": "********-****-****-****-********11bb",
"description": "This is an example API key.",
"id": 58,
"name": "example-api-key"
}
}

Returns


The response includes the status of the request and the api_key object, which contains detailed information about the API key. For more details on the attributes of the api_key object, click here.


Back to top