Skip to content
SarvexDocs
Esc
↑↓navigate↵open⌘Jpreview

Replace notification channel preferences

PUT/notifications/preferences
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT issued by the external IdP via the OAuth 2.0 authorization-code flow (Kinde in production; a simulator in test). The client obtains it and sends it as a Bearer token on every authenticated call. Sarvex's services verify it — issuer, audience, signature (IdP JWKS), expiry — and read identity and tenant from its claims. Sarvex does not issue or revoke these tokens. merchant_id/store_id are read from the verified claims (and the merchant→store mapping), never from the URL. The operator scope is required for /operator/*. Operators acting on a specific merchant pass the X-Operate-As header, which is recorded in the audit log.

Request body
requiredapplication/json
email_enabledboolean
weekly_digestboolean
alert_emailstring<email> | null
alert_recipientsstring<email>[]

Recipients for endpoint-health alert delivery. Additive to alert_email, which nothing else in the codebase reads yet.

alert_severity_floorstring

Alerts below this severity are not delivered. Defaults to critical (opt in to degraded).

Allowed:degradedcritical
quiet_hours_start_hourinteger | null
min 0 · max 23
quiet_hours_end_hourinteger | null
min 0 · max 23
quiet_hours_timezonestring

IANA timezone name.

Responses
200

Updated preferences.

email_enabledboolean
weekly_digestboolean
alert_emailstring<email> | null
alert_recipientsstring<email>[]

Recipients for endpoint-health alert delivery. Additive to alert_email, which nothing else in the codebase reads yet.

alert_severity_floorstring

Alerts below this severity are not delivered. Defaults to critical (opt in to degraded).

Allowed:degradedcritical
quiet_hours_start_hourinteger | null
min 0 · max 23
quiet_hours_end_hourinteger | null
min 0 · max 23
quiet_hours_timezonestring

IANA timezone name.

Try it
Server
Authorization
Bodyapplication/json
Request
curl -X PUT "https://api.sarvex.example.com/v1/notifications/preferences" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "email_enabled": true,
  "weekly_digest": true,
  "alert_email": "user@example.com",
  "alert_recipients": [
    "user@example.com"
  ],
  "alert_severity_floor": "degraded",
  "quiet_hours_start_hour": 0,
  "quiet_hours_end_hour": 0,
  "quiet_hours_timezone": "America/New_York"
}'
Response
{
  "email_enabled": true,
  "weekly_digest": true,
  "alert_email": "user@example.com",
  "alert_recipients": [
    "user@example.com"
  ],
  "alert_severity_floor": "degraded",
  "quiet_hours_start_hour": 0,
  "quiet_hours_end_hour": 0,
  "quiet_hours_timezone": "America/New_York"
}