Custom API / Webhook Integration
Use the RapidMetrics server webhook to send purchases and leads from any platform we don't connect to directly: your own website's backend, a payment provider, or an automation tool like Zapier or Make.
Before You Start
- Create a funnel on the Funnels page with New Funnel. For your own website, choose Custom Website as the platform.
- Find your funnel ID: on the Funnels page, click the code icon on your funnel's row. The first line of the tracking script shows it:
<!-- RapidMetrics - Funnel: YOUR_FUNNEL_ID --> - Find your API key under Integrations → Custom / API → Setup. Only the workspace owner or an admin can see it. See Managing API Keys.
Authentication
Send every request to your funnel's address below, with your API key in the x-api-key header.
POST https://api.rapidmetrics.ai/v1/webhook/custom/YOUR_FUNNEL_ID
Content-Type: application/json
x-api-key: YOUR_API_KEY
Sending a Purchase Event
{
"event": "purchase",
"email": "[email protected]",
"amount": 97.00,
"currency": "USD",
"product_name": "My Product",
"order_id": "ORD-123"
}
event,emailandamountare required. The amount must be more than 0.currencyis a 3-letter code. If you leave it out, USD is used.- Send a unique
order_id, so the same order is never counted twice. - RapidMetrics also sends the Purchase to Facebook for each pixel on the funnel. Do not fire a Purchase from the browser as well, or Facebook counts it twice.
Sending a Lead Event
{
"event": "lead",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe"
}
Each lead you send adds one to that day's Leads for the funnel. Leads sent this way are not sent to Facebook.
Showing Which Ad Brought the Sale
If your checkout is on another website, add source_url to the purchase: the address of the page the buyer first landed on, with the ad parameters still in it. If your platform keeps the ad ids as separate fields, send rm_aid, rm_adsid and rm_cid instead. They must be the numeric Facebook ids.
Checking It Worked
A successful request gets the answer "status": "success". Open the profile icon → Logs → Webhooks to see the purchases and leads RapidMetrics received and what it did with each one.
A request with a wrong API key, a wrong funnel ID or a missing field is refused and does not appear in the log. The answer to that request says what was wrong.
All fields, responses and error codes are in the developer documentation.

