Event (private)
Create an Event via the private Events service.
In production, call this from your backend using your company’s API key. For development and testing, you can run it in your frontend to verify your integration without backend setup. Please use only unplanned events - scheduling planned events is still WIP
Time units: All timestamps shown are epoch nanoseconds (UTC).
Example create event
file.ts
export const createEvent = async () => {
const opts = {
method: 'POST',
headers: {
'content-type': 'application/json',
'Authorization': `Bearer ${'your-api-key'}`
},
body: JSON.stringify({
arguments: [
{
id: 'c2ed3890-716d-4380-a597-d860ecacada0',
kind: 'KindIndependent',
metadata: {
title: 'Launch AMA'
},
schedule: 'ScheduleUnplanned',
broadcast: {
orientation: 'BroadcastOrientationHorizontal'
},
}
]
})
};
const res = await fetch('https://event.dev.zu.casa/event.events.private.v1.Service/Create', opts).then(r => r.json());
return res.events[0];
};Sample response
file.json
{
"events": [
{
"id": "c2ed3890-716d-4380-a597-d860ecacada0",
"chat_id": "26cc372a-f415-49aa-aeef-4d15b9ae9637",
"room_id": "b37b4fd2-1068-4105-b26b-5ab627c6f8e4",
"kind": "KindIndependent",
"status": "StatusPending",
"metadata": {
"title": "Launch AMA"
},
"schedule": "ScheduleUnplanned",
"broadcast": {
"orientation": "BroadcastOrientationHorizontal"
},
"planned_start_time": 0,
"planned_finish_time": 0,
"start_time": 0,
"cancel_time": 0,
"finish_time": 0,
"access_time": 1757669000000000000,
"create_time": 1757669000000000000,
"update_time": 1757669000000000000
}
]
}Example start event
file.ts
export const startEvent = async () => {
const opts = {
method: 'POST',
headers: {
'content-type': 'application/json',
'Authorization': `Bearer ${'your-api-key'}`
},
body: JSON.stringify({
arguments: [
{
query: {
conditions: [
{
ids: [
'c2ed3890-716d-4380-a597-d860ecacada0'
]
}
]
}
}
]
})
};
const res = await fetch('https://event.dev.zu.casa/event.events.private.v1.Service/Start', opts).then(r => r.json());
return res.events[0];
};Sample response
file.json
{
"events": [
{
"id": "c2ed3890-716d-4380-a597-d860ecacada0",
"chat_id": "26cc372a-f415-49aa-aeef-4d15b9ae9637",
"room_id": "b37b4fd2-1068-4105-b26b-5ab627c6f8e4",
"kind": "KindIndependent",
"status": "StatusStarted",
"metadata": {
"title": "Launch AMA"
},
"schedule": "ScheduleUnplanned",
"broadcast": {
"orientation": "BroadcastOrientationHorizontal"
},
"planned_start_time": 0,
"planned_finish_time": 0,
"start_time": 1757670000000000000,
"cancel_time": 0,
"finish_time": 0,
"access_time": 1757669000000000000,
"create_time": 1757669000000000000,
"update_time": 1757669000000000000
}
]
}Example finish event
file.ts
export const finishEvent = async () => {
const opts = {
method: 'POST',
headers: {
'content-type': 'application/json',
'Authorization': `Bearer ${'your-api-key'}`
},
body: JSON.stringify({
arguments: [
{
query: {
conditions: [
{
ids: [
'c2ed3890-716d-4380-a597-d860ecacada0'
]
}
]
}
}
]
})
};
const res = await fetch('https://event.dev.zu.casa/event.events.private.v1.Service/Finish', opts).then(r => r.json
());
return res.events[0];
};Sample response
file.json
{
"events": [
{
"id": "c2ed3890-716d-4380-a597-d860ecacada0",
"chat_id": "26cc372a-f415-49aa-aeef-4d15b9ae9637",
"room_id": "b37b4fd2-1068-4105-b26b-5ab627c6f8e4",
"kind": "KindIndependent",
"status": "StatusFinished",
"metadata": {
"title": "Launch AMA"
},
"schedule": "ScheduleUnplanned",
"broadcast": {
"orientation": "BroadcastOrientationHorizontal"
},
"planned_start_time": 0,
"planned_finish_time": 0,
"start_time": 1757670000000000000,
"cancel_time": 0,
"finish_time": 1757670000000000000,
"access_time": 1757669000000000000,
"create_time": 1757669000000000000,
"update_time": 1757669000000000000
}
]
}Example cancel event
file.ts
export const cancelEvent = async () => {
const opts = {
method: 'POST',
headers: {
'content-type': 'application/json',
'Authorization': `Bearer ${'your-api-key'}`
},
body: JSON.stringify({
arguments: [
{
query: {
conditions: [
{
ids: [
'c2ed3890-716d-4380-a597-d860ecacada0'
]
}
]
}
}
]
})
};
const res = await fetch('https://event.dev.zu.casa/event.events.private.v1.Service/Cancel', opts).then(r => r.json
());
return res.events[0];
};Sample response
file.json
{
"events": [
{
"id": "c2ed3890-716d-4380-a597-d860ecacada0",
"chat_id": "26cc372a-f415-49aa-aeef-4d15b9ae9637",
"room_id": "b37b4fd2-1068-4105-b26b-5ab627c6f8e4",
"kind": "KindIndependent",
"status": "StatusCanceled",
"metadata": {
"title": "Launch AMA"
},
"schedule": "ScheduleUnplanned",
"broadcast": {
"orientation": "BroadcastOrientationHorizontal"
},
"planned_start_time": 0,
"planned_finish_time": 0,
"start_time": 1757670000000000000,
"cancel_time": 1757670000000000000,
"finish_time": 0,
"access_time": 1757669000000000000,
"create_time": 1757669000000000000,
"update_time": 1757669000000000000
}
]
}Schedule
| Name | Value | Description |
|---|---|---|
SchedulePlanned | 1 | Planned event. Requires planned_start_time (and optionally planned_finish_time). The system can pre‑provision resources ahead of time to minimize startup latency. |
ScheduleUnplanned | 2 | On‑demand event. No planned times required. |
BroadcastOrientation
| Name | Value | Description |
|---|---|---|
BroadcastOrientationVertical | 1 | Portrait layout (e.g., 9:16). Optimized for mobile/tall scenes. |
BroadcastOrientationHorizontal | 2 | Landscape layout (e.g., 16:9). Standard for desktop/TV. |
Status
| Name | Value | Description |
|---|---|---|
StatusPending | 1 | Event created but not started. Scheduling/pre-provisioning may be in progress. |
StatusStarted | 2 | Event is live/active. start_time is set (ns) on the first successful start. |
StatusFinished | 3 | Event completed successfully. finish_time is set (ns). Terminal state. |
StatusCanceled | 4 | Event aborted before completion. cancel_time is set (ns). Terminal state. |