Events API
Create, update, look up, list, and remove StreamLayer events from your backend over HTTP, using your own provider id or the StreamLayer event id.
An event is the StreamLayer entity linked to your stream — usually one game or broadcast. Everything you configure in StreamLayer Studio (games, promotions, features) hangs off an event, and your app opens an SDK session with that event's id.
Use the Events API to create events from your own scheduling system instead of creating them by hand in Studio. You give each event your own id (providerId), so you can address it later without storing the StreamLayer id.
Full schema referenceEvery field, response schema, and error is documented in the Events API OpenAPI reference.
Base URL and authentication
https://api.streamlayer.io/datasets
Authenticate every request with your Private API Key, sent as a bearer token:
Authorization: Bearer {PRIVATE_API_KEY}
Find the key in Studio under Settings → Developer → Private API Key. This is not the SDK Key you put in your app — keep the Private API Key on your server and never ship it in a client.
All endpoints are POST with a JSON body, except GET /get, which takes query parameters. Every request is scoped to the organization that owns the key, and kind is always "event".
| Method | Path | Purpose |
|---|---|---|
| POST | /create | Create an event |
| POST | /update | Change fields on an event |
| GET | /get | Fetch one event |
| POST | /list | List your organization's events |
| POST | /remove | Detach an event from your org |
Event ids
Every endpoint that targets one event takes an id. You can pass either:
- Your provider id — the string you sent in
event.raw.providerIdon create, or - The StreamLayer id — the numeric id returned in
data.event.idon create.
Create an event
POST /create
Required fields
| Field | Type | Description |
|---|---|---|
kind | string | Always "event". |
event.raw.providerId | string | Your own id for the event. Must be unique in your organization. |
Minimal request
curl --location 'https://api.streamlayer.io/datasets/create' \
--header 'Authorization: Bearer {PRIVATE_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"kind": "event",
"event": {
"raw": {
"providerId": "match-2026-11-01-atl-mia"
}
}
}'With only a providerId, the event is scheduled for the time of the request, its status is 1 (pregame), and its name is set to Event YYYY-MM-DD.
Request with optional fields
curl --location 'https://api.streamlayer.io/datasets/create' \
--header 'Authorization: Bearer {PRIVATE_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"kind": "event",
"event": {
"raw": {
"providerId": "match-2026-11-01-atl-mia"
},
"scheduled": "2026-11-01T14:00:00.000Z",
"status": 1,
"venue": {
"city": "Atlanta",
"country": "USA",
"stadium": "State Farm Arena"
},
"customFields": {
"name": "ATL vs MIA",
"logo": "https://example.com/logos/atl-mia.png"
}
}
}'Optional fields
| Field | Type | Description |
|---|---|---|
scheduled | string (ISO 8601) | Scheduled start time. Defaults to the time of the request. |
status | integer | Event status — see Event status values. Defaults to 1 (pregame). |
startTime | string (ISO 8601) | Actual start time. |
endTime | string (ISO 8601) | Actual end time. |
venue | object | city, country, stadium — strings, 1–128 characters each. |
customFields | object | Free-form configuration stored with the event. name and logo set the event name and logo shown in Studio. You can add any other keys. |
league | number | StreamLayer league id. |
season | number | StreamLayer season id. Resolved from league when omitted. |
homeTeam | number | StreamLayer team id of the home team. |
awayTeam | number | StreamLayer team id of the away team. |
endless | integer | 0 unset, 1 enabled, 2 disabled. |
Response
The new event is returned in data.event. Store data.event.id if you want to address the event by its StreamLayer id. Abbreviated example:
{
"data": {
"event": {
"id": 4467,
"attributes": {
"id": 4467,
"scheduled": "2026-11-01T14:00:00.000Z",
"status": 1,
"customFields": "{\"name\":\"ATL vs MIA\",\"logo\":\"https://example.com/logos/atl-mia.png\"}",
"venue": { "city": "Atlanta", "country": "USA", "stadium": "State Farm Arena" }
},
"meta": {
"created": "2026-10-05T12:00:00.000Z",
"updated": "2026-10-05T12:00:00.000Z"
}
}
}
}Note that customFields comes back as a stringified JSON object.
If an event with the same providerId already exists in your organization, the API returns 409.
Update an event
POST /update
Only the fields you send are changed. Accepts the same event fields as create, except season.
| Field | Type | Required | Description |
|---|---|---|---|
kind | string | Yes | Always "event". |
id | string or number | Yes | Your provider id or the StreamLayer id. |
event | object | Yes | Fields to change. Send raw.providerId to re-point the event to a new provider id. |
curl --location 'https://api.streamlayer.io/datasets/update' \
--header 'Authorization: Bearer {PRIVATE_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"kind": "event",
"id": "match-2026-11-01-atl-mia",
"event": {
"status": 2,
"startTime": "2026-11-01T14:05:00.000Z"
}
}'Get an event
GET /get?kind=event&id={id}
URL-encode the id if your provider id contains spaces or special characters.
curl --location 'https://api.streamlayer.io/datasets/get?kind=event&id=match-2026-11-01-atl-mia' \
--header 'Authorization: Bearer {PRIVATE_API_KEY}'Returns the event in data.event, including data.event.meta.raw with your provider id. Returns 404 if no event with that id belongs to your organization.
List events
POST /list
curl --location 'https://api.streamlayer.io/datasets/list' \
--header 'Authorization: Bearer {PRIVATE_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"filter": {
"kind": "event"
},
"sort": {
"field": "scheduled",
"order": "DESC"
},
"pagination": {
"page": 1,
"pageSize": 20
}
}'| Field | Required | Description |
|---|---|---|
filter.kind | Yes | Always "event". |
filter.league | No | League id or alias, or an array of them. |
sort | No | field (default scheduled) and order (ASC or DESC, default DESC). |
pagination | No | page (default 1) and pageSize (default 100). Omit pagination entirely to return all events. |
query | No | Extra conditions — see below. |
The response returns events in data (an array) and the total number of matches, ignoring pagination, in meta.count.
Query conditions
query narrows the list further. Each operator takes an array of { "key", "value" } conditions:
| Operator | Value | Matches when the field… |
|---|---|---|
eq | string or number | equals the value |
ne | string or number | does not equal the value |
match | string | matches the text (case-insensitive) |
is | "true", "false", "null" | is true, false, or null |
includes | array of strings | equals any value in the array |
between | array of two strings | falls between the two values (inclusive) |
Example — events scheduled in November 2026:
{
"filter": { "kind": "event" },
"query": {
"between": [
{ "key": "scheduled", "value": ["2026-11-01T00:00:00.000Z", "2026-11-30T23:59:59.999Z"] }
]
}
}Remove an event
POST /remove
Detaches the event from your organization. The underlying event record is kept.
curl --location 'https://api.streamlayer.io/datasets/remove' \
--header 'Authorization: Bearer {PRIVATE_API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"kind": "event",
"id": 4467
}'Event status values
| Value | Status |
|---|---|
0 | Unset |
1 | Pregame |
2 | Active |
3 | Break |
4 | Overtime |
5 | Shootouts |
6 | Postgame |
7 | Cancelled |
status is always returned as an integer.
Errors
Errors return JSON with statusCode, error, and message.
| Status | When |
|---|---|
400 | Validation failed, kind is not "event", or event.raw.providerId is missing on create. |
401 | Authorization header is missing (missing authorization header), is not a Bearer token (wrong token type), or the key is invalid (invalid token). |
404 | No event with this id belongs to your organization. |
409 | On create: an event with this providerId already exists. |
Related
- Managing Events — Create and configure events in StreamLayer Studio
- Developer Settings — Find your SDK Key and Private API Key
- Events API OpenAPI reference — Full request and response schemas
Updated 4 days ago
