Event API
The Event API sends lifecycle notifications through three routes:
POST /event/createPOST /event/updatePOST /event/close
Contract Notes
Section titled “Contract Notes”- Request body must be JSON.
- Unknown fields are rejected (strict parsing).
Authorization: Bearer <token>is required only when gateway auth is enabled.
Common Fields
Section titled “Common Fields”| Field | Type | Required | Notes |
|---|---|---|---|
channel_id | string | Yes | Target channel ID. |
password | string | Yes | Channel password, 8-128 chars. |
op_id | string | No | Idempotency key. If missing, gateway generates one and echoes it in response. |
thing_id | string | No | Optional thing-scoped context for this dispatch. |
Route-Level Required Fields
Section titled “Route-Level Required Fields”| Route | Hard required business fields |
|---|---|
/event/create | title, status, message, severity, event_time |
/event/update | event_id, status, message, severity, event_time |
/event/close | event_id, status, message, severity, event_time |
Payload Fields and Rules
Section titled “Payload Fields and Rules”| Field | Type | Required | Rules |
|---|---|---|---|
event_id | string | Update/Close only | Must be omitted on create; generated by gateway on create. |
title | string | Create only | Optional on update/close. |
description | string | No | Empty string is treated as absent. |
status | string | Create/Update/Close | Non-empty, max 24 chars. |
message | string | Create/Update/Close | Non-empty, max 512 chars. |
severity | string | Create/Update/Close | `critical |
event_time | number | Yes | Unix seconds; used as occurred-at for this event dispatch. |
started_at | number | No | Allowed only on create. |
ended_at | number | No | Allowed only on close. |
tags | string[] | No | Max 32 items, each max 64 chars, deduplicated after trim. |
images | string[] | No | Max 32 items, each max 2048 chars, deduplicated after trim. |
attrs | object | No | Object patch; null value means delete key. Arrays are rejected. |
metadata | object | No | Scalar values only (string/number/bool), key <= 64, value <= 512. |
Example: Create
Section titled “Example: Create”curl -X POST https://gateway.pushgo.dev/event/create \ -H "Content-Type: application/json" \ -d '{ "channel_id": "06J0FZG1Y8XGG14VTQ4Y3G10MR", "password": "pass-1234", "title": "Database lag", "status": "ongoing", "message": "Replica delay > 30s", "severity": "high", "event_time": 1713750000, "started_at": 1713750000, "tags": ["db", "replica"] }'Example Response
Section titled “Example Response”{ "success": true, "data": { "channel_id": "06J0FZG1Y8XGG14VTQ4Y3G10MR", "op_id": "op-20260422-001", "event_id": "8a1fc4b3d9f04fd2857f92f66f7cc5d1", "thing_id": null, "accepted": true }, "error": null, "error_code": null}