Skip to content

Data Models

PushGo’s three data models carry different business semantics. Choosing the right model makes client presentation, history, state merging, and automation easier to reason about.

What you need to expressUseWhy
”Something happened; notify me once”MessageNo persistent state; each message stands alone.
”Something started, changes over time, and eventually ends”EventOne event_id can be updated multiple times and then closed.
”This device, service, room, or task has current state”ThingOne thing_id can be updated over time.
”An alert happened on a specific entity”Thing + MessageThing identifies the entity; Message records the alert.
”A specific entity is going through a process”Thing + EventThing identifies the object; Event records the lifecycle.

Message is the simplest notification model. Use it for content that does not need later merging or closing.

  • Disk usage crossed a threshold.
  • Backup completed.
  • Price dropped.
  • A camera detected motion and includes a snapshot.
  • A deployment’s build, publish, and finish lifecycle.
  • The latest state of a server, sensor, or room.
  • A dashboard value that should be overwritten over time.
GroupFields
Auth and routingchannel_id, password, op_id, thing_id
Displaytitle, body, severity, url, images, tags
Time and securityoccurred_at, ttl, ciphertext
Extensionsmetadata
{
"channel_id": "YOUR_CHANNEL_ID",
"password": "YOUR_CHANNEL_PASSWORD",
"title": "Backup completed",
"body": "The daily NAS backup has finished.",
"severity": "normal"
}

Event represents a process. Creating it returns an event_id; subsequent updates and the final close call use that ID.

  • CI/CD deployment: started, building, published, succeeded or failed.
  • Incident handling: detected, investigating, recovered.
  • Door/window state: opened and then closed.
  • Long-running tasks: transcoding, sync, model training.
/event/create -> event_id
|
+-> /event/update can be called many times
|
+-> /event/close ends the event
GroupFields
Auth and routingchannel_id, password, op_id, thing_id
Lifecycleevent_id, event_time, started_at, ended_at
Displaytitle, description, status, message, severity, tags, images
Extensionsattrs, metadata, ciphertext
  • Use short status values such as running, degraded, success, or failed.
  • Use message for the current update, such as “image pushed”.
  • event_time is when this update happened.
  • started_at is the overall event start time and belongs on create.
  • ended_at is the overall event end time and belongs on close.

Thing represents a long-lived object. Its value comes from updating the same object instead of creating unrelated notifications.

  • Home NAS, server, or network service.
  • Room, sensor, camera, or lock.
  • Long-running asset or task.
  • Anything that should show current state.
/thing/create -> thing_id
|
+-> /thing/update can be called many times
|
+-> /thing/archive inactive but history remains
|
+-> /thing/delete removed or retired
GroupFields
Auth and routingchannel_id, password, op_id
Identity and displaything_id, title, description, tags, primary_image, images
Timecreated_at, observed_at, deleted_at
External systemsexternal_ids, location_type, location_value
Stateattrs, metadata, ciphertext
  • Use title for the human-readable name, such as “Home NAS”.
  • Use attrs for changing values such as CPU, temperature, or online state.
  • Use metadata for auxiliary data that is not usually displayed.
  • Use external_ids to connect to IDs from systems such as Home Assistant.
CombinationPattern
Thing + MessageA “disk almost full” alert occurred on the “Home NAS” entity.
Thing + EventThe “production database” entity is experiencing a replication lag event.
Event + MessageEvent records the lifecycle; Message sends a strong alert at a critical point.

If unsure, start with Message. When a script repeatedly sends “started/updated/finished” or “current value changed”, upgrade to Event or Thing.