Marketing API

Manage A/B testing, analytics, funnels, and ad platform integrations programmatically.

Get your API key

Experiments (A/B Testing)

GET /api/v1/projects/{project_id}/experiments/

List experiments. Filter: ?status=running

POST /api/v1/projects/{project_id}/experiments/

Create an A/B test experiment.

{
  "name": "Homepage CTA Test",
  "description": "Testing red vs blue CTA button",
  "control_landing": "uuid-of-control-page",
  "variant_landing": "uuid-of-variant-page",
  "variant_weight": 50,
  "goals": [
    {"name": "Form Submit", "goal_type": "form_submit", "is_primary": true}
  ]
}

Goal types: form_submit | click | time_on_page | scroll_depth | custom_event

GET PUT DELETE /api/v1/projects/{project_id}/experiments/{experiment_id}/

Get, update, or delete. Cannot edit/delete running experiments - pause first.

POST /api/v1/projects/{project_id}/experiments/{experiment_id}/start/

Start an experiment.

POST /api/v1/projects/{project_id}/experiments/{experiment_id}/pause/

Pause a running experiment.

Status flow: draft → running ↔ paused → completed

GET /api/v1/projects/{project_id}/experiments/{experiment_id}/results/

Get experiment results with visitor counts, conversion rates, statistical significance, and per-goal breakdown.

Analytics

GET /api/v1/projects/{project_id}/analytics/summary/

Standard analytics endpoint — the same numbers as the dashboard: visitors (distinct daily visitor id), page views and leads with the change vs the previous period, per-day series, top pages, sources, UTM campaigns, devices, countries and, for shops, orders and revenue. Bots never count. MCP: escalateflow_analytics_summary.

Period (all analytics endpoints): ?days=7, ?period=7d (same) or ?date_from=2026-11-01&date_to=2026-11-07 (whole days, date_to inclusive). Default: last 30 days. Max 365 days.

GET /api/v1/projects/{project_id}/analytics/pageviews/

The individual page views behind summary (bots excluded), newest first. Filters: ?path=/pricing/, ?utm_source=google, limit/offset.

GET /api/v1/projects/{project_id}/analytics/conversions/

The leads behind summary.totals.leads (form submissions of this website, bots excluded).

GET /api/v1/projects/{project_id}/analytics/overview/ Deprecated · removed 2026-12-14

Old name of summary: its totals as total_pageviews, unique_visitors, total_conversions, conversion_rate. Answers with Deprecation/Sunset headers. Use summary.

GET /api/v1/projects/{project_id}/analytics/top-pages/ Deprecated · removed 2026-12-14

Same as summary.top_pages. Use summary.

GET /api/v1/projects/{project_id}/analytics/utm/ Deprecated · removed 2026-12-14

Per-campaign views/visitors/leads (same source as summary.utm_sources/campaigns). Use summary.

Funnels

GET POST /api/v1/projects/{project_id}/funnels/
GET PUT DELETE /api/v1/projects/{project_id}/funnels/{funnel_id}/

Create Funnel

{
  "name": "Lead Gen Funnel",
  "description": "Multi-step lead capture"
}

Funnel Steps

GET POST /api/v1/projects/{project_id}/funnels/{funnel_id}/steps/
PUT DELETE /api/v1/projects/{project_id}/funnels/{funnel_id}/steps/{step_id}/
POST /api/v1/projects/{project_id}/funnels/{funnel_id}/steps/reorder/

Step types: landing | thank_you | appointment | redirect

Funnel Goals

GET POST /api/v1/projects/{project_id}/funnels/{funnel_id}/goals/

Funnel Analytics

GET /api/v1/projects/{project_id}/funnels/{funnel_id}/analytics/

Returns total visitors, conversions, conversion rate, and per-step breakdown.

Ad Platforms & Conversions

Ad Platform Connections

GET POST /api/v1/projects/{project_id}/ad-platforms/
GET PUT DELETE /api/v1/projects/{project_id}/ad-platforms/{connection_id}/

Platforms: facebook | google | tiktok | linkedin | posthog | webhook

Conversion Goals

GET POST /api/v1/projects/{project_id}/conversion-goals/
GET PUT DELETE /api/v1/projects/{project_id}/conversion-goals/{goal_id}/

Conversion Logs

GET /api/v1/projects/{project_id}/conversion-logs/

Filter: ?status=failed&platform=facebook

POST /api/v1/projects/{project_id}/conversion-logs/{log_id}/retry/

Retry a failed conversion event.