Update an API key
⚠️
Preview — this feature is being built; the design below is the spec.
PATCH https://app.syntic.ai/v1/organizations/api_keys/{api_key_id}Rename a key, switch it off or on, change its origin or IP restrictions, or move its default API version. A key set to inactive fails with 401 inactive_api_key from the next request. Permanent revocation stays in the Console.
For how this fits into a full workflow, see API key management.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <admin key>: an Admin API key (sk_admin_...). Inference keys are refused with 403 admin_key_required. See Admin API keys. |
syntic-beta | Yes, while in preview | admin-2026-11-01. Without it the call fails with 400 beta_required. See Versioning. |
Content-Type | Yes | application/json |
Path parameters
| Parameter | Type | Description |
|---|---|---|
api_key_id | string | The key’s id, starting with apikey_. |
Body parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
name | string | No | 1 to 100 characters. |
status | string | No | active or inactive. |
allowed_origins | array of strings | No | Replaces the list. |
allowed_ips | array of strings | No | Replaces the list. |
pinned_version | string | No | A published syntic-version date. |
Response
200 OK, Content-Type: application/json
{
"id": "apikey_01JB7C9E1G3J5L7N9Q1S",
"type": "api_key",
"name": "billing-worker-prod",
"kind": "private",
"prefix": "sk_live_3f9c",
"hint": "…a71e",
"status": "inactive",
"workspace_id": "wrkspc_01JC0A2C4E6G8J0L2N4Q",
"created_by": {
"id": "user_01J9Y0A2C4E6G8J0L2N4",
"email": "dana@example.com",
"status": "active"
},
"allowed_origins": [],
"allowed_ips": [
"203.0.113.0/24"
],
"pinned_version": "2026-11-01",
"expires_at": null,
"created_at": "2026-03-02T09:30:00Z",
"last_used_at": "2026-11-05T10:02:11Z",
"last_used_ip": "203.0.113.40",
"use_count": 1841220
}Examples
curl -sS -X PATCH https://app.syntic.ai/v1/organizations/api_keys/apikey_01JB7C9E1G3J5L7N9Q1S \
-H "Authorization: Bearer $SYNTIC_ADMIN_KEY" \
-H "syntic-beta: admin-2026-11-01" \
-H "Content-Type: application/json" \
-d '{
"status": "inactive"
}'Errors
Errors use the error envelope and carry a request_id. Codes specific to this operation:
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request_error | beta_required | The syntic-beta header is missing. |
| 400 | invalid_request_error | invalid_parameter | A bad origin, IP range or version; param names it. |
| 400 | invalid_request_error | read_only_field | kind, workspace_id and the secret cannot be changed. |
| 404 | not_found_error | api_key_not_found | No key with that id in the organization. |
| 409 | conflict_error | key_revoked | The key is revoked or expired. |
| 401 | authentication_error | invalid_api_key | The admin key is missing, unknown, revoked or expired. |
| 403 | permission_error | admin_key_required | An inference key was used. |
| 429 | rate_limit_error | rate_limited | Too many requests; wait for Retry-After. See Rate-limit headers. |
Was this page helpful?