@mbanq/core-sdk-js / commands / UpdateSubscriber
Function: UpdateSubscriber()
UpdateSubscriber(
subscriberId,data):Command<{data:SubscriberRequest;subscriberId:string; }, {changes: {active?:boolean;deliveryRetryLimit?:number;headers?:object[];name:string;secretKey?:string;target?:string;type:"WEBHOOK"|"EMAIL"|"CLIENT_EMAIL"|"PUSH_NOTIFICATION"|"CORE_EVENT_PROCESSOR"; };id:string;resourceId:number; }>
Defined in: src/commands/rest/notification.ts:304
Updates a subscriber.
Parameters
subscriberId
string
The ID of the subscriber to update
data
SubscriberRequest
The subscriber data to update
Returns
Command<{ data: SubscriberRequest; subscriberId: string; }, { changes: { active?: boolean; deliveryRetryLimit?: number; headers?: object[]; name: string; secretKey?: string; target?: string; type: "WEBHOOK" | "EMAIL" | "CLIENT_EMAIL" | "PUSH_NOTIFICATION" | "CORE_EVENT_PROCESSOR"; }; id: string; resourceId: number; }>
A Command that when executed returns the updated subscriber's id, resourceId, and changes
Example
const updateCmd = UpdateSubscriber('subscriber-123', {
name: 'Updated Webhook',
type: 'WEBHOOK',
target: 'https://example.com/webhook',
active: true
});
const result = await updateCmd.execute(config);
console.log(result.id, result.resourceId, result.changes);