Skip to content

Event API

The Event API allows you to track stateful occurrences over time. Unlike a simple Message, an Event has a lifecycle (Start -> Updates -> Close).

ActionMethodPath
CreatePOST/v1/channel/{channel_id}/event/create
UpdatePOST/v1/channel/{channel_id}/event/update
ClosePOST/v1/channel/{channel_id}/event/close

HeaderValueDescription
Content-Typeapplication/jsonAlways required.
AuthorizationBearer <token>Your secret gateway token.

FieldTypeRequiredDescription
passwordstringYesChannel password (8-128 chars).
event_idstringNo*Unique ID for the event. Required for Update and Close. If omitted in Create, a random ID is returned.
event_typestringYesA category for the event (e.g., motion_detected, system_backup).
severityenumNocritical, high, normal, low.
attrsobjectNoA JSON object containing event-specific data (e.g., { "battery": 80 }).

Initialize a new event.

Terminal window
curl -X POST https://api.pushgo.io/v1/channel/ABC123XYZ/event/create \
-H "Content-Type: application/json" \
-d '{
"password": "your_password",
"event_type": "door_open",
"severity": "high",
"started_at": 1672531200
}'

Add new information to an ongoing event. The new attrs will be merged with the existing ones.

Terminal window
curl -X POST https://api.pushgo.io/v1/channel/ABC123XYZ/event/update \
-H "Content-Type: application/json" \
-d '{
"password": "your_password",
"event_id": "PREVIOUSLY_CREATED_ID",
"attrs": { "still_open": true }
}'

Mark the event as finished.

Terminal window
curl -X POST https://api.pushgo.io/v1/channel/ABC123XYZ/event/close \
-H "Content-Type: application/json" \
-d '{
"password": "your_password",
"event_id": "PREVIOUSLY_CREATED_ID",
"ended_at": 1672534800
}'

Successful requests return the event_id:

{
"event_id": "550e8400-e29b-41d4-a716-446655440000"
}