> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# n8n and ClickFlare Integration Guide

> Connect n8n to ClickFlare: catch ClickFlare events with a Webhook node, post conversions back, and call the ClickFlare REST API with HTTP Request.

![n8n and ClickFlare Integration](https://mintcdn.com/clickflare/gS923ib4WFySqxSL/images/integrations/covers/n8n.png?fit=max\&auto=format\&n=gS923ib4WFySqxSL\&q=85\&s=4fe6284932a7e96a9c93f9640002a8ac)

n8n is a workflow automation tool you can use in the cloud or host on your own server. A workflow is a chain of nodes: a trigger node starts it and the nodes after it read, change and send data. Two core nodes connect n8n to ClickFlare: the **Webhook** node, which receives requests, and the **HTTP Request** node, which calls any URL or API.

The connection works in both directions:

* **ClickFlare → n8n.** ClickFlare's [Custom Webhook](/docs/en/integrations/custom-webhook-integration.md) sends an event (a conversion, a purchase, a click) to an n8n Webhook node. The workflow stores it, enriches it or passes it on.
* **n8n → ClickFlare.** An HTTP Request node posts a conversion to ClickFlare's postback endpoint as JSON, so any app or webhook n8n receives can report conversions. The same node calls the ClickFlare REST API, so one workflow can catch an event, check a report and act on it.

Because n8n can run on your own infrastructure, it's a good fit when you want conversion data to stay on servers you control.

***

## At a glance

To set up n8n with ClickFlare:

1. Add a Webhook node.
2. Map the event in ClickFlare.
3. Test, then publish.
4. Post conversions to ClickFlare.
5. Call the ClickFlare API.

| | n8n + ClickFlare |
| - | - |
| **How it connects** | Custom Webhook to Webhook node; HTTP Request back |
| **What reaches ClickFlare** | ClickFlare events out; conversions and API calls in |
| **Timing** | Real time for events, on demand for API calls |
| **Key parameters** | `cf_click_id`, `payout`, `ct`, param1 to param20, api-key |
| **Works with** | n8n cloud and self-hosted instances over HTTPS |
| **Good to know** | Put the production URL in ClickFlare, not the test URL. |

***

## How the data flows

```text theme={null}
ClickFlare → n8n
  Conversion recorded in ClickFlare
  → Custom Webhook fires (POST, with macros)
     https://n8n.yourdomain.com/webhook/clickflare-conversions
  → Webhook node starts the workflow
  → Nodes: database insert, Slack alert, partner callback...

n8n → ClickFlare
  Webhook node or app trigger (partner webhook, new deal, new payment)
  → HTTP Request: POST, body JSON
     https://trk.yourdomain.com/cf/cv
     {"cf_click_id": "CF_CLICK_ID", "payout": 25, "ct": "sale"}
  → ClickFlare matches the conversion to the original click

n8n → ClickFlare API
  Schedule Trigger
  → HTTP Request: POST https://public-api.clickflare.io/api/report
     header api-key: YOUR_API_KEY
  → Nodes: filter campaigns, send an alert
```

| Direction | n8n side | ClickFlare side | Use it for |
| - | - | - | - |
| **Out of ClickFlare** | Webhook node | Custom Webhook (Integrations → Conversion API) | Storing events, alerts, CRM sync |
| **Into ClickFlare** | HTTP Request node (POST) | JSON POST to `/cf/cv` | Conversions from apps with no postback of their own |
| **Reading and changing data** | HTTP Request node with Header Auth | REST API at `public-api.clickflare.io` | Reports, offer sync, bulk changes |

***

## What you'll need

* A ClickFlare account with your **own tracking domain** for postbacks. See [Tracking domains](/docs/en/settings/tracking-domains.md).
* An n8n instance, cloud or self-hosted. A self-hosted instance must be reachable from the internet over HTTPS for ClickFlare to call it.
* For n8n → ClickFlare: the click ID stored somewhere the trigger can return it.
* For API calls: an API key from **Settings → API Keys**.

***

## Send ClickFlare events to n8n

**1. Add a Webhook node**

Create a workflow and add a **Webhook** node as the trigger. Set:

* **HTTP Method**: POST, to match the ClickFlare mapping. GET works too if you send values in the URL only.
* **Path**: n8n fills in a random path. You can replace it with something readable, such as `clickflare-conversions`.
* **Authentication**: **Header auth** is a good choice. Create a credential with a header name and a secret value. You'll add the same header in ClickFlare.
* **Respond**: **Immediately** is enough. ClickFlare only needs to know the request arrived.

**2. Add a Webhooks integration in ClickFlare**

Go to **Integrations**, click **Conversion API → New integration** and choose **Webhooks**. Pick the **Workspace** and give it a **Name**.

**3. Map the event**

Under **Event Type Mapping**, pick the **ClickFlare Event**, set **Request Method** to **POST** and paste the n8n URL as the **Webhook URL**. Add the values you need with macros, in the URL or the body, for example:

```text theme={null}
https://n8n.yourdomain.com/webhook/clickflare-conversions?click_id={cf_click_id}&payout={payout_currency}
```

Open **Advanced configuration** and add the header you set on the Webhook node. To send only some events, click **Add Conditions**. Click **Next**, then **Save**.

![A ClickFlare Webhooks integration for n8n: the Sale event, POST, the n8n webhook URL and a JSON body with click\_id, payout and campaign macros and an auth header under Advanced configuration](https://mintcdn.com/clickflare/b2lpDlx8sR69TsUK/images/integrations/n8n/clickflare-n8n-webhook-event-mapping.png?fit=max\&auto=format\&n=b2lpDlx8sR69TsUK\&q=85\&s=2daab7329f7d826d7a66529cdb81e88f)

**4. Test with the test URL**

n8n shows two URLs at the top of the Webhook node: **Test URL** and **Production URL**. For a first test, put the test URL in ClickFlare, click **Listen for Test Event** in n8n and fire an event. The data appears in the node, and you can build the rest of the workflow from it. Values sent in the URL arrive under `query`, values sent in the body under `body`.

**5. Publish and switch to the production URL**

n8n registers the production URL only when you publish the workflow. Publish it, then replace the test URL in ClickFlare with the **Production URL**. Production runs don't show data in the editor: open the workflow's **Executions** tab to see them.

> [!WARNING]
>
> The test URL only works while n8n is listening for a test event. If ClickFlare still points at it after you publish, events are lost.

Other Webhook node options worth knowing: **IP(s) Allowlist** limits who can call the URL, and **Ignore Bots** drops link previewers and crawlers. The maximum payload is 16MB. Self-hosted instances can change it with `N8N_PAYLOAD_SIZE_MAX`.

***

## Report conversions from n8n to ClickFlare

ClickFlare accepts conversions as a JSON POST on the same endpoint as its postback:

```bash theme={null}
curl -X POST 'https://trk.yourdomain.com/cf/cv' \
  -H 'Content-Type: application/json' \
  --data '{"cf_click_id": "abc", "ct": "search", "param1": "test", "payout": 1}'
```

The body keys are `cf_click_id` (required), `payout`, `ct`, `txid` and `param1` to `param20`. `ct` must match a custom conversion created under **Settings → Custom Conversions**. See [Custom conversions](/docs/en/settings/custom-conversions.md).

**1. Set up the trigger**

Use an app trigger node, or a Webhook node if the platform sends its own webhooks, as in the [Hotmart](/docs/en/integrations/hotmart-click-flare-integration-guide.md) and [PartnerStack](/docs/en/integrations/partnerstack-click-flare-integration-guide.md) guides. The click ID must be in the data: pass `{cf_click_id}` in the offer or lander URL and have the platform store it.

**2. Add an HTTP Request node**

Set:

| Parameter | Value |
| - | - |
| **Method** | POST |
| **URL** | `https://trk.yourdomain.com/cf/cv` |
| **Authentication** | None |
| **Send Body** | On, **Body Content Type** JSON |
| **Specify Body** | **Using JSON** |

Then write the body with expressions that point at the trigger's fields:

```json theme={null}
{
  "cf_click_id": "{{ $json.body.data.customer.sub_ids[0] }}",
  "payout": {{ $json.body.data.amount / 100 }},
  "txid": "{{ $json.body.data.key }}",
  "ct": "{{ $json.body.data.reward_status }}"
}
```

This example maps a PartnerStack reward. n8n reads nested fields and does the math inline, so a platform's own payload needs no extra nodes.

**3. Skip events you don't want**

Put an **If** or **Filter** node before the HTTP Request node, for example to skip test events or statuses you don't track.

**4. Test the node**

Run the node with a real click ID from a recent ClickFlare click. The conversion should appear on that campaign and in **Logs → Event Logs**.

> [!TIP]
>
> Need several conversions on the same click kept apart? Send a unique `txid` in the body, as in the example above: a different `txid` adds a conversion, the same `txid` replaces the earlier one. A GET to `/cf/cv` with `click_id`, `payout`, `ct` and `txid` under **Send Query Parameters** works too. See [Postback parameters](/docs/en/tracking/click-flare-parameters-in-postback-urls.md).

***

## Call the ClickFlare API from n8n

**1. Create a Header Auth credential**

In an HTTP Request node, set **Authentication** to **Generic Credential Type**, then **Header Auth**. Create a credential with **Name** `api-key` and **Value** your key from **Settings → API Keys**. n8n adds the header to every request that uses the credential. See [API overview](/docs/en/api/clickflare-api-overview.md).

**2. Import the request**

The HTTP Request node can import a curl command. Click **Import cURL** and paste:

```bash theme={null}
curl https://public-api.clickflare.io/api/campaigns/list \
  -H "api-key: YOUR_API_KEY"
```

Then remove the pasted header and select the Header Auth credential instead, so the key isn't stored in the node.

**3. Pull a report**

For report data, POST to `https://public-api.clickflare.io/api/report` with a JSON body:

```json theme={null}
{
  "startDate": "2026-11-01 00:00:00",
  "endDate": "2026-11-01 23:59:59",
  "timezone": "UTC",
  "groupBy": ["campaignID"],
  "metrics": ["campaignID", "campaignName", "visits", "conversions", "revenue", "cost", "roi"],
  "sortBy": "revenue",
  "orderType": "desc",
  "page": 1,
  "pageSize": 100,
  "includeAll": false
}
```

Every breakdown in `groupBy` must also be in `metrics`. `conversionTimestamp` (`visit` or `postback`) and `currency` are optional. For long reports, turn on the node's **Pagination** option and raise `page` until no rows come back.

**Example: ROI alert.** A **Schedule Trigger** runs every hour, the HTTP Request node pulls today's campaign report, a **Filter** node keeps campaigns with `roi` below your floor and a Slack or email node sends the list. A request without the `api-key` header returns `401`.

> [!WARNING]
>
> An API key has the same rights as your account. Keep it in a credential, not in node parameters, so it doesn't end up in exported workflows.

***

## Verify the setup

**1. ClickFlare → n8n**

Fire an event and open **Executions**. The run should show the click ID and payout as real values, not the macro text.

**2. n8n → ClickFlare**

Run the HTTP Request node with a recent click ID. The conversion should appear under the right custom conversion with the right payout.

***

## Troubleshooting

> [accordion] ClickFlare events don't reach n8n
>
> * ClickFlare points at the test URL. Use the production URL after you publish.
> * The workflow isn't published, so the production URL isn't registered.
> * The header in ClickFlare's **Advanced configuration** doesn't match the Webhook node's Header Auth credential. n8n rejects the request.
> * An IP allowlist on the node blocks ClickFlare.
> * A self-hosted instance isn't reachable from the internet, or has no valid HTTPS certificate.

> [accordion] The POST to ClickFlare runs but no conversion appears
>
> * The expression for `cf_click_id` returns nothing. Check the path in the input panel: webhook data sits under `body`.
> * `ct` doesn't match a custom conversion exactly.
> * The URL isn't your tracking domain with `/cf/cv`.
>
> See [Troubleshooting S2S postbacks](/docs/en/tracking/troubleshooting-s2s-postback-url-in-clickflare.md).

> [accordion] The API returns 401
>
> The `api-key` header is missing or wrong. Check the credential's name and value, and that the node uses it.

***

## FAQ

> [accordion] Does ClickFlare integrate with n8n?
>
> Yes, both ways. ClickFlare's Custom Webhook sends events to an n8n Webhook node, and the HTTP Request node posts conversions to /cf/cv or calls the ClickFlare REST API.

> [accordion] Which n8n URL do I paste into ClickFlare?
>
> The **Production URL**, after you publish the workflow. Use the test URL only while you build.

> [accordion] Can I send each campaign to its own workflow?
>
> Yes. Set up the webhook on the campaign itself, or use one workflow and a **Switch** node on the campaign ID you send in a macro. See [Custom Webhook](/docs/en/integrations/custom-webhook-integration.md).

> [accordion] Can n8n use the ClickFlare MCP server instead of the API?
>
> The MCP server is meant for AI assistants. For fixed automations, the REST API is the simpler route. See [ClickFlare MCP](/docs/en/advanced-features/click-flare-ai-integration-mcp.md).

***

## Related

> [card] [Custom Webhook](/docs/en/integrations/custom-webhook-integration.md)
>
> Send any event out

> [card] [API overview](/docs/en/api/clickflare-api-overview.md)
>
> Keys and endpoints

> [card] [Zapier](/docs/en/integrations/zapier-click-flare-integration-guide.md)
>
> The same with Zapier


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.