LOOMAL

mail.update_thread_labels

Add or remove labels on a thread

Scope: mail:manage

Add or remove labels on a thread. Thread labels are separate from message labels — use them for user-applied tags like starred, important, archived, or any custom label. Message-level labels (sent, received, unread, spam) are managed via mail.update_labels.

Parameters

NameTypeRequiredDescription
threadIdstringYesThread ID
addLabelsstring[]NoLabels to add (e.g. 'starred', 'follow-up')
removeLabelsstring[]NoLabels to remove

At least one of addLabels or removeLabels must be provided.

Example

Agent: "Star the pricing thread and mark it as follow-up"

-> mail.update_thread_labels({
    threadId: "thd_a3f91b00c4e2d7e8",
    addLabels: ["starred", "follow-up"]
  })

Returns

{
  "threadId": "thd_a3f91b00c4e2d7e8",
  "inboxId": "agent-x8k2m@mailgent.dev",
  "subject": "Question about pricing",
  "labels": ["starred", "follow-up"],
  "createdAt": "2026-03-28T10:00:00.000Z",
  "updatedAt": "2026-04-06T14:00:00.000Z"
}

Common Patterns

IntentCall
Star a threadaddLabels: ["starred"]
UnstarremoveLabels: ["starred"]
Mark importantaddLabels: ["important"]
ArchiveaddLabels: ["archived"]
Custom tagaddLabels: ["customer-feedback"]
ReplaceaddLabels: ["archived"], removeLabels: ["inbox"]

Thread vs Message Labels

Label typeScopeToolExamples
Thread labelsWhole conversationmail.update_thread_labelsstarred, important, archived, custom
Message labelsSingle messagemail.update_labelsunread, sent, received, spam, read

Thread labels persist across replies and apply to the entire conversation. Message labels describe the state of a single message (e.g. whether the agent has read it).

REST Equivalent

PATCH /v0/threads/:threadId

On this page