Docs
← chronapilot.com v 2026-05-12
API reference · Push Notifications
dev_

Push Notifications

Device registration, immediate sends, and travel-time-adjusted scheduled pushes.

Endpoints

POST /v1/notifications/devices Register a device
POST /v1/notifications/send Send an immediate push
POST /v1/notifications/schedule Schedule a future push
DELETE /v1/notifications/scheduled/{id} Cancel a scheduled push

Register a device

HTTP
POST /v1/notifications/devices
FieldTypeDescription
user_idstringrequired
platformstringios or android.
tokenstringFCM token (Android) or APNS device token (iOS).
app_versionstring?Your app's version, for cohort analytics.
tagsarray?Additional ANH tags for routing.

Behind the scenes, ChronaPilot registers the device with Azure Notification Hubs and tracks the resulting anh_registration_id against the user.

Send an immediate push

HTTP
POST /v1/notifications/send
JSON
{
  "user_id": "usr_1abc2def3ghi",
  "title": "Time to leave",
  "body": "Heavy traffic — leave now to arrive on time.",
  "data": { "event_id": "evt_1abc2def3ghi", "deep_link": "chronapilot://event/evt_1abc2def3ghi" },
  "category": "departure",
  "sound": "departure-default"
}

Schedule a future push

HTTP
POST /v1/notifications/schedule

Two scheduling modes:

  • Absolutesend_at: "2026-05-22T14:00:00-07:00"
  • Travel-adjustedrelative_to_event: { event_id, offset_minutes_before_departure }. The fire time updates automatically as the departure window shifts.
JSON
{
  "user_id": "usr_1abc2def3ghi",
  "title": "Leaving in 10 minutes",
  "body": "Smile Dental — 28 min drive, moderate traffic.",
  "relative_to_event": {
    "event_id": "evt_1abc2def3ghi",
    "offset_minutes_before_departure": 10
  }
}

Cancel a scheduled push

HTTP
DELETE /v1/notifications/scheduled/{id}

Reference implementation