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',
},
);
$resend = Resend::client('re_xxxxxxxxx');
$resend->webhooks->update('430eed87-632a-4ea6-90db-0aace67ec228', [
'endpoint' => 'https://new-webhook.example.com/handler',
'events' => ['email.sent', 'email.delivered'],
'status' => 'enabled',
]);
import resend
resend.api_key = 're_xxxxxxxxx'
params: resend.Webhooks.UpdateParams = {
"webhook_id": "430eed87-632a-4ea6-90db-0aace67ec228",
"endpoint": "https://new-webhook.example.com/handler",
"events": ["email.sent", "email.delivered"],
"status": "enabled",
}
webhook = resend.Webhooks.update(params)
require 'resend'
Resend.api_key = 're_xxxxxxxxx'
params = {
webhook_id: '430eed87-632a-4ea6-90db-0aace67ec228',
endpoint: 'https://new-webhook.example.com/handler',
events: ['email.sent', 'email.delivered'],
status: 'enabled'
}
webhook = Resend::Webhooks.update(params)
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
endpoint := "https://new-webhook.example.com/handler"
status := "enabled"
params := &resend.UpdateWebhookRequest{
Endpoint: &endpoint,
Events: []string{"email.sent", "email.delivered"},
Status: &status,
}
client.Webhooks.Update("430eed87-632a-4ea6-90db-0aace67ec228", params)
}
use resend_rs::{
events::EmailEventType::{EmailDelivered, EmailSent},
types::{UpdateWebhookOptions, WebhookStatus},
Resend, Result,
};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let events = [EmailSent, EmailDelivered];
let opts = UpdateWebhookOptions::default()
.with_endpoint("https://new-webhook.example.com/handler")
.with_events(events)
.with_status(WebhookStatus::Enabled);
let _webhook = resend
.webhooks
.update("430eed87-632a-4ea6-90db-0aace67ec228", opts)
.await?;
Ok(())
}
import com.resend.*;
import static com.resend.services.webhooks.model.WebhookEvent.*;
public class Main {
public static void main(String[] args) {
Resend resend = new Resend("re_xxxxxxxxx");
UpdateWebhookOptions options = UpdateWebhookOptions.builder()
.endpoint("https://new-webhook.example.com/handler")
.events(EMAIL_SENT, EMAIL_DELIVERED)
.status(WebhookStatus.ENABLED)
.build();
UpdateWebhookResponseSuccess response = resend.webhooks()
.update("430eed87-632a-4ea6-90db-0aace67ec228", options);
}
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
await resend.WebhookUpdateAsync(
new Guid( "430eed87-632a-4ea6-90db-0aace67ec228" ),
new WebhookData()
{
EndpointUrl = "https://new-webhook.example.com/handler",
Events = [ WebhookEventType.EmailSent ],
Status = WebhookStatus.Disabled,
}
);
curl -X PATCH 'https://api.resend.com/webhooks/430eed87-632a-4ea6-90db-0aace67ec228' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"endpoint": "https://new-webhook.example.com/handler",
"events": ["email.sent", "email.delivered"],
"status": "enabled"
}'
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 Webhook
Update an existing webhook configuration.
PATCH
/
webhooks
/
:webhook_id
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',
},
);
$resend = Resend::client('re_xxxxxxxxx');
$resend->webhooks->update('430eed87-632a-4ea6-90db-0aace67ec228', [
'endpoint' => 'https://new-webhook.example.com/handler',
'events' => ['email.sent', 'email.delivered'],
'status' => 'enabled',
]);
import resend
resend.api_key = 're_xxxxxxxxx'
params: resend.Webhooks.UpdateParams = {
"webhook_id": "430eed87-632a-4ea6-90db-0aace67ec228",
"endpoint": "https://new-webhook.example.com/handler",
"events": ["email.sent", "email.delivered"],
"status": "enabled",
}
webhook = resend.Webhooks.update(params)
require 'resend'
Resend.api_key = 're_xxxxxxxxx'
params = {
webhook_id: '430eed87-632a-4ea6-90db-0aace67ec228',
endpoint: 'https://new-webhook.example.com/handler',
events: ['email.sent', 'email.delivered'],
status: 'enabled'
}
webhook = Resend::Webhooks.update(params)
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
endpoint := "https://new-webhook.example.com/handler"
status := "enabled"
params := &resend.UpdateWebhookRequest{
Endpoint: &endpoint,
Events: []string{"email.sent", "email.delivered"},
Status: &status,
}
client.Webhooks.Update("430eed87-632a-4ea6-90db-0aace67ec228", params)
}
use resend_rs::{
events::EmailEventType::{EmailDelivered, EmailSent},
types::{UpdateWebhookOptions, WebhookStatus},
Resend, Result,
};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let events = [EmailSent, EmailDelivered];
let opts = UpdateWebhookOptions::default()
.with_endpoint("https://new-webhook.example.com/handler")
.with_events(events)
.with_status(WebhookStatus::Enabled);
let _webhook = resend
.webhooks
.update("430eed87-632a-4ea6-90db-0aace67ec228", opts)
.await?;
Ok(())
}
import com.resend.*;
import static com.resend.services.webhooks.model.WebhookEvent.*;
public class Main {
public static void main(String[] args) {
Resend resend = new Resend("re_xxxxxxxxx");
UpdateWebhookOptions options = UpdateWebhookOptions.builder()
.endpoint("https://new-webhook.example.com/handler")
.events(EMAIL_SENT, EMAIL_DELIVERED)
.status(WebhookStatus.ENABLED)
.build();
UpdateWebhookResponseSuccess response = resend.webhooks()
.update("430eed87-632a-4ea6-90db-0aace67ec228", options);
}
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
await resend.WebhookUpdateAsync(
new Guid( "430eed87-632a-4ea6-90db-0aace67ec228" ),
new WebhookData()
{
EndpointUrl = "https://new-webhook.example.com/handler",
Events = [ WebhookEventType.EmailSent ],
Status = WebhookStatus.Disabled,
}
);
curl -X PATCH 'https://api.resend.com/webhooks/430eed87-632a-4ea6-90db-0aace67ec228' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"endpoint": "https://new-webhook.example.com/handler",
"events": ["email.sent", "email.delivered"],
"status": "enabled"
}'
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"
}
Path Parameters
Body Parameters
string
The URL where webhook events will be sent.
string[]
Array of event types to subscribe to.See event types for available options.
string
The webhook status. Can be either
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',
},
);
$resend = Resend::client('re_xxxxxxxxx');
$resend->webhooks->update('430eed87-632a-4ea6-90db-0aace67ec228', [
'endpoint' => 'https://new-webhook.example.com/handler',
'events' => ['email.sent', 'email.delivered'],
'status' => 'enabled',
]);
import resend
resend.api_key = 're_xxxxxxxxx'
params: resend.Webhooks.UpdateParams = {
"webhook_id": "430eed87-632a-4ea6-90db-0aace67ec228",
"endpoint": "https://new-webhook.example.com/handler",
"events": ["email.sent", "email.delivered"],
"status": "enabled",
}
webhook = resend.Webhooks.update(params)
require 'resend'
Resend.api_key = 're_xxxxxxxxx'
params = {
webhook_id: '430eed87-632a-4ea6-90db-0aace67ec228',
endpoint: 'https://new-webhook.example.com/handler',
events: ['email.sent', 'email.delivered'],
status: 'enabled'
}
webhook = Resend::Webhooks.update(params)
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
endpoint := "https://new-webhook.example.com/handler"
status := "enabled"
params := &resend.UpdateWebhookRequest{
Endpoint: &endpoint,
Events: []string{"email.sent", "email.delivered"},
Status: &status,
}
client.Webhooks.Update("430eed87-632a-4ea6-90db-0aace67ec228", params)
}
use resend_rs::{
events::EmailEventType::{EmailDelivered, EmailSent},
types::{UpdateWebhookOptions, WebhookStatus},
Resend, Result,
};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let events = [EmailSent, EmailDelivered];
let opts = UpdateWebhookOptions::default()
.with_endpoint("https://new-webhook.example.com/handler")
.with_events(events)
.with_status(WebhookStatus::Enabled);
let _webhook = resend
.webhooks
.update("430eed87-632a-4ea6-90db-0aace67ec228", opts)
.await?;
Ok(())
}
import com.resend.*;
import static com.resend.services.webhooks.model.WebhookEvent.*;
public class Main {
public static void main(String[] args) {
Resend resend = new Resend("re_xxxxxxxxx");
UpdateWebhookOptions options = UpdateWebhookOptions.builder()
.endpoint("https://new-webhook.example.com/handler")
.events(EMAIL_SENT, EMAIL_DELIVERED)
.status(WebhookStatus.ENABLED)
.build();
UpdateWebhookResponseSuccess response = resend.webhooks()
.update("430eed87-632a-4ea6-90db-0aace67ec228", options);
}
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
await resend.WebhookUpdateAsync(
new Guid( "430eed87-632a-4ea6-90db-0aace67ec228" ),
new WebhookData()
{
EndpointUrl = "https://new-webhook.example.com/handler",
Events = [ WebhookEventType.EmailSent ],
Status = WebhookStatus.Disabled,
}
);
curl -X PATCH 'https://api.resend.com/webhooks/430eed87-632a-4ea6-90db-0aace67ec228' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"endpoint": "https://new-webhook.example.com/handler",
"events": ["email.sent", "email.delivered"],
"status": "enabled"
}'
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?
⌘I