Developing with Lytics / Lytics API Documentation

System Events

Get internal Lytics system events. These events are generally related to internal changes to state of an account. Common changes are CRUD Operations (Create, Update, Delete) of Account, Admin User, etc.

System Events

/api/event{?id,type,verb,limit,before,after}

Get list of system events.

Parameters
beforestring (optional)
Default: now-3d
Start fetching items with dates older than: "now-3d" (now-2h, now-1w, "2016-03-03"). Date math, or absolute date.
afterstring (optional)
Default: now-3d
Start fetching items with dates after: "now-3d" (now-2h, now-1w, "2016-03-03"). Date math, or absolute date.
limitinteger (optional)
Default: 20
Should segments this user is member of be included?
verbstring (optional)
Default: ``
Verb (created, updated, deleted, status, clustered)
typestring (optional)
Default: ``
Type of Object (entity, segment, work, account, user)
idstring (optional)
Default: ``
Id of Object (entity, segment, work, account, user)
GET

System Events Query

/api/event{?id,type,verb,limit,before,after}

Get list of system events.

# get the dashboard news items
curl -s -H "Authorization: $LIOKEY" \
  -XGET "https://api.lytics.io/api/event?query=dashboard_news" | jq '.'

# get list of all segments created in last 2 weeks
curl -s -H "Authorization: $LIOKEY" \
  -XGET "https://api.lytics.io/api/event?type=segment&start=now-2w&limit=100&verb=created" | jq '.'


# get list of all events performed by user X
# 1) first find a user id
curl -s -H "Authorization: $LIOKEY" \
  -XGET "https://api.lytics.io/api/user/[email protected]" | jq '.'

# 2) get the id for that user
curl -s -H "Authorization: $LIOKEY" \
  -XGET "https://api.lytics.io/api/event?type=user&id=USER_ID_FROM_PREVIOUS" | jq '.'

Response 200

Headers
Content-Type: application/json
Body
{
    "data": [
        {
            "id": "13564999017e8b0e9994ff16411fd19b",
            "ts": "1465584982676",
            "priority": 2,
            "subject_type": "topic-document",
            "subject_id": "-1894399319812759219",
            "verb": "created",
            "account_id": "fake46b7afad96f3a4e4b41cee40ecd6"
        },
        {
            "id": "c57172d7d22e1c7ac4c80ce713e6e7cb",
            "ts": "1465844458666",
            "priority": 2,
            "subject_type": "entity",
            "subject_id": "user/email/[email protected]",
            "verb": "clustered",
            "related": [
                {
                    "type": "segment",
                    "id": "791734b084019d99c82a475264464304"
                }
            ],
            "account_id": "fake46b7afad96f3a4e4b41cee40ecd6",
            "context": {
                "in": "2016-06-13T18:58:29Z"
            }
        }
    ],
    "message": "success",
    "status": 200
}

System Event

/api/event/:id
GET

System Event Fetch

/api/event/:id

Get Single System Event

Response 200

Headers
Content-Type: application/json
Body
{
    "data": {
        "id": "c57172d7d22e1c7ac4c80ce713e6e7cb",
        "ts": "1465844458666",
        "priority": 2,
        "subject_type": "entity",
        "subject_id": "user/email/[email protected]",
        "verb": "clustered",
        "related": [
            {
                "type": "segment",
                "id": "791734b084019d99c82a475264464304"
            }
        ],
        "account_id": "fake46b7afad96f3a4e4b41cee40ecd6",
        "context": {
            "in": "2016-06-13T18:58:29Z"
        }
    },
    "message": "success",
    "status": 200
}