Appearance
Callbacks service
/callbacks receives change notifications for database entities, so derived state (public visibility of steps, summary bookkeeping) is updated promptly when a device or step changes — the event-driven complement to the periodic sweeps of the cron service. In a full deployment these are invoked by the change-data pipeline; operators can also call them by hand.
Auth is HTTP Basic as saadmin with PANTAHUB_SA_ADMIN_SECRET, like the other operator endpoints.
Both endpoints take an optional timemodified parameter (RFC3339Nano) used to discard stale callbacks: if the entity has been modified after the given time, the outdated notification is ignored. Mind the URL encoding of timestamps — append Z for UTC, or use %2B in place of + for a timezone offset (timemodified=2006-01-02T15:04:05.999%2B05:30).
Device changed
sh
curl -s -X PUT -u "saadmin:$PANTAHUB_SA_ADMIN_SECRET" \
"https://api.pantahub.com/callbacks/devices/<id-or-nick>?timemodified=2006-01-02T15:04:05.999Z"json
{
"device_id": "5e9ef0ce…",
"steps_marked_as_public": 0,
"steps_marked_as_non_public": 1
}Step changed
sh
curl -s -X PUT -u "saadmin:$PANTAHUB_SA_ADMIN_SECRET" \
"https://api.pantahub.com/callbacks/steps/<step-id>?timemodified=2006-01-02T15:04:05.999Z"The response echoes the step's bookkeeping record — owner, device, the sha256 of every object the step references, and its public/garbage flags.
Endpoint reference
| Endpoint | Reference |
|---|---|
PUT /callbacks/devices/{id} | Device changed |
PUT /callbacks/steps/{id} | Step changed |