Manage labels
manage_labelsCreate, edit, delete, and add or remove WhatsApp Business labels from chats and messages. For WhatsApp Business accounts only.
Instructions
WhatsApp Business labels on chats and messages: create or edit a label, delete it, and add it to or remove it from a chat or a message. WhatsApp Business accounts only; others answer not_supported. There is no endpoint that lists labels: they arrive in label.updated webhook events, and upsert creates one under an id you choose.
Actions:
upsert: Create the label with this id, or rename or recolor it. Returns the label.delete: Delete the label. Needsconfirm: true.label_chat: Add the label to a chat.unlabel_chat: Remove the label from a chat.label_message: Add the label to a message, as the account that sent or received it.unlabel_message: Remove the label from a message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | The label name. Required for `upsert`. | |
| color | No | WhatsApp's label color index, 0 to 19. Default 0. Optional for `upsert`. | |
| action | Yes | What to do. See the list of actions in the tool description. | |
| chatId | No | The chat: a contact as E.164 with + (`+584241112233`) or `lid:<digits>`, or a group id (`...@g.us`). Required for `label_chat`, `unlabel_chat`. | |
| confirm | No | Must be true. The label is removed from every chat and message. Only set it after the user asked for this or agreed to it. Required for `delete`. | |
| labelId | No | The label id. `upsert` creates the label under this id when there is none. Required for every action. | |
| accountId | No | The wuapi account id of the linked number to act as (from list_accounts). Required for `upsert`, `delete`, `label_chat`, `unlabel_chat`. | |
| messageId | No | A wuapi message id (from list_messages, a send tool, or a webhook). Required for `label_message`, `unlabel_message`. |