Create API Key
Changed onCreates an API key for an account, an app, or your own user. A user API key acts as you and can only grant ad_campaign:basic:read, ad_campaign:update, ad_pixel:manage, identity_token:create, member:journey:read. The response is the only place the full secret_key is returned, so store it immediately. This endpoint requires a user session. API keys cannot manage API keys.
Request
- Base URLhttps://api.whop.com/api/v1
- AuthHTTP bearer
Headers
Pins the request to a dated API version.
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
Dated API version used when requests authenticated with this key omit the Api-Version-Date header. New keys default to the latest version.
When the API key should stop working, as an ISO 8601 timestamp. Omit (or pass null on update) for a key that never expires.
IPv4/IPv6 CIDR ranges allowed to use this key, for example ["203.0.113.0/24"]. Empty or null allows any IP.
A human-readable name for the API key, such as 'Production API Key'.
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).
The account (biz_), app (app_), or your own user (user_) tag to create the API key for.
The type of resource that will own this API key.
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 (production)",
"permissions": {
"statements": [
{
"actions": [
"company:basic:read"
],
"grant": true,
"resources": [
"biz_xxxxxxxxxxxxxx"
]
}
],
"system_role": "admin"
},
"resource_id": "biz_xxxxxxxxxxxxxx",
"resource_type": "account"
}Response
api key created
Dated API version used when requests authenticated with this key omit the Api-Version-Date header.
When the API key was created, as an ISO 8601 timestamp.
When the API key stops working, as an ISO 8601 timestamp. null means it never expires.
API key ID, prefixed apik_.
Whether this is the resource's default API key. Default keys cannot be updated or deleted, only rotated.
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.
Human-readable name identifying the API key, or null when none was set.
Masked version of the secret key, so the key can be recognized without revealing the full secret.
The full secret used to authenticate requests. Returned only once, on create and rotate responses — store it immediately.
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.
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-30enum value to theapi_version_dateresponse property for the response status - info
added the new
2026-11-30enum value to the request propertyapi_version_date
- warning
- warning
added the new
2026-11-25enum value to theapi_version_dateresponse property for the response status
1 more change in this revision
- warning