Skip to main content
PATCH
/
v1
/
account
/
keys
/
{key_id}
Update an API key
curl --request PATCH \
  --url https://api.naga.ac/v1/account/keys/{key_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "is_enabled": true,
  "credit_limit": 1,
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "id": 123,
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "is_enabled": true,
  "credit_limit": 123
}

Authorizations

Authorization
string
header
required

Provisioning key required for account management endpoints under /v1/account.

Path Parameters

key_id
integer
required

Body

application/json

Request model for updating an API key

name
string | null

New name for the API key

Required string length: 1 - 255
is_enabled
boolean | null

Enable or disable the API key

credit_limit
number | null

Update credit limit for the API key

Required range: x >= 0
expires_at
string<date-time> | null

Update expiration datetime for the API key. Must be in the future. Send null to remove expiration.

Response

Successful Response

Response model for API key details

id
integer
required
name
string
required
created_at
string<date-time>
required
expires_at
string<date-time> | null
required
is_enabled
boolean
required
credit_limit
number | null
required