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_adminaccount. - Know the IP ranges (CIDR) the API will be called from (required — see Configuration fields).
How to configure
- Go to Users → API keys tab.
- Click New API key. Enter a Name, select Scopes (
purgeand/orwarm), enter Allowed IPs (CIDR), and optionally an Expiration. - Click Create. The system shows the raw key
vk_…only once. - 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.
- 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
| Field | Meaning | Values | Default | Notes |
|---|---|---|---|---|
| Name | Display name of the key | Not empty, ≤100 characters | — | Empty → 400 |
| Scopes | Key permissions | Checkboxes purge, warm | — | You must select at least 1, otherwise 400 |
| Allowed IPs (CIDR) | IP ranges allowed to use the key | List 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 |
| Expiration | Expiry time | RFC3339, or empty | Empty = never expires | After 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
| Symptom | Cause | Fix |
|---|---|---|
| 400 "at least one scope is required" | No scope selected | Check purge and/or warm |
| 400 "allowed_ips must not be empty" | Allowed IPs left empty | Enter 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 /nn | Add a prefix, for example 10.0.0.1/32 |
| 400 "at most 50 CIDR entries" | More than 50 ranges entered | Consolidate to ≤50 |
| API call returns 401 | Key expired, invalid key, or organization disabled | Check Expiration / create a new key / check the organization's status |
| API call returns 403 from one IP | The IP is not in Allowed IPs | Add 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).