v8

OpenAPI 3.1.02026-08-033623795.0 MB
API Keys

Create API Key

Creates an API key for an account or app. The response is the only place the full secret_key is returned — store it immediately. Requires a user session; API keys cannot manage API keys.

post/api_keys

Headers

Idempotency-Keystring
Example:d9105228-4a08-46b1-8b91-42fed586d383

A unique key that makes this request safe to retry. See Idempotent requests.

Request body

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 required

A human-readable name for the API key, such as 'Production API Key'.

resource_idstring required

The account (biz_) or app (app_) tag to create the API key for.

resource_type'account' | 'app' required

The type of resource that will own this API key.

Response

api key created

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

{
  "system_role": "owner"
}