Skip to content

Funnels

Beta

A saved funnel, step by step: how many visitors reached each step, where visits dropped off and what they viewed next, and who started and finished, as the Funnels report counts them.

GET/api/v1/sites/{site}/funnels/{funnel}

Parameters

NameWhat it does
siteIn the path, requiredThe site’s ID. Sites lists the ones your key can read.
funnelIn the path, requiredA saved funnel’s ID, such as rp_b244ywihrp. Find a funnel’s ID
periodOptionaltoday, yesterday, 7d, 30d, 90d, 52w, or a range of days or hours. The last 30 days if left out. Periods
againstOptionalprevious, month, or year. Adds compared to the response.
timezoneOptionalA time zone name, such as America/New_York. The site’s own if left out.
channel … contentOptionalAny of the 14 filters, such as country=SE. They combine. Filters
segment, cohortOptionalA saved segment’s or cohort’s ID.

Find a funnel’s ID

The API reads funnels you’ve saved in the app. Their steps come from the saved funnel; the period, comparison, and filters come from your request.

1

Open the site’s Reports › Funnels. Its saved funnels are listed first.

2

Open a saved funnel, or select New funnel, pick 2 to 6 steps, and use Save report… in the header. Any member of the workspace can save one.

3

Copy the ID from the address, after report=: app.lyli.io/sites/<site>/reports/funnel?report=<funnel>.

Renaming a funnel or saving changes to it keeps its ID. Changes you haven’t saved aren’t read: the API reads the steps as saved.

Request

An example site’s saved funnel, Pricing to trial, over the last 30 days, compared with the 30 days before.

Your terminal
curl -G https://app.lyli.io/api/v1/sites/s_k3m9x2p7qa/funnels/rp_b244ywihrp \
  -H "Authorization: Bearer $LYLI_API_KEY" \
  -d period=30d \
  -d against=previous \
  -d timezone=Europe/Stockholm

Response

200 OK · application/json
{
  "site": "s_k3m9x2p7qa",
  "period": {
    "key": "30d",
    "from": "2026-10-24",
    "to": "2026-11-22",
    "timezone": "Europe/Stockholm",
    "interval": "day"
  },
  "funnel": { "id": "rp_b244ywihrp", "name": "Pricing to trial" },
  "steps": [
    { "kind": "page", "match": "/pricing", "visitors": 108 },
    { "kind": "page", "match": "/signup", "visitors": 33 },
    { "kind": "event", "match": "signup_completed", "visitors": 22 },
    { "kind": "event", "match": "trial_started", "visitors": 10 }
  ],
  "totals": {
    "started": 108,
    "finished": 10,
    "conversion": 9.3,
    "median_seconds": 96
  },
  "drops": [
    {
      "after_step": 1,
      "visits": 75,
      "next": [
        { "page": null, "visits": 59 },
        { "page": "/features", "visits": 9 },
        { "page": "/", "visits": 7 }
      ]
    },
    {
      "after_step": 2,
      "visits": 11,
      "next": [
        { "page": null, "visits": 10 },
        { "page": "/docs/getting-started", "visits": 1 }
      ]
    },
    {
      "after_step": 3,
      "visits": 12,
      "next": [
        { "page": null, "visits": 9 },
        { "page": "/docs/getting-started", "visits": 3 }
      ]
    }
  ],
  "who": {
    "channel": [
      { "value": "direct", "started": 45, "finished": 5 },
      { "value": "search", "started": 45, "finished": 5 },
      { "value": "social", "started": 9, "finished": 0 },
      { "value": "ai", "started": 6, "finished": 0 },
      { "value": "email", "started": 3, "finished": 0 }
    ],
    "device": [
      { "value": "desktop", "started": 53, "finished": 8 },
      { "value": "mobile", "started": 40, "finished": 2 },
      { "value": "tablet", "started": 15, "finished": 0 }
    ],
    "country": [
      { "value": "SE", "started": 30, "finished": 0 },
      { "value": "DE", "started": 29, "finished": 4 },
      { "value": "US", "started": 23, "finished": 3 },
      { "value": "GB", "started": 11, "finished": 1 },
      { "value": "FR", "started": 8, "finished": 1 },
      { "value": "NL", "started": 7, "finished": 1 }
    ]
  },
  "compared": {
    "from": "2026-09-24",
    "to": "2026-10-23",
    "totals": {
      "started": 96,
      "finished": 12,
      "conversion": 12.5,
      "median_seconds": 90
    }
  }
}

An example site’s numbers.

FieldWhat it holds
periodThe period read, in the same shape as the Overview’s.
funnelThe saved funnel’s ID and name.
stepsIts steps in order: kind, page or event; match, the path (which may end in *) or the event’s name; and visitors, the visitors who did this step and every one before it, in order, in one visit.
totals.startedVisitors who did step 1.
totals.finishedVisitors who did every step.
totals.conversionFinished as a share of started, in percent. null when nobody started.
totals.median_secondsThe median time from step 1 to the last step, in seconds, over the visits that finished. null when none did.
dropsOne entry for each gap between steps: after_step names the step, and visits counts the visits that did it but not the next one.
drops[].nextWhere those visits went instead: the next page each one viewed, the 5 most common at most, most visits first. page is null for visits that left the site.
whoWho started and who finished, by channel, device, and country: each value as its filter takes it, with started, the visitors who did step 1, and finished, those who did every step. Most started first, at most 50 each.
comparednull, or with against: the other period’s from, to, and totals. Also null when that period starts before the site’s data does.

How it’s counted

  • Steps in order, in one visit. Each visit that starts in the period and matches your filters, segment, and cohort goes through its page views and custom events in the order they happened. Other pages in between are fine.
  • A visitor counts at a step when any of their visits got that far.
  • Steps count visitors; drops count visits. Someone whose two visits stopped at step 1 is one visitor at step 1 and two visits in its drop, so the drops don’t have to match the differences between steps.
  • Only the period counts. What a visit does after the period ends isn’t counted.

Errors

StatusCodeWhen
400invalid_parameterA period, filter, or time zone we can’t parse, a segment or cohort the site doesn’t have, or against=month for a period longer than 5 weeks.
402workspace_pausedThe workspace is paused.
403site_not_allowedYour key doesn’t have access to this site.
404not_foundNo site with this ID in the workspace, or no saved funnel with this ID on the site, including a saved report of another kind.

Every endpoint can also return 401 (missing, revoked, or expired key) and 429 (rate limit reached). All errors

Start from a report

On a saved funnel, Copy as API request in the Share menu gives this request as curl, with the funnel’s ID and the period, comparison, filters, segment, cohort, and time zone you’re looking at. It reads your API key from the LYLI_API_KEY environment variable, so a copied request never contains a key.

On a funnel that isn’t saved, the item asks you to save it first, and on one with unsaved changes, to save your changes first.