Connect Cloudflare
Give the Control Panel a token for your Cloudflare account so it can add DNS records, purge the cache and check SSL for your sites.
On this page
Before you start
- You are a user of the organisation that owns the sites. An agency cannot connect Cloudflare for a client.
- You can create API tokens in the Cloudflare account that holds your domains.
- Sites whose DNS is elsewhere keep working: the Control Panel shows their records for you to add.
Connect your account
Open Cloudflare
Go to Organisation › Organisations, choose your organisation, then Cloudflare under Hosting.
Create the token in Cloudflare
Choose Connect Cloudflare, then Open Cloudflare API tokens. In Cloudflare choose Create Token, then Create Custom Token, and name it
Corefinity panel.Give it four permissions
Add the permissions listed in the dialog. Copy list copies them.
Zone · Zone · Read Zone · DNS · Edit Zone · Cache Purge · Purge Zone · Zone Settings · Read + EditChoose the zones
Under Zone resources, choose Include, All zones from an account and your account. To limit the Control Panel to named domains, choose Specific zone instead.
Paste the token
In Cloudflare, choose Continue to summary, then Create Token, and copy the token. Paste it under Paste the token, choose Verify and connect, then Done.
The card now reads Connected and lists the account, the token's last four characters, its permissions and each zone the token can see.
What the connection does
| Use | The Control Panel |
|---|---|
| Attaching a domain and URL changes | Points the domain at your site, proxied. |
| Email sending | Adds the SPF, DKIM, tracking and MX records. |
| Purge cache | Clears Cloudflare's cache from each site's platform section. |
| SSL mode check | Warns when a zone is not on Full (strict). |
Check your zones
Zones are matched to sites by domain. Choose Refresh zones after you add a zone in Cloudflare.
| You see | Do this |
|---|---|
| Not mapped | Choose Map a site, pick the site and choose Map. |
| Full or Flexible under SSL mode | Follow the link to set Full (strict) in Cloudflare. |
| Token no longer works or Needs reconnecting | Choose Reconnect and paste a new token. |
Disconnect Cloudflare
Disconnect and delete the token
Choose Disconnect, then Disconnect Cloudflare. Delete the token in Cloudflare as well: the Control Panel cannot revoke it.
The Control Panel goes back to showing the records to add. Nothing in Cloudflare is changed.
Automate this
Checks a Cloudflare API token with Cloudflare and stores it encrypted for your company.
curl -X POST https://manage.corefinity.com/api/corestack/company/cloudflare \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"token": "example-cloudflare-api-token-0000000000000000"
}'Your assistant calls corestack_company_cloudflare_connect.
{
"name": "corestack_company_cloudflare_connect",
"arguments": {
"token": "<the token>"
}
}