---
title: "Connect Cloudflare"
url: https://docs.corefinity.com/guides/organisation/hosting-defaults/cloudflare-connection
type: guide
last_updated: 2026-11-13
feature: cloudflare
related:
  - https://docs.corefinity.com/api/reference/domains/get-company-cloudflare.md
  - https://docs.corefinity.com/api/reference/domains/connect-company-cloudflare.md
  - https://docs.corefinity.com/api/reference/domains/disconnect-company-cloudflare.md
  - https://docs.corefinity.com/api/reference/domains/refresh-company-cloudflare-zones.md
  - https://docs.corefinity.com/api/reference/domains/update-site-cloudflare-zone.md
  - https://docs.corefinity.com/api/reference/domains/update-site-cloudflare-ssl-mode.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_cloudflare_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_cloudflare_connect.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_cloudflare_disconnect.md
  - https://docs.corefinity.com/mcp/tools/corestack_company_cloudflare_refresh_zones.md
  - https://docs.corefinity.com/mcp/tools/corestack_site_cloudflare_zone_set.md
  - https://docs.corefinity.com/mcp/tools/corestack_site_cloudflare_ssl_set.md
---
# 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.

## 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

1. **Open Cloudflare**

   Go to **Organisation › Organisations**, choose your organisation, then **Cloudflare** under **Hosting**.

   _Screenshot: The organisation page's menu with Cloudflare ringed under Hosting, and the Cloudflare card marked Not connected: what the connection is used for, How it works, and the Connect Cloudflare button._

2. **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`.

   _Screenshot: The Connect Cloudflare dialog with four numbered steps: Open Cloudflare and create a token, Give it these four permissions with a Copy list button, Zone resources, and Paste the token, above the buttons Cancel and Verify and connect._

3. **Give it four permissions**

   Add the permissions listed in the dialog. **Copy list** copies them.

   ```text
   Zone · Zone · Read
   Zone · DNS · Edit
   Zone · Cache Purge · Purge
   Zone · Zone Settings · Read + Edit
   ```

4. **Choose 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.

5. **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

1. **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

**API:** [Connect Cloudflare](https://docs.corefinity.com/api/reference/domains/connect-company-cloudflare.md), scope `write`

```bash
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"
  }'
```

**MCP:** [`corestack_company_cloudflare_connect`](https://docs.corefinity.com/mcp/tools/corestack_company_cloudflare_connect.md), scope `write`

```json
{
  "name": "corestack_company_cloudflare_connect",
  "arguments": {
    "token": "<the token>"
  }
}
```

**Control Panel:** Organisation › Organisations › your organisation › Hosting › Cloudflare ([https://manage.corefinity.com/go/cloudflare](https://manage.corefinity.com/go/cloudflare))

## Related

- [Cloudflare for a site](/guides/sites/go-live/cloudflare-for-a-site): Use a connected Cloudflare zone on a site.
- [Add a domain](/guides/sites/go-live/add-a-domain): Attach a domain to a site.
- [Outbound email](/guides/sites/site-settings/outbound-email): Send a site's email from your domain.
