Skip to main content

Notifications

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

Multi-channel notification capability — operational alerting (Slack/email/webhook fan-out) + end-user in-app notifications + web-push (VAPID). One send-API + one in-app store + a push-subscription registry so products don't each re-roll notification plumbing. Provider/channel secrets resolved server-side (Infisical), never in body/DB/logs. Status: LIVE. v1.1/v1.2 expand-contract (backward-compatible): the web_push channel + the /v1/push/* subscription surface (v1.1) + per-user push history (v1.2, GET /v1/push/history) are ADDITIVE over v1 and DEFAULT-OFF (gated by NOTIFICATIONS_WEB_PUSH_ENABLED) so the v1 surface is unchanged until an operator enables it. Absorbs vagary-platform's local VAPID path (backend/services/push_notification_service.py) — delivery + subscriptions + the history read — so it can be deleted once delivery + subscriptions migrate.

  • Group: Comms & workflow
  • Contract: contracts/notifications/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/notifications/send

Endpoints

MethodPathSummary
POST/v1/notifySend a notification across one or more channels (Slack/email/webhook)
GET/v1/notificationsList in-app notifications for the caller's org/user
PUT/v1/notifications/&#123;id&#125;/readmark read
DELETE/v1/notifications/&#123;id&#125;delete
GET/v1/push/vapid-public-keyThe service VAPID application-server public key (a client needs it to subscribe)
POST/v1/push/registrationsRegister (upsert) a browser web-push subscription for the caller's org
GET/v1/push/registrationsList the org's push subscriptions (never returns key material)
DELETE/v1/push/registrations/&#123;sub_id&#125;Unsubscribe (delete) one push subscription
GET/v1/push/historyPer-user web_push notification history (the platform get_notification_history read)
GET/healthliveness
GET/metricsPrometheus

Schemas

NotifyRequest

FieldTypeDescription
organization_idstringproduct-tier tenant (I6)
channelsarray
messagestring
subjectstring
targetobjectchannel-specific target. slack: {webhook_url?}; webhook: {url, payload?}; email: {email}; in_app: {user_id?}. web_push (v1.1): a routing selector — {user_id} (that user's stored devices), {broadcast:true} (the whole org's devices), or {subscription:{endpoint,keys}} (a direct one-off, no store) — plus optional {site_id, url, data} threaded into the push payload.

NotifyAccepted

FieldTypeDescription
notification_idstring
accepted_channelsarray

PushSubscription

a W3C Push API PushSubscription (as JSON.stringify(subscription.toJSON()) yields)

FieldTypeDescription
endpointstring
keysobject

PushSubscriptionRegister

FieldTypeDescription
subscriptionobject
user_idstringoptional end-user the subscription belongs to
site_idstringoptional sub-org / brand scope (platform site parity)
platformstring'web' (VAPID); 'fcm'/'apns' reserved

PushHistoryItem

one per-user web_push history record (display metadata only — no key material). Recorded once per targeted user per web_push send. delivered_count is the real device count for a per-user send and 0 for a broadcast row (a broadcast's aggregate is not attributable per user — it lives in the delivery log).

FieldTypeDescription
notification_idstringthe /v1/notify id this history row belongs to
user_idstring
titlestringpush title (= notify subject)
bodystringpush body (= notify message)
urlstring
dataobjectopaque payload data (from target.data)
site_idstring
statusstringterminal send outcome
delivered_countinteger
created_atnumberepoch seconds

Error

FieldTypeDescription
errorstring

Generated by scripts/gen-capability-docs.py from contracts/notifications/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.