import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.labels.create({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
name: 'Urgent',
color: '#E93D82',
});
curl -X POST 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"name": "Urgent",
"color": "#E93D82"
}'
resend inboxes labels create \
--inbox_id b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 \
--name Urgent \
--color '#E93D82'
{
"object": "inbox_label",
"id": "7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34"
}
Create Label
Create a label on an inbox.
POST
/
inboxes
/
:inbox_id
/
labels
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.labels.create({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
name: 'Urgent',
color: '#E93D82',
});
curl -X POST 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"name": "Urgent",
"color": "#E93D82"
}'
resend inboxes labels create \
--inbox_id b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 \
--name Urgent \
--color '#E93D82'
{
"object": "inbox_label",
"id": "7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34"
}
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.32.1-preview-inboxes.6
npm install -g resend-cli@2.22.0-preview-inboxes.9
Path Parameters
Body Parameters
string
required
The name of the label.
string
The color of the label as a
#RRGGBB hex code, like #E93D82. If you leave
it out, Resend picks one for you.import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.inboxes.labels.create({
inboxId: 'b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1',
name: 'Urgent',
color: '#E93D82',
});
curl -X POST 'https://api.resend.com/inboxes/b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1/labels' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d $'{
"name": "Urgent",
"color": "#E93D82"
}'
resend inboxes labels create \
--inbox_id b3e2b2b6-3f0e-4c8e-9ad3-2f43a1e2c7f1 \
--name Urgent \
--color '#E93D82'
{
"object": "inbox_label",
"id": "7f9c1d2e-4a6b-4c3d-8e15-9b0a7c6d5e34"
}
Was this page helpful?
⌘I