import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.webhooks.update(
'430eed87-632a-4ea6-90db-0aace67ec228',
{
endpoint: 'https://new-webhook.example.com/handler',
events: ['email.sent', 'email.delivered'],
status: 'enabled',
},
);
{
"object": "webhook",
"id": "430eed87-632a-4ea6-90db-0aace67ec228"
}
Update an existing webhook configuration.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.webhooks.update(
'430eed87-632a-4ea6-90db-0aace67ec228',
{
endpoint: 'https://new-webhook.example.com/handler',
events: ['email.sent', 'email.delivered'],
status: 'enabled',
},
);
{
"object": "webhook",
"id": "430eed87-632a-4ea6-90db-0aace67ec228"
}
enabled or disabled.import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.webhooks.update(
'430eed87-632a-4ea6-90db-0aace67ec228',
{
endpoint: 'https://new-webhook.example.com/handler',
events: ['email.sent', 'email.delivered'],
status: 'enabled',
},
);
{
"object": "webhook",
"id": "430eed87-632a-4ea6-90db-0aace67ec228"
}
Was this page helpful?