Cloudflare API
This page explains the Cloudflare API integration in GoAdmio. It connects GoAdmio to your Cloudflare account so the panel can automatically manage DNS zones, cache rules, bot management, and other Cloudflare features for domains on the server.
Location: Admin Panel → Domain API → Cloudflare API
Overview
Cloudflare is a CDN, DNS, and security provider that sits in front of your websites. When a domain uses Cloudflare, its DNS is managed at Cloudflare — not on the GoAdmio server. GoAdmio's Cloudflare API integration lets the panel talk directly to Cloudflare so it can:
- Create and manage DNS zones — automatically add domains and records
- Configure DMARC — add and update DMARC records
- Manage cache rules — set up caching behavior
- Configure bot management — control bot protection
- Purge cache — clear Cloudflare's cached content
- Manage page rules — configure redirects and rules
- Edit DNS records — A, AAAA, CNAME, MX, TXT, and others
/go/dns command that creates all required records for a domain in one operation.
> Note: The Cloudflare API integration requires a Cloudflare account and an API token with specific permissions. Without it, GoAdmio cannot manage DNS or cache for Cloudflare-hosted domains — you would have to make all changes manually in the Cloudflare dashboard.
What the Page Shows
| Field | Description |
|---|---|
| Account ID | Your Cloudflare account ID (found in the Cloudflare dashboard) |
| API Token | The API token GoAdmio uses to authenticate |
| Required Cloudflare API Permissions | The exact permissions the token must have |
| Save / Verify | Apply and test the credentials |
Required Permissions
The page lists the exact permissions the API token must have:
| Zone | Permission | Access |
|---|---|---|
| DMARC Management | Edit | Create and update DMARC records |
| Cache Rules | Edit | Configure caching behavior |
| Bot Management | Edit | Control bot protection |
| Zone | Edit | Manage zone settings |
| Cache Purge | Purge | Clear cached content |
| Page Rules | Edit | Configure redirects and rules |
| DNS | Edit | Create and update DNS records |
> Warning: The API token must have exactly these permissions. A token with too few permissions causes API calls to fail; a token with too many is an unnecessary security risk. Follow the principle of least privilege.
Prerequisites
Before configuring Cloudflare API:
- A Cloudflare account — https://dash.cloudflare.com
- At least one domain added to Cloudflare — with nameservers pointed at Cloudflare
- The domain's nameservers at the registrar — must point to Cloudflare's nameservers (see Nameservers)
- Your Cloudflare Account ID — found in the Cloudflare dashboard
- An API token with the exact permissions listed above
- Root access to the GoAdmio Admin Panel
How to Get Your Cloudflare Account ID
- Log in to Cloudflare — https://dash.cloudflare.com
- Click Workers & Pages (or Account Home) in the sidebar.
- The Account ID is shown on the right side of the overview page.
- Copy it — you will paste it into the Account ID field in GoAdmio.
205e721b935c28fc79b87ff41a9c7722). It is not secret — but it is required for the API to work.
How to Create an API Token
Step 1 — Open the API tokens page
- Log in to Cloudflare.
- Click My Profile (top-right avatar) → API Tokens.
- Click Create Token.
Step 2 — Choose a template or custom token
- Scroll to Custom token and click Get started.
- Name the token (e.g.,
GoAdmio).
Step 3 — Configure the permissions
Add each of the required permissions:
| Type | Resource | Permission |
|---|---|---|
| Zone | DMARC Management | Edit |
| Zone | Cache Rules | Edit |
| Zone | Bot Management | Edit |
| Zone | Zone | Edit |
| Zone | Cache Purge | Purge |
| Zone | Page Rules | Edit |
| Zone | DNS | Edit |
Under Zone Resources, choose:
- Include → All zones (if GoAdmio manages all your Cloudflare zones), or
- Include → Specific zone → select the zones GoAdmio should manage
Step 4 — Create and copy the token
- Click Continue to summary.
- Review the permissions.
- Click Create Token.
- Copy the token immediately — it is shown only once.
How to Configure the Integration
- Log in to the GoAdmio Admin Panel.
- Navigate to Domain API → Cloudflare API.
- Paste your Account ID.
- Paste your API Token.
- Click Save (or Verify).
> Tip: If verification fails, check the error message — it usually indicates a missing permission or an invalid token.
What the Integration Enables
Once configured, GoAdmio can use the Cloudflare API for:
| Feature | GoAdmio page / command |
|---|---|
| Add a domain to Cloudflare | /go/dns domain.com |
| Create all DNS records (A, AAAA, MX, SPF, DKIM, DMARC, autodiscover, autoconfig) | /go/dns domain.com |
| Add all domains | /go/dns all |
| Edge cache TTL | /go/dns all --cache |
| Update A records only | /go/dns all --quick |
| Configure ForwardEmail relay | /go/forwardemail domain.com |
| Manage DNS records | /go/cloudflare |
| Purge cache | Via the panel's cache page |
| Manage Cloudflare Proxy | See Cloudflare Proxy |
> Tip: /go/dns domain.com is the most powerful command — it adds the domain to Cloudflare, creates every record needed for web and email, and can switch nameservers automatically for supported registrars. See Command Reference.
Security Best Practices
| Practice | Why |
|---|---|
| Treat the token like a password | Anyone with the token can manage your Cloudflare account |
| Use exactly the required permissions | Least privilege reduces risk |
| Scope the token to specific zones | Limits the blast radius if leaked |
| Rotate the token periodically | Limits the window of exposure |
| Revoke tokens that are no longer used | Reduces attack surface |
| Do not commit the token to source control | Prevents accidental leakage |
| Do not paste the token into public chats | It is a secret |
| Monitor Cloudflare's audit log | Detect unexpected API activity |
| Use one token per integration | Revoke one without affecting others |
| Keep the Account ID handy but treat it as semi-public | It is not a secret, but it should not be published |
> Warning: The API token shown on the page is sensitive. If the GoAdmio panel is accessible to non-admin users, restrict access to the Cloudflare API page in your permissions. A leaked token can let an attacker modify DNS, redirect traffic, or purge caches across your Cloudflare account.
Verifying the Integration
From the panel
After saving, the panel usually shows a Verified status or a success message.
From the shell
Test the API credentials directly with curl:
```bash
Test the token (list zones)
curl -X GET "https://api.cloudflare.com/client/v4/zones" \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json"