Cloudflare integration
In short
Manage DNS records and purge the cache of your zones. Connect it on the Integrations page; your app then calls Cloudflare through Sapilon without ever holding a Cloudflare credential.
Lets your app list zones, read and change their DNS records and purge cached files, with a Cloudflare API token limited to the zones and permissions you choose.
Connecting
On the Integrations page choose Connect on Cloudflare and fill in:
- API token — Cloudflare dashboard → My Profile → API Tokens → Create Token. Grant Zone → DNS (Edit) and Zone → Cache Purge on the zones the app needs. A global API key is not accepted.
Sapilon checks the key with the provider before it saves it, and stores it encrypted; it is never shown again.
What your app can do
Only these requests are available; anything else is refused.
GET /accountsGET /zonesGET /zones/*GET|POST /zones/*/dns_recordsGET|PATCH|DELETE /zones/*/dns_records/*POST /zones/*/purge_cache
How the agent uses it
Use integrations.request('cloudflare', …); paths are relative to https://api.cloudflare.com/client/v4. Answers are { success, errors, result }.
GET /accounts— accounts the token can see.GET /zones,GET /zones/{zoneId}— Example:{ method: 'GET', path: '/zones', query: { name: 'acme.com' } }.GET|POST /zones/{zoneId}/dns_records— Example:{ method: 'POST', path: '/zones/z1/dns_records', body: { type: 'CNAME', name: 'docs', content: 'acme.github.io', proxied: true } }.GET|PATCH|DELETE /zones/{zoneId}/dns_records/{recordId}— read, change or remove one record.POST /zones/{zoneId}/purge_cache— Example:{ method: 'POST', path: '/zones/z1/purge_cache', body: { files: ['https://acme.com/app.js'] } }.
More from Cloudflare: https://developers.cloudflare.com/api/