import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.broadcasts.update(
'49a3999c-0ce1-4ea6-ab68-afcd6dc2e794',
{
html: 'Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
},
);
$resend = Resend::client('re_xxxxxxxxx');
$resend->broadcasts->update('49a3999c-0ce1-4ea6-ab68-afcd6dc2e794', [
'html' => 'Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
]);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Broadcasts.UpdateParams = {
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
}
resend.Broadcasts.update(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
Resend::Broadcasts.update(params)
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
params := &resend.UpdateBroadcastRequest{
Id: "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
Html: "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
client.Broadcasts.Update(params)
}
use resend_rs::{types::UpdateBroadcastOptions, Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let id = "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794";
let html = "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}";
let opts = UpdateBroadcastOptions::new().with_html(html);
let _broadcast = resend.broadcasts.update(id, opts).await?;
Ok(())
}
Resend resend = new Resend("re_xxxxxxxxx");
UpdateBroadcastOptions params = UpdateBroadcastOptions.builder()
.id("49a3999c-0ce1-4ea6-ab68-afcd6dc2e794")
.html("Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}")
.build();
UpdateBroadcastResponseSuccess data = resend.broadcasts().update(params);
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.BroadcastUpdateAsync(
new Guid( "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794" ),
new BroadcastUpdateData()
{
HtmlBody = "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
);
curl -X PATCH 'https://api.resend.com/broadcasts/49a3999c-0ce1-4ea6-ab68-afcd6dc2e794' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
}'
resend broadcasts update 49a3999c-0ce1-4ea6-ab68-afcd6dc2e794 \
--html "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}
Update Broadcast
Update a broadcast to send to your contacts.
PATCH
/
broadcasts
/
:broadcast_id
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.broadcasts.update(
'49a3999c-0ce1-4ea6-ab68-afcd6dc2e794',
{
html: 'Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
},
);
$resend = Resend::client('re_xxxxxxxxx');
$resend->broadcasts->update('49a3999c-0ce1-4ea6-ab68-afcd6dc2e794', [
'html' => 'Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
]);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Broadcasts.UpdateParams = {
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
}
resend.Broadcasts.update(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
Resend::Broadcasts.update(params)
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
params := &resend.UpdateBroadcastRequest{
Id: "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
Html: "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
client.Broadcasts.Update(params)
}
use resend_rs::{types::UpdateBroadcastOptions, Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let id = "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794";
let html = "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}";
let opts = UpdateBroadcastOptions::new().with_html(html);
let _broadcast = resend.broadcasts.update(id, opts).await?;
Ok(())
}
Resend resend = new Resend("re_xxxxxxxxx");
UpdateBroadcastOptions params = UpdateBroadcastOptions.builder()
.id("49a3999c-0ce1-4ea6-ab68-afcd6dc2e794")
.html("Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}")
.build();
UpdateBroadcastResponseSuccess data = resend.broadcasts().update(params);
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.BroadcastUpdateAsync(
new Guid( "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794" ),
new BroadcastUpdateData()
{
HtmlBody = "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
);
curl -X PATCH 'https://api.resend.com/broadcasts/49a3999c-0ce1-4ea6-ab68-afcd6dc2e794' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
}'
resend broadcasts update 49a3999c-0ce1-4ea6-ab68-afcd6dc2e794 \
--html "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}
Path Parameters
Body Parameters
Sender email address.To include a friendly name, use the format
"Your Name <sender@domain.com>".Email subject.
The HTML version of the message.
The plain text version of the message.
If not provided, the HTML will be used to generate a plain text version. You
can opt out of this behavior by setting value to an empty string.
The React component used to write the message. Only available in the Node.js
SDK.
The friendly name of the broadcast. Only used for internal reference.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.broadcasts.update(
'49a3999c-0ce1-4ea6-ab68-afcd6dc2e794',
{
html: 'Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
},
);
$resend = Resend::client('re_xxxxxxxxx');
$resend->broadcasts->update('49a3999c-0ce1-4ea6-ab68-afcd6dc2e794', [
'html' => 'Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
]);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Broadcasts.UpdateParams = {
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
}
resend.Broadcasts.update(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
Resend::Broadcasts.update(params)
package main
import "github.com/resend/resend-go/v3"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
params := &resend.UpdateBroadcastRequest{
Id: "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
Html: "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
client.Broadcasts.Update(params)
}
use resend_rs::{types::UpdateBroadcastOptions, Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let id = "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794";
let html = "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}";
let opts = UpdateBroadcastOptions::new().with_html(html);
let _broadcast = resend.broadcasts.update(id, opts).await?;
Ok(())
}
Resend resend = new Resend("re_xxxxxxxxx");
UpdateBroadcastOptions params = UpdateBroadcastOptions.builder()
.id("49a3999c-0ce1-4ea6-ab68-afcd6dc2e794")
.html("Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}")
.build();
UpdateBroadcastResponseSuccess data = resend.broadcasts().update(params);
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.BroadcastUpdateAsync(
new Guid( "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794" ),
new BroadcastUpdateData()
{
HtmlBody = "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}",
}
);
curl -X PATCH 'https://api.resend.com/broadcasts/49a3999c-0ce1-4ea6-ab68-afcd6dc2e794' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"html": "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
}'
resend broadcasts update 49a3999c-0ce1-4ea6-ab68-afcd6dc2e794 \
--html "Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}"
{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}
Was this page helpful?
⌘I