Notifications

View as Markdown

Send Email Notification

POST/api/v1/notifications/email

Send an email notification to all admins of a brand.

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl -X POST "https://app.opvs.ai/api/v1/notifications/email" \
  -H "Authorization: Bearer $OPVS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Send In App Notification

POST/api/v1/notifications/in-app

Create an in-app notification for the deliverable members of a brand.

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl -X POST "https://app.opvs.ai/api/v1/notifications/in-app" \
  -H "Authorization: Bearer $OPVS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Preferences

GET/api/v1/notifications/preferences

Every catalog event with this user's effective (email, in_app, delivery) for the active brand. ?format=yaml|md for agents.

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl "https://app.opvs.ai/api/v1/notifications/preferences" \
  -H "Authorization: Bearer $OPVS_TOKEN"

Get Dnd

GET/api/v1/notifications/preferences/dnd
Request
curl "https://app.opvs.ai/api/v1/notifications/preferences/dnd" \
  -H "Authorization: Bearer $OPVS_TOKEN"

Update Dnd

PATCH/api/v1/notifications/preferences/dnd

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl -X PATCH "https://app.opvs.ai/api/v1/notifications/preferences/dnd" \
  -H "Authorization: Bearer $OPVS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update Preference

PATCH/api/v1/notifications/preferences/{event_key}

Toggle one event's channels/delivery for the active brand.

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl -X PATCH "https://app.opvs.ai/api/v1/notifications/preferences/{event_key}" \
  -H "Authorization: Bearer $OPVS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Unsubscribe Landing

GET/api/v1/notifications/unsubscribe

Body-link landing — applies the unsubscribe and shows a confirmation.

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl "https://app.opvs.ai/api/v1/notifications/unsubscribe" \
  -H "Authorization: Bearer $OPVS_TOKEN"

Unsubscribe One Click

POST/api/v1/notifications/unsubscribe

RFC 8058 one-click target (the MUA POSTs here). No body required.

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl -X POST "https://app.opvs.ai/api/v1/notifications/unsubscribe" \
  -H "Authorization: Bearer $OPVS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Get Notification Feed

GET/api/v1/notifications/feed

Keyset-paginated in-app bell feed, newest first. Pass the previous page's ``next_cursor`` back as ``cursor_created_at`` + ``cursor_id``.

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl "https://app.opvs.ai/api/v1/notifications/feed" \
  -H "Authorization: Bearer $OPVS_TOKEN"

List Notifications

GET/api/v1/notifications

Alias of ``GET /notifications/feed`` at the router root — a parity convenience (no existing consumer requires it; see DISCOVERY §2 E1). Returns the same keyset-paginated in-app bell feed for the (user, active brand).

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl "https://app.opvs.ai/api/v1/notifications" \
  -H "Authorization: Bearer $OPVS_TOKEN"

Get Unread Count

GET/api/v1/notifications/unread-count

Count of the user's unread in-app notifications for the active brand.

Request
curl "https://app.opvs.ai/api/v1/notifications/unread-count" \
  -H "Authorization: Bearer $OPVS_TOKEN"

Mark All Notifications Read

POST/api/v1/notifications/read-all

Mark every unread in-app notification for (user, brand) read.

Request
curl -X POST "https://app.opvs.ai/api/v1/notifications/read-all" \
  -H "Authorization: Bearer $OPVS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Mark Notification Read

POST/api/v1/notifications/{notification_id}/read

Mark one notification read. The body carries ``created_at`` (the row's partition key) so the UPDATE prunes to a single partition (LANDMINE 5). Returns ``updated=false`` if the row isn't the caller's or was already read.

Errors

CodeWhenWhat to do
422Validation Error—
Request
curl -X POST "https://app.opvs.ai/api/v1/notifications/{notification_id}/read" \
  -H "Authorization: Bearer $OPVS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Notification Stream

GET/api/v1/notifications/stream

Server-Sent Events stream of ``notification.created`` frames for the authenticated user. The browser's EventSource sends the session cookie, so auth resolves via ``get_current_brand``. Frames are keyed PER USER and carry ``brand_id`` — the client filters to the active brand (LANDMINE 4).

Request
curl "https://app.opvs.ai/api/v1/notifications/stream" \
  -H "Authorization: Bearer $OPVS_TOKEN"
Did this answer your question?