import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.threads.labels.add({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
threadId: '4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
labels: ['7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34'],
});
curl -X POST '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": ["7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34"]
}'
resend inboxes threads labels add b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12 \
--labels 7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34
{
"object": "list",
"data": [
{
"id": "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d",
"name": "Billing",
"color": "#00A2C7"
},
{
"id": "7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34",
"name": "Urgent",
"color": "#E93D82"
}
]
}
Add Thread Labels
Apply one or more labels to a thread.
POST
/
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.add({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
threadId: '4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
labels: ['7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34'],
});
curl -X POST '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": ["7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34"]
}'
resend inboxes threads labels add b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12 \
--labels 7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34
{
"object": "list",
"data": [
{
"id": "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d",
"name": "Billing",
"color": "#00A2C7"
},
{
"id": "7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34",
"name": "Urgent",
"color": "#E93D82"
}
]
}
Inboxes are currently in private beta and only available to a limited
number of users. The response shape might change before GA.Get early access if you’re interested in testing this feature.Once you have access, upgrade your Resend SDK to use the new methods:
npm install resend@6.33.0
npm install -g resend-cli@2.25.0
Path Parameters
Body Parameters
string[]
required
The IDs of the labels to apply. Between 1 and 10 IDs, each belonging to the
inbox.
Response Fields
string
Always
list.array
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.threads.labels.add({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
threadId: '4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12',
labels: ['7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34'],
});
curl -X POST '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": ["7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34"]
}'
resend inboxes threads labels add b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 4d8e2a1c-9b3f-4c6d-8a21-3e5f7c9c0d12 \
--labels 7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34
{
"object": "list",
"data": [
{
"id": "2a8b4c6d-1e3f-4a5b-9c7d-8e0f1a2b3c4d",
"name": "Billing",
"color": "#00A2C7"
},
{
"id": "7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34",
"name": "Urgent",
"color": "#E93D82"
}
]
}
Was this page helpful?
⌘I