Chat
Favorite chat or message
Marks an entire chat or a specific message as a favorite
POST
Favorite chat or message
Auth:
TokenAccount or TokenInstance • Rate-limit: Global (100/min) • Idempotent: yes
Description
Marks a chat as favorite (by passingnumber) or a specific message (by passing messageId). At least one of the two must be present.
When both are provided,
messageId takes precedence, the favorite is recorded on the message.Examples
Favorite a chat
Marks the entire conversation as a favorite by passing onlynumber. Use this to highlight important contacts in the list, without tying the favorite to a specific message.
Favorite a message
Favorites a specific message viamessageId. When both fields are sent, messageId takes precedence and the favorite is recorded on the message instead of the chat.
Remove favorite
Withfavorite: false, undoes the previously recorded favorite on the chat or the message (depending on which field was provided, same precedence rule as in the previous examples).
Success response
Thetype field indicates what was marked: "chat" when you favorited the entire conversation, or "message" when you passed a messageId (in that case message_id is filled in). chat_jid is always returned. favorite reflects the final state.
200 OK
Path parameters
Instance name.
Headers
| Name | Required | Example | Description |
|---|---|---|---|
Content-Type | yes | application/json | , |
token | yes (or Authorization) | a1b2c3d4-... | TokenAccount or TokenInstance. |
Request body
Phone number or JID. Use to favorite the entire chat.
Message ID. Use to favorite a specific message. Takes precedence over
number.true favorites, false removes the favorite.You must send at least one of
number and messageId.Error responses
| HTTP | error.message | When it happens |
|---|---|---|
| 400 | Instance name is required | , |
| 400 | Invalid request body: <...> | Malformed JSON. |
| 400 | Either number or messageId is required | Neither provided. |
| 401 | Invalid token | , |
| 404 | Instance not found | , |
| 404 | Message not found | messageId does not exist. |
| 503 | Instance is not connected to WhatsApp | , |
Error 400
Related
Pin chat
POST /api/chat/pinChat/:instanceFind message
Retrieve a favorited message.