Skip to main content

API Keys — keys for automating Purge/Warm

Part of the "Tenant administration" group. This section is for admins who manage multiple sub-organizations or many users. If you only use the portal manually, you can skip it.

The API keys tab (on /users) lets you create vk_ API keys (v2) to call cache purge/warm operations automatically from CI/CD or scripts, without logging in to the portal.

Use it when: you want your build system to purge the cache automatically after each deploy, or to warm the cache on a schedule. Example: your pipeline calls POST /apiv2/domains/<domain>/purge with a vk_ key after releasing a new version.

vk_ (v2) keys only work on the /apiv2/domains/{domain}/{purge,warm} endpoints — they are meant for cache automation. For purge modes, limits (purge ≤100 values, warm ≤1000 URLs), and rate limits, see Purge & Warm; for daily limits, see Quota.

Before you start​

  • An org_admin account.
  • Know the IP ranges (CIDR) the API will be called from (required — see Configuration fields).

How to configure​

  1. Go to Users → API keys tab.
  2. Click New API key. Enter a Name, select Scopes (purge and/or warm), enter Allowed IPs (CIDR), and optionally an Expiration.
  3. Click Create. The system shows the raw key vk_… only once.
  4. Copy it and store it right away in a safe place (a secret manager). Once you close the dialog, you cannot retrieve it — only the first 12 characters (the prefix) remain visible.
  5. Use the key in your script (header Authorization: Bearer vk_…).

Edit the allowed IP list: click Edit on the key's row → enter one IP or CIDR per line (up to 50, at least 1 required) → Save. The key value stays the same; only the allowed IP ranges change. The change takes effect immediately and is recorded in the audit log. Revoked keys cannot be edited.

Delete a key: open the API keys tab → click Delete on the key's row. Deletion is permanent; the key stops working immediately.

Configuration fields​

FieldMeaningValuesDefaultNotes
NameDisplay name of the keyNot empty, ≤100 characters—Empty → 400
ScopesKey permissionsCheckboxes purge, warm—You must select at least 1, otherwise 400
Allowed IPs (CIDR)IP ranges allowed to use the keyList of CIDRs, ≤50—At least 1 required (empty = deny all). Each entry must be a valid CIDR (with /nn); a bare IP without /nn → 400. Prefix ≥ /8 (IPv4) / ≥ /32 (IPv6); anything broader (for example 0.0.0.0/0) → 400
ExpirationExpiry timeRFC3339, or emptyEmpty = never expiresAfter expiry, every call with the key returns 401
Raw key (system-generated)vk_ + 32 hex characters——Shown once on creation; after that, only the 12-character prefix remains. The full key is not stored and cannot be shown again

Other API key types: this tab only creates purge/warm keys. If you need API access for other operations, contact your provider.

Scope and security notes​

  • A key only acts within your organization (the key records the creator's organization).
  • Empty Allowed IPs = block everything — always enter the correct IP ranges for your CI/CD.
  • The raw key is shown only once: if you lose it, create a new key and delete the old one; there is no "view again" function.
  • Deleting a key takes effect immediately (the record is permanently removed), not just temporarily disabled.

Troubleshooting​

SymptomCauseFix
400 "at least one scope is required"No scope selectedCheck purge and/or warm
400 "allowed_ips must not be empty"Allowed IPs left emptyEnter at least 1 CIDR
400 "CIDR prefix too broad"Range broader than /8 (v4) or /32 (v6)Narrow the range (for example 203.0.113.0/24)
400 "invalid CIDR"Entered a bare IP without /nnAdd a prefix, for example 10.0.0.1/32
400 "at most 50 CIDR entries"More than 50 ranges enteredConsolidate to ≤50
API call returns 401Key expired, invalid key, or organization disabledCheck Expiration / create a new key / check the organization's status
API call returns 403 from one IPThe IP is not in Allowed IPsAdd that IP range to the key

FAQ​

  • Can I view a raw key again after creating it? No. It is shown only once at creation; after that, only the first 12 characters remain. If you lose it, create a new key.
  • What can a vk_ key do? Only purge/warm the cache through /apiv2/.... Other operations require a portal login.
  • Why is an IP list required? To reduce risk if the key leaks — only IPs in the list can use it.
  • Do keys expire automatically? Only if you set an Expiration; leaving it empty means the key never expires (we recommend setting an expiry and rotating keys regularly).