Cloudflare
Package cloudflare is your Cloudflare account, managed from Hanzo: zones, Pages, Workers, Workers AI, R2, KV and D1.
Package cloudflare is your Cloudflare account, managed from Hanzo: zones, Pages, Workers, Workers AI, R2, KV and D1.
| Base URL | https://api.hanzo.ai |
| Operations | 33 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
cloudflare
post_v1_cloudflare_ai_run_by_wildcard1
POST /v1/cloudflare/ai/run/{wildcard1}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
wildcard1 | path | string | yes |
post_v1_cloudflare_d1_databases_by_database_query
POST /v1/cloudflare/d1/databases/{database}/query
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
database | path | string | yes |
Request body — application/json
| Field | Type | Required | Description |
|---|---|---|---|
params | any[] | — | |
sql | string | — |
D1DatabaseDelete deletes a D1 database and everything stored in it.
DELETE /v1/cloudflare/d1/databases/{database}
D1DatabaseDelete deletes a D1 database and everything stored in it. Requires org admin.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
database | path | string | yes | Database is the Cloudflare D1 database id or name. |
D1DatabaseList lists the D1 databases on the org's Cloudflare account.
GET /v1/cloudflare/d1/databases
D1DatabaseList lists the D1 databases on the org's Cloudflare account. Any org member may read.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | string | — | Page is the 1-based page of databases to return. |
per_page | query | string | — | PerPage is how many databases one page holds. |
name | query | string | — | Name filters to the database with this name. |
D1DatabaseCreate creates a D1 database on the org's Cloudflare account.
POST /v1/cloudflare/d1/databases
D1DatabaseCreate creates a D1 database on the org's Cloudflare account. Requires org admin.
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | — | Name is the database name to create. |
get_v1_cloudflare_kv_namespaces_by_namespace_values_by_key
GET /v1/cloudflare/kv/namespaces/{namespace}/values/{key}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
namespace | path | string | yes | |
key | path | string | yes |
put_v1_cloudflare_kv_namespaces_by_namespace_values_by_key
PUT /v1/cloudflare/kv/namespaces/{namespace}/values/{key}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
namespace | path | string | yes | |
key | path | string | yes |
KVValueDelete removes one key from a Workers KV namespace.
DELETE /v1/cloudflare/kv/namespaces/{namespace}/values/{key}
KVValueDelete removes one key from a Workers KV namespace. Requires org admin.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
namespace | path | string | yes | Namespace is the Cloudflare KV namespace id. |
key | path | string | yes | Key is the key within that namespace. KV keys are broad (up to 512 bytes), so this one is escaped rather than charset-re |
KVNamespaceDelete deletes a Workers KV namespace and every key in it.
DELETE /v1/cloudflare/kv/namespaces/{namespace}
KVNamespaceDelete deletes a Workers KV namespace and every key in it. Requires org admin.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
namespace | path | string | yes | Namespace is the Cloudflare KV namespace id. |
KVNamespaceList lists the Workers KV namespaces on the org's Cloudflare account.
GET /v1/cloudflare/kv/namespaces
KVNamespaceList lists the Workers KV namespaces on the org's Cloudflare account. Any org member may read.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | string | — | Page is the 1-based page of namespaces to return. |
per_page | query | string | — | PerPage is how many namespaces one page holds. |
order | query | string | — | Order names the field to sort by, and Direction sorts asc or desc. |
direction | query | string | — |
KVNamespaceCreate creates a Workers KV namespace on the org's Cloudflare account.
POST /v1/cloudflare/kv/namespaces
KVNamespaceCreate creates a Workers KV namespace on the org's Cloudflare account. Requires org admin. Cloudflare mints the namespace id the value routes address.
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
title | string | — | Title is the namespace's display title. |
post_v1_cloudflare_pages_projects_by_project_deployments
POST /v1/cloudflare/pages/projects/{project}/deployments
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
project | path | string | yes |
Request body — application/json
| Field | Type | Required | Description |
|---|---|---|---|
branch | string | — |
PagesDomainDelete detaches a custom domain from a Cloudflare Pages project.
DELETE /v1/cloudflare/pages/projects/{project}/domains/{domain}
PagesDomainDelete detaches a custom domain from a Cloudflare Pages project. Requires org admin.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
project | path | string | yes | Project is the Pages project name. |
domain | path | string | yes | Domain is the attached custom domain to detach. |
PagesDomainAdd attaches a custom domain to a Cloudflare Pages project.
POST /v1/cloudflare/pages/projects/{project}/domains
PagesDomainAdd attaches a custom domain to a Cloudflare Pages project. Requires org admin. Cloudflare owns validation and certificate issuance from here on.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
project | path | string | yes | Project is the Pages project name, from the path. |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | — | Name is the custom domain to attach, e.g. |
project | string | — | Project is the Pages project name, from the path. |
PagesGet reads one Cloudflare Pages project — its build config, deployment configs and latest deployment.
GET /v1/cloudflare/pages/projects/{project}
PagesGet reads one Cloudflare Pages project — its build config, deployment configs and latest deployment. Any org member may read.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
project | path | string | yes | Project is the Pages project name. |
PagesDelete deletes a Cloudflare Pages project, and with it every deployment it has ever made.
DELETE /v1/cloudflare/pages/projects/{project}
PagesDelete deletes a Cloudflare Pages project, and with it every deployment it has ever made. Requires org admin.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
project | path | string | yes | Project is the Pages project name. |
PagesList lists the org's Cloudflare Pages projects.
GET /v1/cloudflare/pages/projects
PagesList lists the org's Cloudflare Pages projects. Any org member may read.
PagesCreate creates a Cloudflare Pages project on the org's account.
PagesCreate creates a Cloudflare Pages project on the org's account. Requires org admin. Only the modeled fields reach Cloudflare, so an unmodeled key in the request is dropped rather than forwarded.
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
build_config | cloud_PagesBuildConfig | — | |
deployment_configs | cloud_PagesDeploymentConfigs | — | |
name | string | — | |
production_branch | string | — |
R2BucketDelete deletes an R2 bucket.
DELETE /v1/cloudflare/r2/buckets/{bucket}
R2BucketDelete deletes an R2 bucket. Requires org admin. Cloudflare refuses a bucket that still holds objects, and that refusal is relayed.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
bucket | path | string | yes | Bucket is the R2 bucket name. |
R2BucketList lists the R2 buckets on the org's Cloudflare account.
GET /v1/cloudflare/r2/buckets
R2BucketList lists the R2 buckets on the org's Cloudflare account. Any org member may read.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
per_page | query | string | — | PerPage is how many buckets one page holds. |
cursor | query | string | — | Cursor continues from the position a previous page returned. |
name_contains | query | string | — | NameContains filters to buckets whose name contains this substring. |
order | query | string | — | Order names the field to sort by, and Direction sorts asc or desc. |
direction | query | string | — |
R2BucketCreate creates an R2 bucket on the org's Cloudflare account.
POST /v1/cloudflare/r2/buckets
R2BucketCreate creates an R2 bucket on the org's Cloudflare account. Requires org admin.
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | — | Name is the bucket name to create. |
WorkersScriptSubdomainSet publishes or withdraws one Worker script on the account's workers.dev subdomain.
POST /v1/cloudflare/workers/scripts/{script}/subdomain
WorkersScriptSubdomainSet publishes or withdraws one Worker script on the account's workers.dev subdomain. Requires org admin.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
script | path | string | yes | Script is the Worker script name, from the path. |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | — | Enabled publishes the script on <script>.<subdomain>.workers.dev when true, and withdraws it when false. |
script | string | — | Script is the Worker script name, from the path. |
put_v1_cloudflare_workers_scripts_by_script
PUT /v1/cloudflare/workers/scripts/{script}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
script | path | string | yes |
Request body — application/json
| Field | Type | Required | Description |
|---|---|---|---|
bindings | — | ||
compatibilityDate | string | — | |
compatibilityFlags | string[] | — | |
mainModule | string | — | |
script | string | — |
WorkersScriptDelete removes a Worker script from the org's Cloudflare account.
DELETE /v1/cloudflare/workers/scripts/{script}
WorkersScriptDelete removes a Worker script from the org's Cloudflare account. Requires org admin. Routes bound to the script stop serving it.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
script | path | string | yes | Script is the Worker script name. |
WorkersScriptList lists the Worker scripts on the org's Cloudflare account.
GET /v1/cloudflare/workers/scripts
WorkersScriptList lists the Worker scripts on the org's Cloudflare account. Any org member may read.
WorkersSubdomainGet reads the org account's workers.dev subdomain — the name under which every subdomain-enabled script is served.
GET /v1/cloudflare/workers/subdomain
WorkersSubdomainGet reads the org account's workers.dev subdomain — the name under which every subdomain-enabled script is served. Any org member may read.
WorkersRouteDelete unbinds a Worker route, so its pattern stops dispatching to a script.
DELETE /v1/cloudflare/workers/zones/{zone}/routes/{route}
WorkersRouteDelete unbinds a Worker route, so its pattern stops dispatching to a script. Requires org admin.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
zone | path | string | yes | Zone is the 32-hex Cloudflare zone id. |
route | path | string | yes | Route is the 32-hex Cloudflare route id. |
WorkersRouteList lists the Worker routes bound within one zone — the URL patterns that dispatch to a script.
GET /v1/cloudflare/workers/zones/{zone}/routes
WorkersRouteList lists the Worker routes bound within one zone — the URL patterns that dispatch to a script. Any org member may read. Routes are zone-scoped, so no account is resolved.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
zone | path | string | yes | Zone is the 32-hex Cloudflare zone id. |
WorkersRouteCreate binds a URL pattern in a zone to a Worker script.
POST /v1/cloudflare/workers/zones/{zone}/routes
WorkersRouteCreate binds a URL pattern in a zone to a Worker script. Requires org admin — a route is what puts a script in front of live traffic.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
zone | path | string | yes | Zone is the 32-hex Cloudflare zone id, from the path. |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
pattern | string | — | Pattern is the URL pattern to bind, e.g. |
script | string | — | Script is the Worker script to dispatch to. |
zone | string | — | Zone is the 32-hex Cloudflare zone id, from the path. |
ZoneAnalytics reads a zone's Cloudflare traffic dashboard — requests, bandwidth, threats and pageviews over the since/until window.
GET /v1/cloudflare/zones/{zone}/analytics
ZoneAnalytics reads a zone's Cloudflare traffic dashboard — requests, bandwidth, threats and pageviews over the since/until window. Any org member may read.
A zone whose Cloudflare plan does not serve this endpoint yields Cloudflare's OWN error, never a fabricated success.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
zone | path | string | yes | Zone is the 32-hex Cloudflare zone id. |
since | query | string | — | Since and Until bound the window, in the form Cloudflare accepts — an RFC 3339 time or a negative number of minutes from |
until | query | string | — | |
continuous | query | string | — | Continuous asks Cloudflare for only fully-aggregated buckets. |
ZonePurge drops a zone's Cloudflare edge cache — either the whole zone (purge_everything) or exactly the listed file URLs.
POST /v1/cloudflare/zones/{zone}/purge
ZonePurge drops a zone's Cloudflare edge cache — either the whole zone (purge_everything) or exactly the listed file URLs. Requires org admin.
Purging is the one zone-scoped WRITE this plane owns. It is not DNS — no record changes — so it does not belong on /v1/dns, and it is not a connection, so it does not belong on the integrations plane. It is a cache operation on a zone, which is what this asset plane is for. It takes the admin gate because dropping a zone's cache sends every subsequent request to the origin: on a site fronting a small origin that is a self-inflicted load spike, so it is a change, not a look.
Exactly one selector is required. Cloudflare treats a body with neither as a no-op and answers 200, which reads as "purged" to a caller that never purged anything — the failure we refuse to pass through.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
zone | path | string | yes | Zone is the 32-hex Cloudflare zone id, from the path. |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
files | string[] | — | Files purges exactly the listed URLs — at most 30, Cloudflare's per-request cap. |
purge_everything | boolean | — | Everything drops the zone's entire edge cache. |
zone | string | — | Zone is the 32-hex Cloudflare zone id, from the path. |
ZoneGet reads one Cloudflare zone the org's token can see.
GET /v1/cloudflare/zones/{zone}
ZoneGet reads one Cloudflare zone the org's token can see. Any org member may read. A zone id the token cannot see is Cloudflare's own not-found, relayed.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
zone | path | string | yes | Zone is the 32-hex Cloudflare zone id. |
ZonesList lists the Cloudflare zones the org's connected API token can see, paged and filtered by the query parameters Cloudflare itself accepts.
GET /v1/cloudflare/zones
ZonesList lists the Cloudflare zones the org's connected API token can see, paged and filtered by the query parameters Cloudflare itself accepts. Zones are token-scoped by Cloudflare, so no account is resolved. Any org member may read.
Zone and DNS-record MANAGEMENT is not here: it stays on the Hanzo DNS plane (/v1/dns). This only surfaces the Cloudflare zone objects the asset plane needs — a zone id is what addresses a Worker route or an analytics read.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | string | — | Page is the 1-based page of zones to return. |
per_page | query | string | — | PerPage is how many zones one page holds. |
name | query | string | — | Name filters to the zone with this domain name. |
status | query | string | — | Status filters by zone status (active, pending, initializing, …). |
order | query | string | — | Order names the field to sort by, and Direction sorts asc or desc. |
direction | query | string | — |
How is this guide?