Skip to content

Labels

Organize messages with inbox-scoped colored labels.

01

Create labels#

Labels belong to one inbox and have a unique name within it.

Shell
curl https://botinbox.dev/v0/inboxes/INBOX_ID/labels -X POST -H "Authorization: Bearer $BOTINBOX_API_KEY" \
  -H "Content-Type: application/json" -d '{"name":"urgent","color":"red"}'

02

Apply labels#

Set the complete label collection on a message. Every label must belong to the same inbox.

Shell
curl https://botinbox.dev/v0/inboxes/INBOX_ID/messages/MESSAGE_ID -X PATCH -H "Authorization: Bearer $BOTINBOX_API_KEY" \
  -H "Content-Type: application/json" -d '{"label_ids":["LABEL_ID"]}'

03

Filter messages#

Pass a label ID or name to the messages endpoint.

Shell
curl "https://botinbox.dev/v0/inboxes/INBOX_ID/messages?label=urgent" -H "Authorization: Bearer $BOTINBOX_API_KEY"