Python
import requests
url = "https://api.naga.ac/v1/account/keys/{key_id}"
payload = {
"name": "production (rotated out)",
"is_enabled": False,
"workspace_id": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'production (rotated out)', is_enabled: false, workspace_id: null})
};
fetch('https://api.naga.ac/v1/account/keys/{key_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl https://api.naga.ac/v1/account/keys/42 \
-X PATCH \
-H "Authorization: Bearer $NAGA_PROVISIONING_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "production (rotated out)",
"is_enabled": false,
"workspace_id": null
}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.naga.ac/v1/account/keys/{key_id}"
payload := strings.NewReader("{\n \"name\": \"production (rotated out)\",\n \"is_enabled\": false,\n \"workspace_id\": null\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": 42,
"name": "production (rotated out)",
"created_at": "2026-08-01T09:14:22",
"expires_at": null,
"is_enabled": false,
"default_routing_strategy": "latency",
"credit_limit": 25,
"credit_limit_period": "month",
"workspace_id": null
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Invalid provisioning key."
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}API Keys
Update an API key
Updates one API key of the account in place, changing only the fields sent. Requires a provisioning key.
PATCH
https://api.naga.ac
/
v1
/
account
/
keys
/
{key_id}
Python
import requests
url = "https://api.naga.ac/v1/account/keys/{key_id}"
payload = {
"name": "production (rotated out)",
"is_enabled": False,
"workspace_id": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'production (rotated out)', is_enabled: false, workspace_id: null})
};
fetch('https://api.naga.ac/v1/account/keys/{key_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl https://api.naga.ac/v1/account/keys/42 \
-X PATCH \
-H "Authorization: Bearer $NAGA_PROVISIONING_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "production (rotated out)",
"is_enabled": false,
"workspace_id": null
}'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.naga.ac/v1/account/keys/{key_id}"
payload := strings.NewReader("{\n \"name\": \"production (rotated out)\",\n \"is_enabled\": false,\n \"workspace_id\": null\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": 42,
"name": "production (rotated out)",
"created_at": "2026-08-01T09:14:22",
"expires_at": null,
"is_enabled": false,
"default_routing_strategy": "latency",
"credit_limit": 25,
"credit_limit_period": "month",
"workspace_id": null
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Invalid provisioning key."
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"message": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Body
application/json
The body of PATCH /v1/account/keys/{key_id}; an absent field stays.
Response
The key as it stands after the change, without its secret.
One API key of the account, without its secret.