Hanzo

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 URLhttps://api.hanzo.ai
Operations33
AuthAuthorization: Bearer $HANZO_API_KEY

cloudflare

post_v1_cloudflare_ai_run_by_wildcard1

POST /v1/cloudflare/ai/run/{wildcard1}

ParameterInTypeRequiredDescription
wildcard1pathstringyes

post_v1_cloudflare_d1_databases_by_database_query

POST /v1/cloudflare/d1/databases/{database}/query

ParameterInTypeRequiredDescription
databasepathstringyes

Request bodyapplication/json

FieldTypeRequiredDescription
paramsany[]
sqlstring

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.

ParameterInTypeRequiredDescription
databasepathstringyesDatabase 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.

ParameterInTypeRequiredDescription
pagequerystringPage is the 1-based page of databases to return.
per_pagequerystringPerPage is how many databases one page holds.
namequerystringName 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 bodyapplication/json (required)

FieldTypeRequiredDescription
namestringName is the database name to create.

get_v1_cloudflare_kv_namespaces_by_namespace_values_by_key

GET /v1/cloudflare/kv/namespaces/{namespace}/values/{key}

ParameterInTypeRequiredDescription
namespacepathstringyes
keypathstringyes

put_v1_cloudflare_kv_namespaces_by_namespace_values_by_key

PUT /v1/cloudflare/kv/namespaces/{namespace}/values/{key}

ParameterInTypeRequiredDescription
namespacepathstringyes
keypathstringyes

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.

ParameterInTypeRequiredDescription
namespacepathstringyesNamespace is the Cloudflare KV namespace id.
keypathstringyesKey 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.

ParameterInTypeRequiredDescription
namespacepathstringyesNamespace 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.

ParameterInTypeRequiredDescription
pagequerystringPage is the 1-based page of namespaces to return.
per_pagequerystringPerPage is how many namespaces one page holds.
orderquerystringOrder names the field to sort by, and Direction sorts asc or desc.
directionquerystring

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 bodyapplication/json (required)

FieldTypeRequiredDescription
titlestringTitle is the namespace's display title.

post_v1_cloudflare_pages_projects_by_project_deployments

POST /v1/cloudflare/pages/projects/{project}/deployments

ParameterInTypeRequiredDescription
projectpathstringyes

Request bodyapplication/json

FieldTypeRequiredDescription
branchstring

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.

ParameterInTypeRequiredDescription
projectpathstringyesProject is the Pages project name.
domainpathstringyesDomain 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.

ParameterInTypeRequiredDescription
projectpathstringyesProject is the Pages project name, from the path.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
namestringName is the custom domain to attach, e.g.
projectstringProject 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.

ParameterInTypeRequiredDescription
projectpathstringyesProject 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.

ParameterInTypeRequiredDescription
projectpathstringyesProject 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.

POST /v1/cloudflare/pages/projects

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 bodyapplication/json (required)

FieldTypeRequiredDescription
build_configcloud_PagesBuildConfig
deployment_configscloud_PagesDeploymentConfigs
namestring
production_branchstring

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.

ParameterInTypeRequiredDescription
bucketpathstringyesBucket 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.

ParameterInTypeRequiredDescription
per_pagequerystringPerPage is how many buckets one page holds.
cursorquerystringCursor continues from the position a previous page returned.
name_containsquerystringNameContains filters to buckets whose name contains this substring.
orderquerystringOrder names the field to sort by, and Direction sorts asc or desc.
directionquerystring

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 bodyapplication/json (required)

FieldTypeRequiredDescription
namestringName 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.

ParameterInTypeRequiredDescription
scriptpathstringyesScript is the Worker script name, from the path.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
enabledbooleanEnabled publishes the script on <script>.<subdomain>.workers.dev when true, and withdraws it when false.
scriptstringScript is the Worker script name, from the path.

put_v1_cloudflare_workers_scripts_by_script

PUT /v1/cloudflare/workers/scripts/{script}

ParameterInTypeRequiredDescription
scriptpathstringyes

Request bodyapplication/json

FieldTypeRequiredDescription
bindings
compatibilityDatestring
compatibilityFlagsstring[]
mainModulestring
scriptstring

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.

ParameterInTypeRequiredDescription
scriptpathstringyesScript 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.

ParameterInTypeRequiredDescription
zonepathstringyesZone is the 32-hex Cloudflare zone id.
routepathstringyesRoute 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.

ParameterInTypeRequiredDescription
zonepathstringyesZone 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.

ParameterInTypeRequiredDescription
zonepathstringyesZone is the 32-hex Cloudflare zone id, from the path.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
patternstringPattern is the URL pattern to bind, e.g.
scriptstringScript is the Worker script to dispatch to.
zonestringZone 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.

ParameterInTypeRequiredDescription
zonepathstringyesZone is the 32-hex Cloudflare zone id.
sincequerystringSince and Until bound the window, in the form Cloudflare accepts — an RFC 3339 time or a negative number of minutes from
untilquerystring
continuousquerystringContinuous 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.

ParameterInTypeRequiredDescription
zonepathstringyesZone is the 32-hex Cloudflare zone id, from the path.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
filesstring[]Files purges exactly the listed URLs — at most 30, Cloudflare's per-request cap.
purge_everythingbooleanEverything drops the zone's entire edge cache.
zonestringZone 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.

ParameterInTypeRequiredDescription
zonepathstringyesZone 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.

ParameterInTypeRequiredDescription
pagequerystringPage is the 1-based page of zones to return.
per_pagequerystringPerPage is how many zones one page holds.
namequerystringName filters to the zone with this domain name.
statusquerystringStatus filters by zone status (active, pending, initializing, …).
orderquerystringOrder names the field to sort by, and Direction sorts asc or desc.
directionquerystring

All Hanzo APIs · Interactive reference

How is this guide?

On this page

cloudflarepost_v1_cloudflare_ai_run_by_wildcard1post_v1_cloudflare_d1_databases_by_database_queryD1DatabaseDelete deletes a D1 database and everything stored in it.D1DatabaseList lists the D1 databases on the org's Cloudflare account.D1DatabaseCreate creates a D1 database on the org's Cloudflare account.get_v1_cloudflare_kv_namespaces_by_namespace_values_by_keyput_v1_cloudflare_kv_namespaces_by_namespace_values_by_keyKVValueDelete removes one key from a Workers KV namespace.KVNamespaceDelete deletes a Workers KV namespace and every key in it.KVNamespaceList lists the Workers KV namespaces on the org's Cloudflare account.KVNamespaceCreate creates a Workers KV namespace on the org's Cloudflare account.post_v1_cloudflare_pages_projects_by_project_deploymentsPagesDomainDelete detaches a custom domain from a Cloudflare Pages project.PagesDomainAdd attaches a custom domain to a Cloudflare Pages project.PagesGet reads one Cloudflare Pages project — its build config, deployment configs and latest deployment.PagesDelete deletes a Cloudflare Pages project, and with it every deployment it has ever made.PagesList lists the org's Cloudflare Pages projects.PagesCreate creates a Cloudflare Pages project on the org's account.R2BucketDelete deletes an R2 bucket.R2BucketList lists the R2 buckets on the org's Cloudflare account.R2BucketCreate creates an R2 bucket on the org's Cloudflare account.WorkersScriptSubdomainSet publishes or withdraws one Worker script on the account's workers.dev subdomain.put_v1_cloudflare_workers_scripts_by_scriptWorkersScriptDelete removes a Worker script from the org's Cloudflare account.WorkersScriptList lists the Worker scripts on the org's Cloudflare account.WorkersSubdomainGet reads the org account's workers.dev subdomain — the name under which every subdomain-enabled script is served.WorkersRouteDelete unbinds a Worker route, so its pattern stops dispatching to a script.WorkersRouteList lists the Worker routes bound within one zone — the URL patterns that dispatch to a script.WorkersRouteCreate binds a URL pattern in a zone to a Worker script.ZoneAnalytics reads a zone's Cloudflare traffic dashboard — requests, bandwidth, threats and pageviews over the since/until window.ZonePurge drops a zone's Cloudflare edge cache — either the whole zone (purge_everything) or exactly the listed file URLs.ZoneGet reads one Cloudflare zone the org's token can see.ZonesList lists the Cloudflare zones the org's connected API token can see, paged and filtered by the query parameters Cloudflare itself accepts.