Skip to main content
PATCH
https://api.naga.ac
/
v1
/
account
/
keys
/
{key_id}
Update 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": {},
  "is_enabled": {},
  "credit_limit": {},
  "expires_at": {}
}
'
{
  "id": 123,
  "name": "<string>",
  "created_at": "<string>",
  "expires_at": {},
  "is_enabled": true,
  "credit_limit": {}
}
Provisioning Key Required This endpoint requires authentication with a provisioning key, not a regular API key.

Path Parameters

key_id
integer
required
The ID of the API key to update

Request Parameters

All parameters are optional. Only include the fields you want to update:
name
string | null
New name for the API key (1-255 characters). Omit to leave unchanged.
is_enabled
boolean | null
Enable or disable the API key. Omit to leave unchanged.
credit_limit
number | null
Update credit limit for the API key (minimum: 0). Send null to remove the limit.
expires_at
string | null
Update expiration datetime for the API key (ISO 8601). Must be in the future. Send null to remove expiration.

Usage examples

import requests

key_id = 1
response = requests.patch(
    f"https://api.naga.ac/v1/account/keys/{key_id}",
    headers={
        "Authorization": "Bearer YOUR_PROVISIONING_KEY",
        "Content-Type": "application/json",
    },
    json={
        "name": "Updated Production Key",
        "is_enabled": False,
        "credit_limit": 200.00,
    },
)

updated_key = response.json()
print(updated_key)

Response

{
  "id": 1,
  "name": "Updated Production Key",
  "created_at": "2025-01-15T10:30:00Z",
  "expires_at": null,
  "is_enabled": false,
  "credit_limit": 200.0
}

Response Fields

id
integer
Unique key identifier
name
string
Updated key name
created_at
string
ISO 8601 timestamp (unchanged)
expires_at
string | null
Optional expiration datetime (ISO 8601). null means no expiration.
is_enabled
boolean
Updated key status
credit_limit
number | null
Updated spending limit (null means no limit)