API Keys

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

  • Base URL
    https://api.whop.com/api/v1
  • Auth
    HTTP bearer

Path parameters

id, string required

API key ID, prefixed apik_.

Headers

Api-Version-Date, string
Example:2026-11-30

Pins the request to a dated API version.

Request body

object required
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' | '2026-08-14' | '2026-08-21' | '2026-08-21-1' | '2026-08-25' | '2026-08-25-1' | '2026-08-25-2' | '2026-08-31' | '2026-09-02' | '2026-09-02-1' | '2026-09-02-2' | '2026-09-04' | '2026-09-06' | '2026-09-09' | '2026-09-09-1' | '2026-09-11' | '2026-09-11-1' | '2026-09-13' | '2026-09-15' | '2026-09-22' | '2026-09-22-1' | '2026-09-22-2' | '2026-09-22-3' | '2026-09-22-4' | '2026-09-23' | '2026-09-24' | '2026-09-24-1' | '2026-09-25' | '2026-09-28' | '2026-09-29' | '2026-10-05' | '2026-10-05-1' | '2026-10-06' | '2026-10-06-1' | '2026-10-06-2' | '2026-10-07' | '2026-10-07-1' | '2026-10-07-2' | '2026-10-08' | '2026-10-09' | '2026-10-09-1' | '2026-10-09-2' | '2026-10-13' | '2026-10-13-1' | '2026-10-14' | '2026-10-14-1' | '2026-10-15' | '2026-10-15-1' | '2026-10-24' | '2026-10-27' | '2026-10-27-1' | '2026-10-27-2' | '2026-10-27-3' | '2026-10-28' | '2026-10-28-1' | '2026-10-29' | '2026-10-29-1' | '2026-10-29-2' | '2026-10-29-3' | '2026-10-29-4' | '2026-10-29-5' | '2026-10-29-8' | '2026-10-30' | '2026-11-02' | '2026-11-02-1' | '2026-11-03' | '2026-11-03-1' | '2026-11-04' | '2026-11-04-1' | '2026-11-05' | '2026-11-05-1' | '2026-11-06' | '2026-11-07' | '2026-11-10' | '2026-11-10-1' | '2026-11-11' | '2026-11-12' | '2026-11-13' | '2026-11-13-1' | '2026-11-14' | '2026-11-14-1' | '2026-11-16' | '2026-11-16-1' | '2026-11-16-2' | '2026-11-17' | '2026-11-17-1' | '2026-11-17-2' | '2026-11-17-3' | '2026-11-19' | '2026-11-19-1' | '2026-11-19-2' | '2026-11-20' | '2026-11-22' | '2026-11-22-1' | '2026-11-23' | '2026-11-23-1' | '2026-11-23-2' | '2026-11-23-3' | '2026-11-25' | '2026-11-30'

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

expires_at, string 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_allowlist, string[] nullable

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

name, string nullable

A new human-readable name for the API key.

permissions, object

The permissions policy for the API key: explicit permission statements, or a system role to inherit from. Statements without a resources array default to the owning account (Account API keys) or every key-addressable resource (App API keys).

Example request

{
  "api_version_date": "2026-11-30",
  "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

ApiKey required
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' | '2026-08-14' | '2026-08-21' | '2026-08-21-1' | '2026-08-25' | '2026-08-25-1' | '2026-08-25-2' | '2026-08-31' | '2026-09-02' | '2026-09-02-1' | '2026-09-02-2' | '2026-09-04' | '2026-09-06' | '2026-09-09' | '2026-09-09-1' | '2026-09-11' | '2026-09-11-1' | '2026-09-13' | '2026-09-15' | '2026-09-22' | '2026-09-22-1' | '2026-09-22-2' | '2026-09-22-3' | '2026-09-22-4' | '2026-09-23' | '2026-09-24' | '2026-09-24-1' | '2026-09-25' | '2026-09-28' | '2026-09-29' | '2026-10-05' | '2026-10-05-1' | '2026-10-06' | '2026-10-06-1' | '2026-10-06-2' | '2026-10-07' | '2026-10-07-1' | '2026-10-07-2' | '2026-10-08' | '2026-10-09' | '2026-10-09-1' | '2026-10-09-2' | '2026-10-13' | '2026-10-13-1' | '2026-10-14' | '2026-10-14-1' | '2026-10-15' | '2026-10-15-1' | '2026-10-24' | '2026-10-27' | '2026-10-27-1' | '2026-10-27-2' | '2026-10-27-3' | '2026-10-28' | '2026-10-28-1' | '2026-10-29' | '2026-10-29-1' | '2026-10-29-2' | '2026-10-29-3' | '2026-10-29-4' | '2026-10-29-5' | '2026-10-29-8' | '2026-10-30' | '2026-11-02' | '2026-11-02-1' | '2026-11-03' | '2026-11-03-1' | '2026-11-04' | '2026-11-04-1' | '2026-11-05' | '2026-11-05-1' | '2026-11-06' | '2026-11-07' | '2026-11-10' | '2026-11-10-1' | '2026-11-11' | '2026-11-12' | '2026-11-13' | '2026-11-13-1' | '2026-11-14' | '2026-11-14-1' | '2026-11-16' | '2026-11-16-1' | '2026-11-16-2' | '2026-11-17' | '2026-11-17-1' | '2026-11-17-2' | '2026-11-17-3' | '2026-11-19' | '2026-11-19-1' | '2026-11-19-2' | '2026-11-20' | '2026-11-22' | '2026-11-22-1' | '2026-11-23' | '2026-11-23-1' | '2026-11-23-2' | '2026-11-23-3' | '2026-11-25' | '2026-11-30' required

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

created_at, string required

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

expires_at, string nullable required

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

grants, ApiKeyGrant[]
id, string required

API key ID, prefixed apik_.

ip_allowlist, string[] nullable required
is_default_for_resource, boolean required

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

last_used_at, string nullable required

When the API key last authenticated a request, as an ISO 8601 timestamp. Recorded at most once an hour, so it can trail the latest request by up to an hour. null means the key has not been used since this field was introduced.

name, string nullable required

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

obfuscated_secret_key, string required

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

secret_key, string

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_at, string required

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

Example response

{
  "api_version_date": "2026-11-30",
  "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"
}

Changes

    • warning

      added the new 2026-11-30 enum value to the api_version_date response property for the response status

    • info

      added the new 2026-11-30 enum value to the request property api_version_date

    • warning

      added the new 2026-11-25 enum value to the api_version_date response property for the response status

    1 more change in this revision