Automate sites, cache purges and security settings. All requests use HTTPS; requests and responses are JSON.
Base URL: https://api.cdnen.com/v1 Available on Advanced plans and above.
Create a token in the console under Account → API Token and send it in every request:
| Scope | Allowed |
|---|---|
Purge only purge | List sites (id and domain only), purge, preheat |
Read only read | Read sites, analytics, attacks, IP rules, SSL |
Security security | Read + purge + security level, WAF, IP rules |
Full full | Everything above + create, update, delete sites (no billing or account changes) |
Errors return { "error": "…" }.
| HTTP | Meaning |
|---|---|
| 400 | Invalid parameters |
| 401 | Token invalid, disabled or expired |
| 403 | Scope not allowed, IP not allowed, or plan has no API |
| 404 | Site not found or not allowed for this token |
| 429 | Too many requests (600 per minute per token) |
status:pending waiting for DNS/active active/stopped paused/suspended plan expired
| Field | Description |
|---|---|
| domain | Domain, e.g. www.example.com; use a domains array for several |
| origins | Origin IPs or hostnames, e.g. ["203.0.113.10"] |
| add_www | true to also add www |
| plan_id | Plan subscription to use (optional) |
| proto | Origin protocol: follow / http / https |
| level | Security level (see below) |
Point your DNS CNAME to the cname in the response.
| Field | Description |
|---|---|
| origins | Replace origins |
| status | active / paused |
| proto, http_port, https_port | Origin protocol and ports |
| waf, auto_ssl | true/false |
| Field | Description |
|---|---|
| urls | URLs to purge, max 100; full URL or /path |
| dirs | Directories, e.g. /images/ |
| all | true purges the whole site |
Daily limits are the same as in the console (2,000 URLs, 100 directories, 50 full purges).
Field urls:URLs to fetch into edge cache, max 100.
| Field | Description |
|---|---|
| level | loose / normal / strict / attack (under attack) |
| waf | true/false |
| Field | Description |
|---|---|
| action | block or allow |
| ip / ips | One IP or an array; CIDR allowed, e.g. 198.51.100.0/24 |
| note | Note (optional) |
rule_id looks like block:198.51.100.7 or allow:203.0.113.0/24; use the id from the list.
range:1h/24h/7d/30d. Returns totals (requests, bytes, cache hits, blocked) and a time series.
Recently blocked requests: time, IP, country, type, rule, URL. secs up to 30 days, limit up to 300; filter with ip.
status:ok issued/pending pending/renew renewing/error failed, see error/none no certificate
After the form is submitted, verify cdnen-hv-token on your server with the widget secret (Console → Human verification). No API token needed; JSON or form encoding both work.
Do not process the form unless ok is true. On failure, error is invalid-secret, invalid-token, expired (older than 5 minutes), already-used or ip-mismatch.
In the page: <script src="https://www.cdnen.com/hv.js" async></script> plus <div class="cdnen-hv" data-key="hv_…"></div> inside your form. Optional data-callback (function name called on success) and data-theme="dark".
{"hosts":["www.amy-shop.com","shop.bobtea.tw"]}Ask your customer to CNAME their hostname to this site's domain; SSL is issued automatically once verified. status: pending waiting for CNAME / active / lost CNAME removed, disabled. Up to 100 per site.