Skip to content

Event API

The Event API represents a process that changes over time and eventually ends. Creating an event returns an event_id; updates and close calls use that ID to stay attached to the same lifecycle.

POST /event/create
POST /event/update
POST /event/close

The request body must be JSON, and unknown fields are rejected. If a private Gateway enables PUSHGO_TOKEN, include Authorization: Bearer <token>.

HeaderRequiredDescription
Content-Type: application/jsonYesRequest body format.
Authorization: Bearer <token>Gateway-dependentRequired only when a private Gateway enables PUSHGO_TOKEN.
/event/create -> event_id
|
+-> /event/update can be called many times
|
+-> /event/close marks the event as ended
FieldTypeRequiredDescription
channel_idstringYesTarget channel ID.
passwordstringYesChannel password, usually 8-128 characters.
op_idstringNoIdempotency key; generated and returned if omitted.
thing_idstringNoAssociate this event dispatch with an existing Thing.
ciphertextstringNoOptional E2EE ciphertext payload.
RouteRequired business fields
/event/createtitle, status, message, severity, event_time
/event/updateevent_id, status, message, severity, event_time
/event/closeevent_id, status, message, severity, event_time
FieldTypeRules
event_idstringRequired for update and close; must not be sent on create; 1-64 chars, letters/digits/_/:/-.
titlestringRequired on create; optional on update and close.
descriptionstringOptional; empty strings are treated as missing.
statusstringRequired; non-empty, max 24 chars.
messagestringRequired; non-empty, max 512 chars.
severitystringRequired; only critical, high, normal, low.
event_timenumberRequired; when this update happened; Unix seconds or milliseconds accepted and normalized to milliseconds.
started_atnumberCreate only; defaults to event_time when omitted and is rejected on update/close.
ended_atnumberClose only; defaults to event_time when omitted and is rejected on create/update.
tagsstring[]Up to 32 items, max 64 chars each, trimmed and deduplicated.
imagesstring[]Up to 32 image URLs, max 2048 chars each.
attrsobjectObject patch; null removes a key; arrays are not allowed.
metadataobjectNo
Terminal window
curl -X POST https://gateway.pushgo.dev/event/create \
-H "Content-Type: application/json" \
-d '{
"channel_id": "YOUR_CHANNEL_ID",
"password": "YOUR_CHANNEL_PASSWORD",
"title": "Production deployment",
"status": "running",
"message": "Deployment started",
"severity": "normal",
"event_time": 1713750000000,
"started_at": 1713750000000,
"attrs": {
"service": "api",
"revision": "8f3c2a1"
}
}'

Response:

{
"success": true,
"data": {
"channel_id": "YOUR_CHANNEL_ID",
"op_id": "op-20260422-001",
"event_id": "8a1fc4b3d9f04fd2857f92f66f7cc5d1",
"accepted": true
},
"error": null,
"error_code": null
}

Save the returned event_id; update and close calls need it.

Terminal window
curl -X POST https://gateway.pushgo.dev/event/update \
-H "Content-Type: application/json" \
-d '{
"channel_id": "YOUR_CHANNEL_ID",
"password": "YOUR_CHANNEL_PASSWORD",
"event_id": "8a1fc4b3d9f04fd2857f92f66f7cc5d1",
"status": "publishing",
"message": "Image pushed, publishing release",
"severity": "normal",
"event_time": 1713750300000,
"attrs": {
"progress": 0.75
}
}'

/event/update can be called many times. Each update should describe the current change, not repeat the whole history.

Terminal window
curl -X POST https://gateway.pushgo.dev/event/close \
-H "Content-Type: application/json" \
-d '{
"channel_id": "YOUR_CHANNEL_ID",
"password": "YOUR_CHANNEL_PASSWORD",
"event_id": "8a1fc4b3d9f04fd2857f92f66f7cc5d1",
"status": "success",
"message": "Production deployment completed",
"severity": "normal",
"event_time": 1713750600000,
"ended_at": 1713750600000,
"attrs": {
"progress": 1
}
}'

For failures, use status=failed and raise severity when appropriate.

If the event happens on a persistent entity, include thing_id.

{
"channel_id": "YOUR_CHANNEL_ID",
"password": "YOUR_CHANNEL_PASSWORD",
"thing_id": "3b7fd2e87d7d4d6d9c7f3a318ac21f02",
"title": "Database lag",
"status": "open",
"message": "Replica lag exceeded 30 seconds",
"severity": "high",
"event_time": 1713750000000,
"started_at": 1713750000000
}

Thing identifies the object; Event describes the process happening to it.

Event APIs use the shared response envelope. accepted=true means the Gateway entered dispatch, not that every device has displayed a system notification.

StatusTypical reason
400Missing route-required field, unknown field, invalid severity, invalid attrs.
401Private Gateway Bearer token missing or wrong.
404Channel or event_id does not exist.
413Request body exceeds 32KB.
503Dispatch did not fully succeed.