Skip to main content

Funnels

Create a funnel

Define a step sequence, two to seven steps.

POST/sites/{siteId}/funnels
Create a funnel
curl --request POST \
  --url 'https://truestat.io/api/v1/sites/{siteId}/funnels' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "steps": [
    {
      "kind": "view",
      "match": "equals",
      "value": "<string>"
    }
  ],
  "window_seconds": 2592000
}'
{
  "data": {
    "id": "4871b75d-ca85-467c-9475-6ab6011c9abf",
    "name": "Signup flow",
    "steps": [
      {
        "kind": "view"
      },
      {
        "kind": "view",
        "match": "starts_with",
        "value": "/pricing"
      },
      {
        "kind": "goal",
        "value": "signup"
      }
    ],
    "created_at": "2026-09-16T19:34:51.040Z",
    "updated_at": "2026-09-16T19:34:51.040Z",
    "window_seconds": 604800
  },
  "meta": {
    "site_id": "6fed8980-a119-4a9c-a4d4-53e448ef9f9e"
  }
}

See Funnels for what window_seconds actually means, the three step kinds, and why editing a funnel changes its past figures.

Authorizations

Authorizationstringheaderrequired

An API key from Settings → API keys. Scopes available: analytics:read, sites:read, sites:write, settings:read, settings:write, goals:read, goals:write, funnels:read, funnels:write, notes:read, notes:write, alerts:read, alerts:write, team:read, team:write, revenue:read, revenue:write.

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path parameters

siteIdstring (uuid)pathrequired
The site's id, from `GET /sites`. A site that is not yours and a site that does not exist both answer 403, so this cannot be used to discover other people's ids.

Request bodyapplication/json

namestringbodyrequired
Free text — a funnel name is read on screen and never appears in code, so "Signup → Paid" is fine.
stepsobject[]bodyrequired
The ordered sequence. Replaced whole on edit, never merged.
window_secondsenum<integer>body
How long one visitor has to finish: an hour, a day, a week, 30 days or 90 days.
options:36008640060480025920007776000

Response

application/json

The answer.

dataobject
metaobject