MailgentMailgent
Concepts

Labels

Organize messages with labels

Labels are string tags attached to messages. They help agents track message state.

Default Labels

LabelApplied when
receivedInbound email arrives
unreadInbound email arrives (paired with received)
sentOutbound email is sent

Custom Labels

You can add any custom labels:

curl -X PATCH https://api.mailgent.dev/v0/messages/{messageId} \
  -H "Authorization: Bearer mgent-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "addLabels": ["read", "processed", "high-priority"],
    "removeLabels": ["unread"]
  }'

Filtering by Labels

# Get all unread messages
GET /v0/messages?labels=unread

# Get all sent messages
GET /v0/messages?labels=sent

# Get messages with multiple labels (AND filter)
GET /v0/messages?labels=received,high-priority

Common Agent Patterns

PatternLabels
Mark as readAdd read, remove unread
Flag for reviewAdd needs-review
Mark as processedAdd processed, remove unread
ArchiveAdd archived
PriorityAdd high-priority or low-priority

On this page