How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Lytics Subscription API

**BETA API**Subscriptions are queries into real-time events in Lytics, mostcommonly listening to a list of users entering/leaving segmentsie _triggers_.**Common Use Cases*** Upon Entering/Leaving you want to send a notification callback with that user data so you can email them, save it, etc.* Upon Entering Segment, get notified, save an update to a local user-profile so next time they log in, used in your app.* Upon Entering Segments, get updated with many segments user is member of, and update list of messages user will see next time they logon to app.**Channels**Types of streams the event can be delivered.* *Webhooks** *AWS Kinesis** *Azure Event-Hub** *??? Ask us* Google PubSub.Some features:* *withbackfill* this true/false flag to indicate whether to backfill webhook events for users currently a member of a segment. Default is false, so only new users entering/exiting a segment would cause a webhook. If you enter withbackfill=true then all users currently a member of the segment at time of submission would have a webhook fired for them as well, then changes going forward would start firing. If backfill is used, only a single segment can be specified.**Example**```export LIOKEY="your_api_key"export LIODATAKEY="your_data_key"# UPSERT Segment uses "ALIAS" as id for create/updatecurl -s -H "Authorization: $LIOKEY" -H "Content-Type: text/plain" \ -XPOST "https://api.lytics.io/api/segment" -d '-- Paying Users SegmentFILTER AND ( paying_user = "t")FROM userALIAS demo_segment' | jq '.'# get that Segment IDSEGID=`curl -s "https://api.lytics.io/api/segment?key=$LIOKEY" | jq -r '.data[] | select(.name == "demo_segment") | .id'`echo "Created Segment id=$SEGID"# Create Webhook Subscription to send entry/exits events to your url# - entry/exits will be sent to the ngrok url below (create your own)# - we use app-engine for thisecho '{ "webhook_url": "http://123456abc.ngrok.com/" , "segment_ids": ["1234abcd"] , "withbackfill": false , "channel" : "webhook" , "name" : "webhooktest1" , "description": "What is this subscription for?"}' | \curl -v -XPOST "https://api.lytics.io/api/subscription" \ -H "Authorization: $LIOKEY" \ -H "Content-Type: application/json" -d @- | jq '.'# for kinesiscurl -s -H "Authorization: $LIOKEY" -H "Content-Type: application/json" \ -XPOST "https://api.lytics.io/api/subscription" -d '{ "channel":"kinesis", "segment_ids": ["1234abcd","abc345"], "name":"test2", "description":"hello world", "stream":"lytics_triggers_stream", "region": "us-east-1", "identifier_field":"user_id", "role_arn":"arn:aws:iam::4444444444444:role/LyticsWriteToKinesis"}' | jq "."# send test data ...# toggling these next two should move user in/out of segment causing triggercurl -s -XPOST "https://api.lytics.io/collect/json/demo" -H "Authorization: $LIODATAKEY" -H 'Content-type: application/json' \ -d '{ "paying_user":"f", "user_id":"user123"}' | jq '.'curl -s -XPOST "https://api.lytics.io/collect/json/demo" -H "Authorization: $LIODATAKEY" -H 'Content-type: application/json' \ -d '{ "paying_user":"t", "user_id":"user123"}' | jq '.'```**Webhook Post Example**This will send a json document like below to your subscription channel.But, this is a **BETA API** and this will change. Wereceived feedback that the more logical set of datais all segment changes (not just one per subscription) so weare modifying the response to be an array of segment entry/exits.## Example MessageThere are still message format from v1 of this api tomaintain backwards compatibility.```{ "data": { "_created": "2016-06-29T18:50:16.902758229Z", "_modified": "2017-03-18T06:12:36.829070108Z", "email": "testwebhook@lytics.io", "user_id": "user123", "segment_events":[ { "id": "d3d8f15855b6b067709577342fe72db9", "event": "exit", "enter": "2017-03-02T06:12:36.829070108Z", "exit": "2017-03-18T06:12:36.829070108Z", "slug": "demo_segment" }, { "id": "abc678asdf", "event": "enter", "enter": "2017-03-02T06:12:36.829070108Z", "exit": "2099-03-18T06:12:36.829070108Z", "slug": "another_segment" } ] }, "meta":{ "object":"user", "source":"subscription", "subscription_id": "7e2b8804bbe162cd3f9c0c5991bf3078" }}```

Lytics Subscription API is one of 34 APIs that Lytics publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Subscription. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, and an API reference.

This API exposes 4 operations across 2 paths, and defines 2 schemas. It is described by OpenAPI 3.2.0, at version 1.0.0.

Requests are made against a single base URL, https://api.lytics.io.

4 operations 2 paths 2 schemas 1 DELETE2 GET1 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
1.0.0
Base URL
https://api.lytics.io/v2
Authentication
API Key
Resource Areas
1

Authentication & Security 1

Lytics Subscription API declares 1 security scheme for authenticating requests. An API key is passed in the header as Authorization (ApiKeyAuth).

Paths & Operations 4

Across 2 paths, the API surfaces 4 operations — 1 DELETE, 2 GET, 1 POST. Each is listed below with its method, path, parameters, and response codes.

Subscription 4

BETA API Subscriptions are queries into real-time events in Lytics, most commonly listening to a list of users entering/leaving segments ie triggers. Common Use Cases Upon Enterin…

GET
/api/subscription
SubscriptionList
SubscriptionList 3 params → 200
POST
/api/subscription
Subscription Upsert
Subscription Upsert 1 param body → 200
GET
/api/subscription/{id}
Subscription Fetch
Subscription Fetch 2 params → 200
DELETE
/api/subscription/{id}
Subscription Delete
Subscription Delete 2 params → 204

Schemas 2

The contract defines 2 schemas that model the data the API accepts and returns. The most detailed are SubscriptionModel (1 property), SubscriptionListModel (1 property). Each schema is shown below with its type and property counts.

SubscriptionListModel
object
1 property
SubscriptionModel
object
1 property

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

lytics-subscription-api-openapi.yml Raw ↑

Other APIs Lytics publishes across the network.

Lytics Account API
Lytics Account Settings API
Lytics Auth API
Lytics Auths API
Lytics Catalog API
Lytics Connections API
Lytics Content API
Lytics Data Models API
Lytics Data Upload API
Lytics Experience API
Lytics Flows API
Lytics Jobs API
Where this information came from

This is an independent, third-party profile of Lytics Subscription API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.