import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.threads.labels.set({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
threadId: '4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
labels: ['2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d'],
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->inboxes->threads->labels->set(
'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
'4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
[
'labels' => ['2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d'],
]
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Inboxes.Threads.Labels.SetParams = {
"inbox_id": "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"thread_id": "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
"labels": ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"],
}
resend.Inboxes.Threads.Labels.set(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
inbox_id: "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
thread_id: "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
labels: ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"]
}
Resend::Inboxes::Threads::Labels.set(params)
package main
import "github.com/resend/resend-go/v4"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
params := &resend.SetInboxThreadLabelsRequest{
Labels: []string{"2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"},
}
client.Inboxes.Threads.Labels.Set(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
params,
)
use resend_rs::{Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let _labels = resend
.inboxes
.set_thread_labels(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
&["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"],
)
.await?;
Ok(())
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.InboxThreadLabelSetAsync(
new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ),
new Guid( "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12" ),
[ new Guid( "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d" ) ]
);
Console.WriteLine( "Nr Labels={0}", resp.Content.Count );
curl -X PUT 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/threads/4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"labels": ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"]
}'
curl -X PUT 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/threads/4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"labels": []
}'
resend inboxes threads labels set b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12 \
--labels 2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d
{
"object": "list",
"data": [
{
"id": "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d",
"name": "Billing",
"color": "#00A2C7"
}
]
}
Set Thread Labels
Replace every label on a thread.
PUT
/
inboxes
/
:inbox_id
/
threads
/
:thread_id
/
labels
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.threads.labels.set({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
threadId: '4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
labels: ['2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d'],
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->inboxes->threads->labels->set(
'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
'4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
[
'labels' => ['2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d'],
]
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Inboxes.Threads.Labels.SetParams = {
"inbox_id": "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"thread_id": "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
"labels": ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"],
}
resend.Inboxes.Threads.Labels.set(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
inbox_id: "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
thread_id: "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
labels: ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"]
}
Resend::Inboxes::Threads::Labels.set(params)
package main
import "github.com/resend/resend-go/v4"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
params := &resend.SetInboxThreadLabelsRequest{
Labels: []string{"2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"},
}
client.Inboxes.Threads.Labels.Set(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
params,
)
use resend_rs::{Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let _labels = resend
.inboxes
.set_thread_labels(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
&["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"],
)
.await?;
Ok(())
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.InboxThreadLabelSetAsync(
new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ),
new Guid( "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12" ),
[ new Guid( "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d" ) ]
);
Console.WriteLine( "Nr Labels={0}", resp.Content.Count );
curl -X PUT 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/threads/4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"labels": ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"]
}'
curl -X PUT 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/threads/4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"labels": []
}'
resend inboxes threads labels set b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12 \
--labels 2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d
{
"object": "list",
"data": [
{
"id": "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d",
"name": "Billing",
"color": "#00A2C7"
}
]
}
The thread ends up with exactly the labels given, in one atomic change. Labels
on the thread that are not listed are taken off, and the labels themselves are
kept. If any label ID is not found, the request returns a
404 and nothing
changes.
Path Parameters
Body Parameters
string[]
required
The IDs of the labels the thread should carry. Up to 100 IDs, each belonging
to the inbox. Pass an empty array to take every label off the thread.
Response Fields
string
Always
list.array
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.threads.labels.set({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
threadId: '4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
labels: ['2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d'],
});
$resend = Resend::client('re_xxxxxxxxx');
$resend->inboxes->threads->labels->set(
'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
'4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
[
'labels' => ['2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d'],
]
);
import resend
resend.api_key = "re_xxxxxxxxx"
params: resend.Inboxes.Threads.Labels.SetParams = {
"inbox_id": "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"thread_id": "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
"labels": ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"],
}
resend.Inboxes.Threads.Labels.set(params)
require "resend"
Resend.api_key = "re_xxxxxxxxx"
params = {
inbox_id: "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
thread_id: "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
labels: ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"]
}
Resend::Inboxes::Threads::Labels.set(params)
package main
import "github.com/resend/resend-go/v4"
func main() {
client := resend.NewClient("re_xxxxxxxxx")
params := &resend.SetInboxThreadLabelsRequest{
Labels: []string{"2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"},
}
client.Inboxes.Threads.Labels.Set(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
params,
)
use resend_rs::{Resend, Result};
#[tokio::main]
async fn main() -> Result<()> {
let resend = Resend::new("re_xxxxxxxxx");
let _labels = resend
.inboxes
.set_thread_labels(
"b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1",
"4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12",
&["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"],
)
.await?;
Ok(())
}
using Resend;
IResend resend = ResendClient.Create( "re_xxxxxxxxx" ); // Or from DI
var resp = await resend.InboxThreadLabelSetAsync(
new Guid( "b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1" ),
new Guid( "4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12" ),
[ new Guid( "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d" ) ]
);
Console.WriteLine( "Nr Labels={0}", resp.Content.Count );
curl -X PUT 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/threads/4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"labels": ["2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d"]
}'
curl -X PUT 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/threads/4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"labels": []
}'
resend inboxes threads labels set b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12 \
--labels 2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d
{
"object": "list",
"data": [
{
"id": "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d",
"name": "Billing",
"color": "#00A2C7"
}
]
}
Was this page helpful?
⌘I