clx management API
Everything the clx.cx app does goes through these endpoints: connect a Cloudflare account, install the clx-edge worker into it, add sites and take their counter snippet, make short links with rules and QR codes, read reports. An agent setting clx up for a person starts at clx for AI agents.
The same contract, machine-readable: openapi.yaml · openapi.json (OpenAPI 3.1.0). This page as markdown: /api.md, or Accept: text/markdown.
Conventions
- Base URL
https://clx.cx, JSON in and out. - Authentication
Authorization: Bearer clx_…— an API key: one on the free plan, up to 5 on Pro (theapiplan: higher limits, $9 per 30 days from the balance — pricing). A person issues them in the app (Keys) with the scopes the key needs:accounts(connect, renew, disconnect, install),sites,links,reports,billing(the balance and Pro; a key never moves partner money). A key may also be limited to some Cloudflare accounts and client IPs; without an account list it reaches every account of its user, those connected later too, and the lists of a live key can be changed. Another user's object answers404; a scope the key lacks,403 scope_required. - Idempotency Every
POST,PUT,PATCHandDELETEtakes anIdempotency-Keyheader, required with an API key. A repeat with the same key and body replays the first answer for 24 hours and does nothing again; the same key with another body is409 idempotency_conflict. Use a new key per intended action, the same key for its retries. - Long operations Connecting an account and installing the worker answer
202with the object as it is; poll itsGETevery few seconds until the state settles.409 operation_in_progressmeans another operation on that Cloudflare account is running — retry shortly. - Rate limits 120 requests a minute per key; over it,
429withRetry-Afterin seconds. Reports read the account's own database for breakdowns and for a link's live days — 30 such reads a minute per clx user, each cached 5 minutes; over that the report still answers200, without them, andunavailablesaysrate_limited: wait a minute and ask again. - Errors
{"error": {"code", "message", "details"?}}. The codes are stable — branch oncode, showmessageto the person. Stable codes: unauthorized,invalid_request,not_found,payload_too_large,limit_reached,service_full,idempotency_conflict,operation_in_progress,scope_required,session_required,key_already_issued,account_taken,already_connected,account_not_ready,invalid_bootstrap,bootstrap_permission_error,permission_catalog,orphan_not_deleted,token_rights_mismatch,token_check_failed,renew_lost,rate_limited,cloudflare_unavailable,not_configured, internal. In an account's or operation'serror(the install, §4):name_taken,resource_drift,cron_limit,permission_error, revoked,self_check_timeout,credentials_missing,credentials_unreadable(clx cannot open the stored token),cloudflare_error. Sites:zone_not_found,site_exists,route_conflict,site_not_active,update_required(external sites, or link rules with bots, need a newer clx-edge),route_not_ours(a route clx made was changed outside clx and left in place). Sign-up:email_unconfirmed(POST /v1/accounts before the address is confirmed),invalid_password,balance_not_empty(DELETE /v1/me while money is on the balance or the partner wallet or still moving, §18). Billing (docs/spec.md §18):insufficient_balance(Pro needs $9 on the balance),invoice_limit(3 pending top-ups),payments_unavailable(crypto top-ups not set up or the processor down),refund_unavailable(a top-up never credited, older than 90 days or refunded already),refund_open(a refund of that top-up is asked for already), paused (an object beyond the free plan's limits: it can be read and deleted, not changed). Links:link_exists(the code is taken on that link host),link_host_not_ready(links go on an active host only),link_host_in_use(DELETE /v1/link-hosts/{id} while live links are on it),rule_unreachable(a rule that one above it takes every visitor of; details: fieldrules[j],shadowed_byi). In a link host'serror:dns_record_exists(the named host already has a DNS record — never taken over),domain_taken(another worker's custom domain),domain_not_ours.
You and your API keys
GET /v1/me
The caller — user, plan, limits, current use
Sign-up, e-mail confirmation and password reset are not part of /v1: they live under /auth with the page session (docs/spec.md §9). Until email_confirmed, POST /v1/accounts answers email_unconfirmed.
Answers:
200OK —user: object,plan: one offree,api,limits: object,use: object,via: one ofsession,key,telegram,telegram: object | null
PATCH /v1/me
Set the user's language (page session only; also the Telegram bot's /lang)
The app after sign-in and every e-mail of clx speak it; sign-up sets it to the language of the page signed up from.
Body (JSON):
locale(required): one ofen,ru
Takes an Idempotency-Key header — required with an API key.
Answers:
200Set —locale: one ofen,ru
DELETE /v1/me
Delete the account (page session only, with the password)
Every connected Cloudflare account is disconnected first (clx-edge, its database and routes removed where the token still can — what could not be is listed in left, the working tokens to revoke in revoke_tokens); then the totals go at once, and the user with the keys, sites and links. Refused with balance_not_empty while money is on the balance or the partner wallet, or a payment, refund or payout is open, a referral's deposit is under 90 days old or has no commission yet, or a referral's refund is open (docs/spec.md §18); the journal is kept for accounting without the address.
Body (JSON):
password(required): string
Takes an Idempotency-Key header — required with an API key.
Answers:
200Deleted —ok: boolean,left: array of string,revoke_tokens: array of string
DELETE /v1/me/telegram
Unlink the Telegram linked to the account (page session only)
The Telegram bot (docs/spec.md §17) acts for the account it is linked to; this ends the link. A password reset ends it too.
Takes an Idempotency-Key header — required with an API key.
Answers:
200Unlinked —ok: boolean
GET /v1/keys
API keys (page session only)
Answers:
200OK —keys: array of Key
POST /v1/keys
Issue an API key (page session only; 1 on the free plan, 5 on api — limit_reached over it); the key is in this answer only
Body (JSON):
scopes(required): array of one ofaccounts,sites,links,reports,billingallow_accounts: array of string,^[0-9a-f]{32}$allow_ips: array of string
Takes an Idempotency-Key header — required with an API key.
Answers:
201Issued —keyis shown once409key_already_issued— a replay of the same Idempotency-Key
PATCH /v1/keys/{id}
Change an API key's allow lists in place (page session only); the key itself stays
A field left out stays as it is; null lifts the limit — every Cloudflare account of the user, those connected later too, or every IP.
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Body (JSON):
allow_accounts: array of string,^[0-9a-f]{32}$| null — At most the plan's Cloudflare accountsallow_ips: array of string | null, up to 20
Takes an Idempotency-Key header — required with an API key.
Answers:
200The key as it is now — Key
DELETE /v1/keys/{id}
Revoke an API key (page session only)
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Takes an Idempotency-Key header — required with an API key.
Answers:
200Revoked
Cloudflare accounts
GET /v1/accounts
Connected Cloudflare accounts (scope accounts or sites)
Answers:
200OK —accounts: array of Account
POST /v1/accounts
Connect a Cloudflare account with a bootstrap token (scope accounts)
The bootstrap token (Account Settings — Read + Account API Tokens — Edit, which the API names Write; one day) is used within this request and deleted; it is never stored. The account then goes on to the install of clx-edge (§4) — poll GET for its state: installing, then ready once the script, its database and cron are in place (seconds; the worker's own confirmation may follow minutes later, or never — then error.warnings says not_confirmed), or connected with an error.
Body (JSON):
cf_account_id(required): string,^[0-9a-f]{32}$bootstrap_token(required): string
Takes an Idempotency-Key header — required with an API key.
Answers:
202Connected —account: Account
GET /v1/accounts/{id}
One connected account (scope accounts or sites), with its latest operation and link host
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Answers:
200OK —account: Account
DELETE /v1/accounts/{id}
Disconnect (scope accounts) — delete clx-edge and its database, then the record
The answer names the working token to revoke in Cloudflare (it cannot delete itself), and in left whatever clx could not delete — the token is revoked, a right is missing, or the worker was changed outside clx — for the user to remove by hand.
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Takes an Idempotency-Key header — required with an API key.
Answers:
200Disconnected —ok: boolean,revoke_token: string | null,left: array of string
GET /v1/accounts/{id}/zones
The account's zones (scope accounts or sites) — to pick a site's or link host's zone from
Read live from Cloudflare with the working token, sorted by name; at most 1,000, truncated past that. A host is still checked against its zone when it is added.
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Answers:
200OK —zones: array of object,truncated: boolean
POST /v1/accounts/{id}/install
Install clx-edge again (scope accounts) — after a failed install, or to reinstall
The recorded database is kept; the worker gets a new key (the previous one is accepted for a day). A clx-edge worker or database clx did not create is never touched (name_taken), nor a worker changed outside clx (resource_drift). Poll GET for the state.
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Takes an Idempotency-Key header — required with an API key.
Answers:
202Started —account: Account
POST /v1/accounts/{id}/token
Renew the working token with a new bootstrap token (scope accounts)
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Body (JSON):
bootstrap_token(required): string
Takes an Idempotency-Key header — required with an API key.
Answers:
200Renewed
Sites
GET /v1/sites
Sites (scope sites); account_id narrows to one account
Parameters:
account_id(query): string
Answers:
200OK —sites: array of Site
POST /v1/sites
Add a site (scope sites) — the zone is found in the account, the route made, the config synced
The account must be ready. The answer carries the snippet at once; config turns synced once the worker has the site (seconds), and the counter answers from then on.
With collector_host it is an external site — one not on Cloudflare (Pro only, docs/spec.md §5): its host must be in no zone of the account (invalid_request), the route is made on collector_host, a host of the account's zones that already answers through Cloudflare (clx makes no DNS record) and is no link host. Its snippet sends a CORS request to that host, so a page whose CSP limits connect-src (or script-src, for the tag) must allow it. limit_reached (limit 0) on free; update_required while the account's clx-edge predates external sites; operation_in_progress while another operation holds the account.
Body (JSON):
account_id(required): stringhost(required): string — example.com or a subdomain of a zone in that account; withcollector_host, a host in nonecollector_host: string — makes an external site: a host of a zone in that account, other than hostexcluded_paths: array of string,^/, up to 50
Takes an Idempotency-Key header — required with an API key.
Answers:
202Added —site: Site
GET /v1/sites/{id}
One site (scope sites)
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Answers:
200OK —site: Site
PATCH /v1/sites/{id}
Change the excluded paths (scope sites)
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Body (JSON):
excluded_paths: array of string,^/, up to 50
Takes an Idempotency-Key header — required with an API key.
Answers:
200Changed —site: Site
DELETE /v1/sites/{id}
Remove the site's routes (scope sites); the site stays as deleted, its totals with it
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Takes an Idempotency-Key header — required with an API key.
Answers:
200Deleted —site: Site
POST /v1/sites/{id}/rotate
A new path, names and snippet (scope sites); the old path is counted for 30 more days
An external site keeps its path for life (invalid_request).
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Takes an Idempotency-Key header — required with an API key.
Answers:
200Rotated —site: Site
Link hosts and links
GET /v1/link-hosts
Link hosts (scope links); account_id narrows to one account
Parameters:
account_id(query): string
Answers:
200OK —link_hosts: array of LinkHost
POST /v1/link-hosts
Add a link host (scope links) — one per site if wished; clx makes it a custom domain of clx-edge
{site_id} makes <label>.<site host> (a leading www. dropped) with a random label of 3 characters; {account_id, host} takes a host you name, in one of the account's zones. The account must be ready. clx makes the host a Workers Custom Domain of clx-edge: Cloudflare creates its DNS record and certificate, so you create no record. A host that already has a DNS record is never taken over: a random label is tried again with another, a named host ends conflict (dns_record_exists). Answers 202; poll GET until state is active and config is synced (usually seconds). Up to the plan's site limit per user. An external site has no zone for {site_id} (invalid_request), and a site's host or collector host cannot be a link host.
Body (JSON):
site_id: string — the site to make a host for; aloneaccount_id: string — with hosthost: string — withaccount_id: a host of a zone in that account, such as k7q.example.com
Takes an Idempotency-Key header — required with an API key.
Answers:
202Started —link_host: LinkHost
GET /v1/link-hosts/{id}
One link host (scope links)
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Answers:
200OK —link_host: LinkHost
DELETE /v1/link-hosts/{id}
Delete a link host (scope links) — refused while live links are on it; its custom domain and DNS record go
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Takes an Idempotency-Key header — required with an API key.
Answers:
200Deleted —link_host: LinkHost
GET /v1/links
Links (scope links); account_id narrows to one account
Parameters:
account_id(query): string
Answers:
200OK —links: array of Link
POST /v1/links
Add a short link (scope links) on one of the account's link hosts
A click is a 302 to the first matching rule's URL, else url; it is counted as a view of the link, with source qr when the address carries ?q (the QR code's) — or as a bot when the client is one (curl, a script, a crawler: it is redirected all the same, by a rule with its category if there is one), in the report's bots breakdown and not among the destinations. config turns synced once the worker has the link (seconds).
Body (JSON):
link_host_id(required): string — the link host it lives on (POST /v1/link-hosts)code: string,^[A-Za-z0-9_-]{3,32}$— a random 6 characters when not givenurl(required): string (uri) — https:// only, up to 2048 characters, not on a link host of the accountrules: array of Rule, up to 10
Takes an Idempotency-Key header — required with an API key.
Answers:
201Added —link: Link
GET /v1/links/{id}
One link (scope links)
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Answers:
200OK —link: Link
PATCH /v1/links/{id}
Change the URL or the rules (scope links); the code stays
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Body (JSON):
url: string (uri)rules: array of Rule, up to 10
Takes an Idempotency-Key header — required with an API key.
Answers:
200Changed —link: Link
DELETE /v1/links/{id}
Remove the link (scope links); its code is freed, the link stays as deleted with its totals
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Takes an Idempotency-Key header — required with an API key.
Answers:
200Deleted —link: Link
GET /v1/links/{id}/qr.svg
The QR code of the link (scope links) — an SVG of https://<link host>/<code>?q
The ?q makes a scan count with source qr; the worker does not pass it on. One <rect> and one <path>, integer coordinates, a quiet zone of 4 modules, error correction M. Without size the SVG has no width and height and scales to its container. It carries the link's own host, which never changes; deleting that host stops its printed codes.
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$size(query): integer, 64–9999 — pixels
Answers:
200The SVG — string
Reports
GET /v1/sites/{id}/report
Totals and series of the site (scope reports); with breakdowns=1 also the top pages, sources, countries, devices, browsers, OS and bots
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$period(query): one oftoday,7d,30dbreakdowns(query): one of1— read the breakdowns from the account's database (cached 5 minutes)
Answers:
200OK —report: Report
GET /v1/links/{id}/report
Clicks of the link (scope reports); with breakdowns=1 also sources, countries, devices, browsers, OS, bots, its destinations (in pages: where the clicks were sent, by rule or the main URL) and flows, sources and destinations together
Closed days come from clx.cx; today (and any day the worker has not sent yet) is read live from the account's own database in one read with the breakdowns — as_of is the moment of that read (cached up to 5 minutes, so it can be that much older than the answer). When that database cannot be read, the totals hold clx.cx's days only, the series of today is empty and unavailable says why. incomplete is always false: a link's days are never refused.
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$period(query): one oftoday,7d,30dbreakdowns(query): one of1
Answers:
200OK —report: Report
Balance and Pro
GET /v1/billing
The balance, Pro and the last 50 journal rows (scope billing)
Money is integer micro-USD (1 USD = 1,000,000). Pro — the api plan — is $9 per 30 days, charged by the UTC day from the balance (docs/spec.md §18).
Answers:
200OK — Billing
POST /v1/billing/invoices
A crypto top-up (scope billing)
Whole dollars, 9 to 1,000, in one of four coins; at most 3 pending whose hour has not run out (invoice_limit). The answer has the address and the exact amount to send, fees included, for an hour; what arrives is credited, partial payments go to an operator. Needs a confirmed e-mail. payments_unavailable when the processor is not set up or did not answer. Telegram Stars are paid in the bot (/pay), not here.
Body (JSON):
usd(required): integer, 9–1000coin(required): one ofUSDT_TRC20,USDT_BSC,USDT_ERC20,USDC_ERC20
Takes an Idempotency-Key header — required with an API key.
Answers:
201Made —invoice: Invoice
GET /v1/billing/invoices/{id}
A top-up and its state (scope billing)
Parameters:
id(path, required): string,^[A-Za-z0-9_-]{1,64}$
Answers:
200OK —invoice: Invoice
POST /v1/billing/refunds
Ask for a refund of a top-up (page session only)
A credited top-up under 90 days old, one open request per top-up (refund_open). An operator makes it: at most what that top-up brought in less what was refunded from it, and never more than the balance. Crypto goes, less the network fee, to address — yours, on the network the top-up came by (Tron for USDT_TRC20, an 0x address for the others); Stars go back whole, in Telegram, with no address.
Body (JSON):
invoice_id(required): stringaddress: string
Takes an Idempotency-Key header — required with an API key.
Answers:
201Asked —refund: Refund
POST /v1/billing/pro
Switch Pro on or off (scope billing)
On needs a confirmed e-mail and at least $9 on the balance (insufficient_balance), and charges today; a day is charged once, however often Pro is switched. Off ends Pro after today (or at its first unpaid day, which is then not owed); the account returns to free and what is beyond its limits is paused, not deleted.
Body (JSON):
on(required): boolean
Takes an Idempotency-Key header — required with an API key.
Answers:
200Switched — Billing
Partners
GET /v1/partner
The partner program — your code, links, referrals and wallet (scope billing)
Every user is a partner (docs/spec.md §19): 30% of each credited top-up of the people you referred, for life, one level, held 30 days. Your links: https://clx.cx/?ref=CODE and the bot's start=ref_CODE. Money is integer micro-USD; the wallet's available sum leaves out commissions still held, and a refund of a referral's top-up takes its share back (clawback), which may take the wallet below zero.
Answers:
200OK — Partner
POST /v1/partner/transfer
Move money from the partner wallet to your clx balance (page session only)
At most what is available; needs a confirmed e-mail and an Idempotency-Key (insufficient_balance when the wallet does not have it).
Body (JSON):
usd(required): number — dollars, at most cents
Takes an Idempotency-Key header — required with an API key.
Answers:
200Moved — Partner
POST /v1/partner/payouts
Ask for a payout in USDT TRC-20 (page session only)
From $20, to a Tron address, at most what is available; its money is reserved at once and an operator sends it by hand, or refuses it and the money returns. Needs a confirmed e-mail and an Idempotency-Key.
Body (JSON):
usd(required): number, 20–100000 — dollars, at most centsaddress(required): string — a USDT TRC-20 (Tron) address
Takes an Idempotency-Key header — required with an API key.
Answers:
201Asked — object
Objects
Key
id: stringprefix: stringscopes: array of one ofaccounts,sites,links,reports,billingallow_accounts: array of string | nullallow_ips: array of string | nullcreated_at: string (date-time)last_used: string (date) | nullpaused_at: string (date-time) | null — set while the key is beyond the free plan's limits (docs/spec.md §18): it is refused until Pro is on again
Account
id: stringcf_account_id: stringname: stringstate: one ofpending,bootstrap_lost,connected,installing,ready,permission_error,revoked,resource_drift,no_connection— pending — the connect is running, or stopped on a passing failure (5xx other thantoken_rights_mismatch,token_check_failed,permission_catalog, which end it) and waits for the same request again (same Idempotency-Key);bootstrap_lost— a connect left pending for an hour, or one that died before clx stored its working token: revoke the token its error names and connect again; connected — token ready, clx-edge not installed; installing — the install runs; ready — installed and serving, go on (the worker confirms itself on its first cron: meanwhileoperationshows the install at step selfcheck, for up to 15 minutes, and if no confirmation comes error.warnings saysnot_confirmed— nothing to wait for either way);no_connection— installed, but no push from the worker for 26 hours (sites can still be added; its next push makes it ready again)token: object | nullname: string — clx-<operation id>expires_at: string (date-time)
error: object | null — code and details, or warnings such asbootstrap_not_deletededge: object | null — The installed clx-edge, from its upload on (the worker's own confirmation is not needed)bundle: string — sha256 of the bundleup_to_date: booleanschema: integerinstalled_at: string (date-time)
push: object | null — The worker's own report from its last push of totals (hourly)at: string (date-time)bundle: string — sha256 of the bundle the worker runsschema: integer | nullqueue: integer — queue parts and final days waiting to be senterror: string | null — the worker's last errordropped: object — items dropped unsent, by reason: budget, invalid,unknown_target,too_old, busy, expired
advice: object | null — When to move this Cloudflare account to Workers Paid, from its measured use over the last 7 complete UTC days; on an account already on Workers Paid (paid), only the current size of clx-edge; recomputed daily, null until first computedlevel: one ofok,watch,upgrade_soon,over— the worst metric: over — a limit was reached (or the database is at backpressure, 400 MB);upgrade_soon— busiest day ≥ 80% or the limit within 7 days; watch — ≥ 60% or within 30 daysmetric: one ofrequests,writes,reads,size, or nullmetrics: object — requests, writes, reads — per day for the whole account, against 100,000 / 100,000 / 5,000,000; size — clx-edge now, against 500 MB (on Workers Paid against 400 MB, where the worker stops keeping details)unavailable: array of one ofanalytics,size— what could not be read — not guessedsuggest: one ofshorter_hourly_retention— size alone is the problempaid: one oftrue— the account is on Workers Paid (read from its entitlements): requests, writes and reads are not judged — no daily limit stops them — only size is, and no e-mail is sentat: string (date-time)
operation: object | null — The latest operation on the account (GET /v1/accounts/{id} only)kind: one ofconnect,renew,install,update,disconnectstate: one ofrunning,done,failedstep: stringerror: object | nullupdated_at: string (date-time)
link_hosts: array of LinkHost — The account's link hosts (GET /v1/accounts/{id} only)paused_at: string (date-time) | null — set while the account is beyond the free plan's limits (docs/spec.md §18): its sites and links are withdrawn from the worker, nothing new can be addedcreated_at: string (date-time)
LinkHost
id: stringaccount_id: stringsite_id: string | null — the site it was made for; null for a host the user namedhost: string — k7q.example.com — a random 3-character label under the site's host, or the named hoststate: one ofpending,active,conflict,deleted— pending — its custom domain is being made (the cron retries); active — Cloudflare made it, with its DNS record and certificate; conflict — see errorconfig: one ofpending,synced— whether the worker has it yet; short links answer once active and syncederror: object | nullcreated_at: string (date-time)
Rule
Matches when the visitor's country is in countries (if given), their device in devices (if
given) and, if bots is given, the visitor is a bot of one of those categories (by its
User-Agent). At least one of the three. A rule with bots never takes a browser; a rule without
it takes bots too, so put a bots rule above the others. A bots rule needs a clx-edge that
knows it: on an older one the request is refused with update_required. A rule that one rule
above it takes every visitor of (each of its conditions absent or holding all of this one's,
both devices counting as none) would never be used: the list is refused with 409
rule_unreachable, details {field: "rules[j]", shadowed_by: i} — say DE above "search bots
in DE", or any rule twice. Rules covered only by several above together are let through.
countries: array of string,^[A-Z]{2}$, up to 250devices: array of one ofmobile,desktopbots: array of one ofsearch,ai_training,monitoring,ad_review,social_preview,headless,other— bot categories, as the bots breakdown of a report names themurl(required): string (uri) — https:// only, up to 2048 characters, not on a link host of the account
Link
id: stringaccount_id: stringlink_host_id: stringcode: string — unique on its link hostshort_url: string | null — https://<link host>/<code>url: string — where it leads when no rule matchesrules: array of Rule, up to 10 — the first match winsstate: one ofactive,deletedconfig: one ofpending,synced— whether the worker has this version of the link yetpaused_at: string (date-time) | null — set while the link is beyond the free plan's limits (docs/spec.md §18): it answers 404 and cannot be changedclicks_7d: integer — clicks of the last 7 closed UTC days (GET /v1/links only, and only with the reports scope)created_at: string (date-time)
Site
id: stringaccount_id: stringhost: stringkind: one ofzone,external— zone — the host is in a zone of the account and the counter answers on it; external — a site not on Cloudflare (Pro), counted oncollector_host(docs/spec.md §5)collector_host: string | null — an external site's: the host of the account's zones its beacons go to; null for zonestate: one ofroute_pending,active,route_conflict,deleted—route_pending— the route is still to be made (the cron retries);route_conflict— another worker holds the pattern, see errorpath: string — the per-site path the counter answers under, e.g. /lumora or /kavi/tesomusnippet: object | null — Embed one of the two at build time; stable until rotate (an external site is never rotated)inline: string — <script>…</script>, under 600 bytes for a zone site; an external site's also names its collector hostscript_tag: string — <script src="/<path>/<s>.js"> with defer (the order of the attributes varies by site); an external site's src is https://<collector_host>/<path>/<s>.js
excluded_paths: array of stringconfig: one ofpending,synced— whether the worker has this version of the site yetpaused_at: string (date-time) | null — set while the site is beyond the free plan's limits (docs/spec.md §18): it is not counted and cannot be changedretiring: array of object — old paths still counted after a rotationerror: object | nullcreated_at: string (date-time)views_7d: array of integer, up to 7 — views of each of the last 7 closed UTC days, oldest first (GET /v1/sites only, and only with the reports scope)views_today: integer — today's views so far, as of the last hour the worker sent (GET /v1/sites only, and only with the reports scope)counted: boolean — whether the counter has counted a view of this site yet (GET /v1/sites only, and only with the reports scope)
Top
the top 10 by count; "(other)" holds what went over the detail caps
array of object, up to 10 — each with key, n
Report
period: one oftoday,7d,30dfrom: string (date) — first UTC dayto: string (date) — last UTC day — todayas_of: string (date-time) | null — today is counted up to this moment. A site: the end of the latest closed hour the worker sent (hours arrive up to an hour late), null before its first push. A link: the moment of the live read of the account's databasetotals: objectviews: integerbots: integervisitors: integer — the sum of daily unique visitors
series: array of object — today — one point per hour up toas_of; 7d/30d — one per day (with visitors)incomplete: boolean — today's hours were refused over the account's write budget; daily totals stay exactbreakdowns: object | null — only with breakdowns=1; read from the account's own database, null when unavailablepages: Topsources: Topcountries: Topdevices: Topbrowsers: Topos: Topbots: Topflows: array of object, up to 200 — a link only: clicks by source and destination together, the top 200 by count.tois where the clicks were sent: the matched rule's conditions and URL,AT,DE;mobile>https://…(sorted; past 40 countries the first 40 and+N#<fingerprint of the whole list>), or>https://…for the main URL (the first 512 characters, also the keys of a link'spages); "" for clicks counted by a worker that did not record it yet, "(other)" for what went over the detail caps
unavailable: one ofnot_installed,cloudflare,rate_limited— why breakdowns (and a link's today) are not there: the worker is not installed or the token is gone; Cloudflare failed or took over 5 s; over 30 reads of the account databases a minute for this clx user (each cached 5 minutes)
Billing
balance_micro_usd: integerpro: objecton: boolean — Pro is on — paid, or given by an operatorgiven: boolean — given by an operator: never chargedsince: string (date) | null — the first day of the open periodpaid_through: string (date) | null — the last day of the unbroken run of paid daysgrace_until: string (date-time) | null — a day is unpaid: Pro works until then; still unpaid, the account returns to freeprice_micro_usd: integer — 9,000,000 — per 30 daysday_micro_usd: integer — 300,000 — what a day costs
journal: array of object — the last 50 rows, newest firstinvoices: array of object — the last 10 top-ups, newest firstrefunds: array of Refund — the last 10 refund requests, newest first
Partner
code: string — your partner codelinks: objectsite: string — clx.cx with ?ref=bot: string | null — the Telegram bot with start=ref_
rate_bp: integer — the commission, basis points (3000 = 30%)hold_days: integerpayout_min_micro_usd: integerreferrals: integer — accounts made with your codewallet: objecttotal_micro_usd: integeravailable_micro_usd: integer — may be below zero after a clawbackheld_micro_usd: integer
journal: array of object — the last 50 rows, newest firstpayouts: array of object — the last 10, newest first
Refund
id: stringinvoice_id: string — the top-up refundedrail: one ofcrypto,starsaddress: string | null — where crypto goes; null for Starsstatus: one ofrequested,pending,done,declined— pending: taken from the balance, on its wayamount_micro_usd: integer | null — taken from the balance, once an operator made it; crypto is sent less the network feetxid: string | null — the crypto transfer, once sentcreated_at: string (date-time)settled_at: string (date-time) | null
Invoice
id: stringrail: one ofcrypto,starsusd_micro_usd: integer — the nominal; what is credited is what arrivedcoin: string — USDT_TRC20, USDT_BSC, USDT_ERC20, USDC_ERC20; XTR for Starscoin_label: stringstars: integer | nullstatus: one ofpending,paid,expired,review,void— expired may still turn paid if crypto comes late (checked for 30 days); review waits for an operatoraddress: string | null — where to send, while pending — null when the processor gave no whole quote: usepay_urlamount: string | null — the exact amount of the coin to send, fees included, while pendingpay_url: string | null — the processor's own payment page, while pendingcreated_at: string (date-time)expires_at: string (date-time)paid_at: string (date-time) | null