import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.drafts.update({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
draftId: 'c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32',
subject: 'Refund issued for order 1041',
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->inboxes->drafts->update(
'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
'c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32',
['subject' => 'Refund issued for order 1041']
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Inboxes.Drafts.UpdateParams = {
"inbox_id": "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"id": "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
"subject": "Refund issued for order 1041",
}
resend.Inboxes.Drafts.update(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
inbox_id: "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
draft_id: "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
subject: "Refund issued for order 1041"
}
Resend::Inboxes::Drafts.update(params)
package main
import "github.com/resend/resend-go/v4"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
subject := "Refund issued for order 1041"
params := &resend.UpdateInboxDraftRequest{
Subject: &subject,
}
client.Inboxes.Drafts.Update(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
params,
)
use resend_rs::{
types::{UpdateInboxDraftOptions},
Resend, Result,
};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let opts = UpdateInboxDraftOptions::new().with_subject("Refund issued for order 1041");
let _draft = resend
.inboxes
.update_draft(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
opts,
)
.await?;
Ok(())
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.InboxDraftUpdateAsync(
new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ),
new Guid( "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32" ),
new InboxDraftUpdateData()
{
Subject = "Refund issued for order 1041",
}
);
Console.WriteLine( "Draft Id={0}", resp.Content );
curl -X PATCH 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/drafts/c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"subject": "Refund issued for order 1041"
}'
resend inboxes drafts update b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32 \
--subject "Refund issued for order 1041"
{
"object": "inbox_draft",
"id": "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32"
}
Update Draft
Update an unsent draft.
PATCH
/
inboxes
/
:inbox_id
/
drafts
/
:draft_id
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.drafts.update({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
draftId: 'c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32',
subject: 'Refund issued for order 1041',
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->inboxes->drafts->update(
'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
'c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32',
['subject' => 'Refund issued for order 1041']
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Inboxes.Drafts.UpdateParams = {
"inbox_id": "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"id": "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
"subject": "Refund issued for order 1041",
}
resend.Inboxes.Drafts.update(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
inbox_id: "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
draft_id: "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
subject: "Refund issued for order 1041"
}
Resend::Inboxes::Drafts.update(params)
package main
import "github.com/resend/resend-go/v4"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
subject := "Refund issued for order 1041"
params := &resend.UpdateInboxDraftRequest{
Subject: &subject,
}
client.Inboxes.Drafts.Update(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
params,
)
use resend_rs::{
types::{UpdateInboxDraftOptions},
Resend, Result,
};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let opts = UpdateInboxDraftOptions::new().with_subject("Refund issued for order 1041");
let _draft = resend
.inboxes
.update_draft(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
opts,
)
.await?;
Ok(())
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.InboxDraftUpdateAsync(
new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ),
new Guid( "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32" ),
new InboxDraftUpdateData()
{
Subject = "Refund issued for order 1041",
}
);
Console.WriteLine( "Draft Id={0}", resp.Content );
curl -X PATCH 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/drafts/c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"subject": "Refund issued for order 1041"
}'
resend inboxes drafts update b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32 \
--subject "Refund issued for order 1041"
{
"object": "inbox_draft",
"id": "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32"
}
Updates the content of an unsent draft. A draft that was already sent returns
a
409.
Path Parameters
Body Parameters
Send at least one field. Omitted fields keep their current value. A request withhtml or text replaces both, and the one you leave out is saved as
null. After the update, the draft must still have at least one non-empty
field, and to, cc, and bcc combined cannot exceed 50 recipients.
string | string[] | null
Recipients. Send
null or [] to clear them.string | string[] | null
CC recipients. Send
null or [] to clear them.string | string[] | null
BCC recipients. Send
null or [] to clear them.string | null
The subject. 1 to 2000 characters, with no line breaks. Send
null to clear
it.string | null
The HTML body. Send
null to clear it.string | null
The plain-text body. Send
null to clear it.array | null
Files to store on the draft, up to 25 MB in total. Sending the field replaces
every attachment on the draft. Send
null or [] to remove them all. Drafts
do not accept path or content_id.Response Fields
string
Always
inbox_draft.string
The ID of the draft.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.drafts.update({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
draftId: 'c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32',
subject: 'Refund issued for order 1041',
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->inboxes->drafts->update(
'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
'c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32',
['subject' => 'Refund issued for order 1041']
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Inboxes.Drafts.UpdateParams = {
"inbox_id": "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"id": "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
"subject": "Refund issued for order 1041",
}
resend.Inboxes.Drafts.update(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
inbox_id: "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
draft_id: "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
subject: "Refund issued for order 1041"
}
Resend::Inboxes::Drafts.update(params)
package main
import "github.com/resend/resend-go/v4"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
subject := "Refund issued for order 1041"
params := &resend.UpdateInboxDraftRequest{
Subject: &subject,
}
client.Inboxes.Drafts.Update(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
params,
)
use resend_rs::{
types::{UpdateInboxDraftOptions},
Resend, Result,
};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let opts = UpdateInboxDraftOptions::new().with_subject("Refund issued for order 1041");
let _draft = resend
.inboxes
.update_draft(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32",
opts,
)
.await?;
Ok(())
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.InboxDraftUpdateAsync(
new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ),
new Guid( "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32" ),
new InboxDraftUpdateData()
{
Subject = "Refund issued for order 1041",
}
);
Console.WriteLine( "Draft Id={0}", resp.Content );
curl -X PATCH 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/drafts/c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"subject": "Refund issued for order 1041"
}'
resend inboxes drafts update b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32 \
--subject "Refund issued for order 1041"
{
"object": "inbox_draft",
"id": "c3a1e8b4-2d5f-4a7c-9e10-6b8d7f5a4c32"
}
Was this page helpful?
⌘I