Linking Cloudflare as a source

The Cloudflare connector syncs your Cloudflare configuration data into PostHog, including accounts, zones, and DNS records.

Alpha release

The Cloudflare source is currently in alpha. It syncs configuration data from Cloudflare's v4 REST API. High-volume analytics data from Cloudflare's GraphQL API is not yet supported.

Creating a Cloudflare API token

Before linking Cloudflare, create an API token with the required permissions:

  1. Go to the Cloudflare dashboard API tokens page.
  2. Click Create Token.
  3. Click Create Custom Token > Get started.
  4. Give your token a descriptive name (e.g. "PostHog Data Warehouse").
  5. Under Permissions, add the following with Read access:

ResourcePermission
Account SettingsRead
ZoneRead
DNSRead

  1. Under Account Resources, select the accounts you want to sync.
  2. Under Zone Resources, select the zones you want to sync. Choose All zones to sync DNS records from every zone.
  3. Click Continue to summary, then Create Token.
  4. Copy the token – you won't be able to see it again.

Linking Cloudflare

  1. In PostHog, go to the Data pipeline page and select the Sources tab.
  2. Click New source and select Cloudflare by clicking Link.
  3. Paste your Cloudflare API token.
  4. Optional: Add a prefix to your table names.
  5. Click Next.
  6. Select the tables you want to import.
  7. Click Import.

PostHog validates your token against Cloudflare's /user/tokens/verify endpoint before starting the sync. If validation fails, check that your token has the required permissions listed above.

The data warehouse then starts syncing your Cloudflare data. You can see details and progress in the data pipeline sources tab.

Available tables

TableDescription
accountsCloudflare accounts accessible by the API token
zonesZones (domains) managed in those accounts
dns_recordsDNS records for each zone, with a _zone_id field linking each record to its parent zone

DNS records are synced from every zone the token can access. Each DNS record row includes a _zone_id field so you can join it back to the zones table.

Sync modes

Cloudflare tables support full refresh syncing only. Each sync re-imports all records from Cloudflare.

Incremental and append-only syncs aren't available because Cloudflare's v4 REST API doesn't expose updated-since filters for these resources. Since these are small configuration tables, full refresh syncs complete quickly.

Configuration

OptionTypeRequired
API tokenpasswordYes

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
accounts

A Cloudflare account that the API token can access.

Full refresh
zones

A zone — a domain and its DNS/configuration managed in Cloudflare.

Full refresh
dns_records

A DNS record belonging to a zone (A, CNAME, MX, TXT, and so on).

Full refresh

Community questions

Was this page useful?

Questions about this page? or post a community question.