Calls any endpoint of the Cloudflare API as your connected account: Workers, R2, rules, Zero Trust, zone settings and more.
curl -X POST "https://api.primaryapi.com/v1/run/cloudflare.api_request" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method":"GET","path":"/zones","query":{"name":"example.com"}}'{
"output": {
"found": true,
"data": {
"status": 200,
"success": true,
"text": null,
"result": [
{
"name": "example.com",
"development_mode": 7200,
"paused": false,
"activated_on": "2014-01-02T00:01:00.12345Z", …
}
], …
}
},
"credits": 1
}Input and output
5 fields
GET./zones.{"name":"example.com"}.7 fields
result, as returnedsuccess (null when the answer is not its JSON envelope)errors ({ code, message }), as returnedGood to know
Changes your account. This call creates, edits or deletes something in the connected account, live. Confirm before running it. With an Idempotency-Key it never runs twice, and monitors can’t schedule it.
Runs as your connected Cloudflare account. Needs the "Everything your account allows" permission.
It can read and change anything that account allows. Including deleting zones, Workers and data, so confirm with the person before any call that is not a GET.
Changes apply right away, with no undo. A call that times out may still have gone through, so read the current state before trying again.
Repeating it with the same Idempotency-Key. Input returns the first call’s stored result.
Prefer the dedicated Cloudflare APIs when one fits.
The same key and credits work for every API.