Skip to main content
PATCH
/
api
/
v1
/
notifications
/
preferences
Update Preferences
curl --request PATCH \
  --url https://roughy-api-staging.fly.dev/api/v1/notifications/preferences \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "updates": [
    {
      "channel": "email",
      "enabled": true,
      "type": "pipeline_completed"
    },
    {
      "channel": "email",
      "enabled": true,
      "type": "credits_low"
    }
  ]
}
'
{
  "items": [
    {
      "category": "job",
      "channel": "in_app",
      "enabled": true,
      "is_default": true,
      "is_mandatory": false,
      "type": "pipeline_completed"
    },
    {
      "category": "job",
      "channel": "email",
      "enabled": false,
      "is_default": true,
      "is_mandatory": false,
      "type": "pipeline_completed"
    },
    {
      "category": "billing",
      "channel": "email",
      "enabled": true,
      "is_default": true,
      "is_mandatory": true,
      "type": "subscription_payment_failed"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.roughy.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Either your Supabase session JWT (UI flows) or an API key minted via POST /api-keys (programmatic flows). Pass it as Authorization: Bearer <token>. The server inspects the token format and routes to JWT or API-key verification automatically.

Body

application/json

Bulk PATCH body. The whole batch is applied atomically -- if any update would disable a mandatory (type, channel), the entire request is rejected with 409. Partial application would surprise the user.

updates
PreferenceUpdate · object[]
required

Bulk updates; max 100 per request.

Required array length: 1 - 100 elements

Response

Successful Response

Full grid of every (type, channel) prefs for the caller, with defaults merged in. Stable order so the UI can render predictably.

items
NotificationPreferenceItem · object[]
required