Segment

SegmentList

Get list of Segments . Segments can refer to any Table.

The two main tables you will be working with are User and Content.

# Grab all segments from "user" table

curl "$LIOAPI/api/segment" -s -H "Authorization: $LIOKEY" | jq '.'

# Grab all "Content Collections" (ney, segments)

curl "$LIOAPI/api/segment?table=content" -s -H "Authorization: $LIOKEY" | jq '.'


get/api/segment

Request

  • Base URL
    https://api.lytics.io
  • URL
    https://api.lytics.io/api/segment
  • Auth
    API key in header Authorization

Query parameters

account_idstring

Your Lytics account ID.

tablestring

Table for segments to fetch, "user" by default, specify "content" for content collections (aka segments).

validstring

True, False or "all". Get all segments, only valid, or only invalid.

Response

OK

Example response

{
  "data": [
    {
      "id": "7a7f76ff97ad0e3e96c162f74aee8f8f",
      "account_id": "4f7b525bdba058fc096757a6",
      "author_id": "user_12345",
      "kind": "segment",
      "segment_ql": "FILTER AND ( visits > 5, last_visit >= \"2015-04-01 00:00:00Z\", last_visit <  \"2015-04-02 00:00:00Z\")",
      "created": "2014-08-04T21:18:20.124Z",
      "updated": "2014-08-04T21:18:20.124Z",
      "description": "Casual users have been active in the last 90 days and show no extreme behavioral patterns.",
      "is_public": true,
      "name": "Recent Visits",
      "slug_name": "recent_visits",
      "tags": [
        "email_trigger"
      ]
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.