a84d4905fdbb

latestOpenAPI 3.1.02026-08-143874115.7 MB
API Keys

Update API Key

Updates an API key's name, permissions, API version, expiration, or IP allowlist. Fields that are omitted keep their current value; default keys cannot be modified.

patch/api_keys/{id}

Request body

api_version_date'2025-01-01' | '2026-06-08' | '2026-06-09' | '2026-06-20' | '2026-07-01' | '2026-07-08' | '2026-07-08-1' | '2026-07-18' | '2026-07-20' | '2026-07-22' | '2026-07-23' | '2026-07-25' | '2026-07-26' | '2026-07-27' | '2026-07-29' | '2026-07-29-1' | '2026-07-31' | '2026-08-03' | '2026-08-05' | '2026-08-05-1' | '2026-08-10' | '2026-08-12' | '2026-08-13'

Dated API version used when requests authenticated with this key omit the Api-Version-Date header. New keys default to the latest version.

expires_atstring nullable

When the API key should stop working, as an ISO 8601 timestamp. Omit (or pass null on update) for a key that never expires.

ip_allowliststring[] nullable

IPv4/IPv6 CIDR ranges allowed to use this key, for example ["203.0.113.0/24"]. Empty or null allows any IP.

namestring nullable

A new human-readable name for the API key.

Example request

{
  "api_version_date": "2026-08-13",
  "expires_at": "2026-01-01T12:00:00.000Z",
  "ip_allowlist": [
    "203.0.113.0/24"
  ],
  "name": "Shine Time Booking (staging)",
  "permissions": {
    "statements": [
      {
        "actions": [
          "company:basic:read"
        ],
        "grant": true,
        "resources": [
          "biz_xxxxxxxxxxxxxx"
        ]
      }
    ],
    "system_role": "admin"
  }
}

Response

api key updated

api_version_date'2025-01-01' | '2026-06-08' | '2026-06-09' | '2026-06-20' | '2026-07-01' | '2026-07-08' | '2026-07-08-1' | '2026-07-18' | '2026-07-20' | '2026-07-22' | '2026-07-23' | '2026-07-25' | '2026-07-26' | '2026-07-27' | '2026-07-29' | '2026-07-29-1' | '2026-07-31' | '2026-08-03' | '2026-08-05' | '2026-08-05-1' | '2026-08-10' | '2026-08-12' | '2026-08-13' required

Dated API version used when requests authenticated with this key omit the Api-Version-Date header.

created_atstring required

When the API key was created, as an ISO 8601 timestamp.

expires_atstring nullable required

When the API key stops working, as an ISO 8601 timestamp. null means it never expires.

idstring required

API key ID, prefixed apik_.

ip_allowliststring[] nullable required
is_default_for_resourceboolean required

Whether this is the resource's default API key. Default keys cannot be updated or deleted, only rotated.

namestring nullable required

Human-readable name identifying the API key, or null when none was set.

obfuscated_secret_keystring required

Masked version of the secret key, so the key can be recognized without revealing the full secret.

secret_keystring

The full secret used to authenticate requests. Returned only once, on create and rotate responses — store it immediately.

system_role'owner' | 'admin' | 'moderator' | 'sales_manager' | 'advertiser' | 'null' nullable required

System role the key inherits its permissions from, or null when it uses an explicit permissions policy. Only account API keys can use a system role.

updated_atstring required

When the API key was last updated, as an ISO 8601 timestamp.

Example response

{
  "api_version_date": "2026-08-13",
  "created_at": "2026-01-01T12:00:00.000Z",
  "expires_at": "2026-01-01T12:00:00.000Z",
  "grants": [
    {
      "actions": [
        {
          "action": "ai_prompt:create"
        }
      ],
      "resource_id": "biz_xxxxxxxxxxxxxx",
      "resource_type": "account"
    }
  ],
  "id": "apik_xxxxxxxxxxxxxx",
  "ip_allowlist": [
    "203.0.113.0/24"
  ],
  "name": "Shine Time Booking (admin role)",
  "obfuscated_secret_key": "apik_xxxx....xxxx",
  "secret_key": "apik_xxxxxxxxxxxxxx_C0000_C_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "system_role": "admin",
  "updated_at": "2026-01-01T12:00:00.000Z"
}