Skip to content

Journeys

Beta

The paths visits take, step by step: from where they came in, from a page or custom event, or leading up to one, as the Journeys report counts them.

GET/api/v1/sites/{site}/journeys

Parameters

NameWhat it does
siteIn the path, requiredThe site’s ID. Sites lists the ones your key can read.
fromOptionalA path, such as /pricing, which may end in *, or a custom event’s name: the steps from the first time a visit did it. Without from or to, the steps from where each visit came in.
toOptionalA path or a custom event’s name: the steps leading up to the first time a visit did it. Give from or to, not both.
depthOptionalHow many steps, 3 to 7. 5 if left out, or 4 with to.
eventsOptional1 to count custom events as steps too, or 0 for pages only. 0 if left out. An event in from or to is a step either way.
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.

Request

Three steps from /pricing on an example site, the last 30 days.

Your terminal
curl -G https://app.lyli.io/api/v1/sites/s_k3m9x2p7qa/journeys \
  -H "Authorization: Bearer $LYLI_API_KEY" \
  -d from=/pricing \
  -d depth=3 \
  -d period=30d \
  -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"
  },
  "journey": {
    "direction": "from",
    "anchor": { "kind": "page", "match": "/pricing" },
    "depth": 3,
    "events": false
  },
  "totals": {
    "visits": 108,
    "went_on": 49,
    "came_in": 0,
    "paths": 11
  },
  "columns": [
    {
      "visits": 108,
      "steps": [
        { "kind": "page", "match": "/pricing", "visits": 108, "ends": 59 }
      ]
    },
    {
      "visits": 49,
      "steps": [
        { "kind": "page", "match": "/signup", "visits": 31, "ends": 26 },
        { "kind": "page", "match": "/features", "visits": 10, "ends": 5 },
        { "kind": "page", "match": "/", "visits": 8, "ends": 4 }
      ]
    },
    {
      "visits": 14,
      "steps": [
        { "kind": "page", "match": "/pricing", "visits": 8, "ends": 6 },
        { "kind": "page", "match": "/docs/getting-started", "visits": 5, "ends": 4 },
        { "kind": "page", "match": "/features", "visits": 1, "ends": 1 }
      ]
    }
  ],
  "paths": [
    {
      "steps": [
        { "kind": "page", "match": "/pricing" },
        { "kind": "page", "match": "/signup" }
      ],
      "visits": 26,
      "more": false,
      "came_in": false
    },
    {
      "steps": [
        { "kind": "page", "match": "/pricing" },
        { "kind": "page", "match": "/features" }
      ],
      "visits": 5,
      "more": false,
      "came_in": false
    },
    // … 7 more paths
    {
      "steps": [
        { "kind": "page", "match": "/pricing" },
        { "kind": "page", "match": "/signup" },
        { "kind": "page", "match": "/docs/getting-started" }
      ],
      "visits": 1,
      "more": true,
      "came_in": false
    }
  ],
  "compared": null
}

An example site’s numbers. The paths are shortened here; the response has all 10.

FieldWhat it holds
periodThe period read, in the same shape as the Overview’s.
journeyWhat was read, with the defaults filled in: direction, from or to; anchor, the page or event, or null for where visits came in; depth; and events.
totals.visitsVisits in the journey: every visit in the period, or with from or to, the visits that did its page or event.
totals.went_onFrom a page, event, or where visits came in: the visits with a second step. 0 leading to one.
totals.came_inLeading to a page or event: the visits that started on it, with no step before it. 0 from one.
totals.pathsHow many different paths there are, those of one step included.
columnsOne for each step, depth of them, in order. From, the first column is the page or event, or where visits came in; leading to, the last one is.
columns[].visitsThe visits at that step.
columns[].stepsThe step’s pages and events, most visits first, each with kind, match, visits, and ends. Past 100, the rest are one entry of kind other, whose count says how many pages and events it holds.
columns[].steps[].endsFrom: the visits that left the site after this step. Leading to: the visits that came in at this step.
pathsUp to 10 of the most common paths through the columns, most visits first, each with its steps and visits. From, a path has two steps or more: the visits that left after the first are its column’s ends.
paths[].moreFrom: the visits went on past the last column. The same steps can be listed twice, once with each value.
paths[].came_inLeading to: the visits came in at the path’s first step.
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

Each visit that starts in the period and matches your filters, segment, and cohort becomes a list of steps in the order they happened: its pages, and its custom events with events=1. A step repeated right away, such as a reload, counts once. Activity after the period ends doesn’t count.

  • From where visits came in: each visit’s first steps, up to depth.
  • From a page or event: the steps from the first time a visit did it. Visits that never did aren’t in the journey.
  • Leading to a page or event: the steps up to the first time a visit did it, so the last column is the page or event. A visit with fewer steps before it fills only the last columns.

The report’s diagram shows each step’s 5 largest pages and events; the API answers with its table, up to 100 a step. A step you highlight in the report isn’t part of the API.

Errors

StatusCodeWhen
400invalid_parameterBoth from and to, a from or to that’s neither a path nor an event’s name, a depth outside 3 to 7, events other than 0 or 1, against=month for a period longer than 5 weeks, a segment or cohort the site doesn’t have, or a period, filter, or time zone we can’t parse.
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.

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

Start from a report

Open the site’s Reports › Journeys and select Copy as API request in the Share menu. You get the journey on your screen as a curl request: from or to, depth, and events, then its period, comparison, filters, segment, cohort, and time zone. It reads your API key from the LYLI_API_KEY environment variable, so a copied request never contains a key.

A saved journey’s request carries its settings: the API doesn’t take a saved journey’s ID.