Skip to Content
Torque Lift Docs
Your numbers

Get segments

GET
/v1/segments

Who the users are and how they arrived: active or new users by user segment (channel, source, medium, campaign, platform, device, os, language, region, landing_page, and the live ones app_version, browser, browser_version, os_version, sdk_version, consent, variant), one dimension at a time, in the period ending end and the one before. A user is in one value per dimension (their first-touch value; a live dimension's is the value they had on their last active day in the period for active users, on the day they were first seen for new users), so a dimension's values add up to everyone. Channel groups the sources (Organic, Search, Paid, Social, Email, Referral, Other); source is the site or tag behind it. A value with fewer than 20 users in both periods is left out (hidden_values). Counts only, never a user.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

A secret key, tl_live_...

Query Parameters

grain?Grain

day, week (7 days) or month (28 days) ending on end.

Default"week"
Value in"day""week""month"
measure?Measure

Active users, or new users.

Default"active"
Value in"active""new"
end?|

The period's last day: a Sunday for an ISO week. Default yesterday, the latest closed day.

Header Parameters

Torque-Tenant?|

An operator key's tenant to read; refused with a tenant's key.

Torque-Version?string|null

Response Body

Successful Response

application/json
  1. response
object?Object
Default"list"
data*array<>
has_more*Has More
measure*Measure
grain*Grain
period_end*Period End

The last day of the period asked for.

previous_period_end*Previous Period End
hidden_values*

Values left out of data, by dimension: fewer than 20 users in both periods.

queries*array<>
Example Request
curl -X GET 'https://api.torquelift.ai/v1/segments'
Example Response
{  "object": "list",  "data": [    {      "object": "segment_value",      "dimension": "string",      "value": "string",      "previous": 0,      "current": 0    }  ],  "has_more": true,  "measure": "string",  "grain": "string",  "period_end": "string",  "previous_period_end": "string",  "hidden_values": {    "property1": 0,    "property2": 0  },  "queries": [    {      "name": "string",      "sha256": "string",      "model": "string",      "params": {        "property1": "string",        "property2": "string"      },      "ran_at": "string"    }  ]}