Bulk update subscriber preferences

Bulk update subscriber preferences by its unique key identifier subscriberId. This API allows updating multiple workflow preferences in a single request.

PATCH
/v2/subscribers/{subscriberId}/preferences/bulk

Authorization

Authorization<token>

API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".

In: header

Request Body

application/jsonRequired
preferencesRequiredarray<object>

Array of workflow preferences to update (maximum 100 items)

Path Parameters

subscriberIdRequiredstring

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

responseRequiredarray<object>
export type Response = GetPreferencesResponseDto[];
 
export interface GetPreferencesResponseDto {
  /**
   * The level of the preference (global or template)
   */
  level: "global" | "template";
  /**
   * Workflow information if this is a template-level preference
   */
  workflow?: WorkflowDto;
  /**
   * Whether the preference is enabled
   */
  enabled: boolean;
  /**
   * Channel-specific preference settings
   */
  channels: SubscriberPreferenceChannels;
}
export interface WorkflowDto {
  /**
   * Unique identifier of the workflow
   */
  id: string;
  /**
   * Workflow identifier used for triggering
   */
  identifier: string;
  /**
   * Human-readable name of the workflow
   */
  name: string;
  /**
   * Whether this workflow is marked as critical
   */
  critical: boolean;
  /**
   * Tags associated with the workflow
   */
  tags?: string[];
  /**
   * Custom data associated with the workflow
   */
  data?: {};
  /**
   * Severity level of the workflow
   */
  severity: "high" | "medium" | "low" | "none";
}
export interface SubscriberPreferenceChannels {
  /**
   * Email channel preference
   */
  email?: boolean;
  /**
   * SMS channel preference
   */
  sms?: boolean;
  /**
   * In-app channel preference
   */
  in_app?: boolean;
  /**
   * Chat channel preference
   */
  chat?: boolean;
  /**
   * Push notification channel preference
   */
  push?: boolean;
}
 
curl -X PATCH "https://api.novu.co/v2/subscribers/string/preferences/bulk" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "preferences": [
      {
        "channels": {
          "email": true,
          "sms": true,
          "in_app": true,
          "push": true,
          "chat": true
        },
        "workflowId": "string"
      }
    ]
  }'
[
  {
    "level": "global",
    "workflow": {
      "id": "64a1b2c3d4e5f6g7h8i9j0k1",
      "identifier": "welcome-email",
      "name": "Welcome Email Workflow",
      "critical": false,
      "tags": [
        "user-onboarding",
        "email"
      ],
      "data": {
        "category": "onboarding",
        "priority": "high"
      },
      "severity": "high"
    },
    "enabled": true,
    "channels": {
      "email": true,
      "sms": false,
      "in_app": true,
      "chat": false,
      "push": true
    }
  }
]

On this page

No Headings
Edit this page on GitHub