Notifications
Email, SMS and push notifications, with preferences per channel and event.
InterfacesAPI SpecSections
API Spec Designed
- GET
/api/delivery/v1/notification-preferencesMy notification settings per channel and event. Signed in
→
200 {channels: {email, sms, push}, events: {…}}. - PUT
/api/delivery/v1/notification-preferencesReplace my notification settings. Signed in
Body as above →
200. Errors:409enabling SMS without a verified phone (read from the access token'sphone_verifiedclaim). - POST
/api/identity/v1/me/phoneAdd a phone number; sends a 6-digit code. Signed in
Body
{phone}(E.164) →202. The code is sent through DeliveryPOST /notifications. Errors:422,429. - POST
/api/identity/v1/me/phone/verifyVerify the phone number. Signed in
Body
{code}→200 {phone, verified_at}. Errors:400,429after 5 tries. - DELETE
/api/identity/v1/me/phoneRemove my phone number. Signed in
→
204. Emitsidentity.user.phone_removed; Delivery turns SMS off. - POST
/api/delivery/v1/webhooks/smsInbound SMS webhook: handles STOP opt-outs. Service
Verifies the provider signature →
200. - GET
/api/delivery/v1/push/public-keyThe VAPID public key for web push. Public
→
200 {public_key}. - POST
/api/delivery/v1/push-subscriptionsRegister this device for push notifications. Signed in
Body
{endpoint, keys: {p256dh, auth}, device_name?}→201 {subscription}. Idempotent onendpoint. - DELETE
/api/delivery/v1/push-subscriptions/{subscriptionId}Remove a device. Signed in
→
204. - POST
/api/delivery/v1/notificationsNotify a user about an event on every channel they have enabled. Service
Called by an app's server. Body
{user_id, event, payload, reference}+Idempotency-Key→202 {notification}. Replaces direct use ofPOST /messagesby apps. - GET
/api/delivery/v1/notificationsMy notification log: each attempt per channel. Signed in
Query
cursor,limit→200 {data: [{event, channel, status: sent|failed|skipped, attempts, created_at}], next_cursor}.
Coming Soon...
Full inputs, constraints, error codes and sample requests and responses for each endpoint will appear here when this module's design is finalized.