Skip to main content
POST
Favorite chat or message
Auth: TokenAccount or TokenInstanceRate-limit: Global (100/min) • Idempotent: yes

Description

Marks a chat as favorite (by passing number) 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 only number. Use this to highlight important contacts in the list, without tying the favorite to a specific message.

Favorite a message

Favorites a specific message via messageId. When both fields are sent, messageId takes precedence and the favorite is recorded on the message instead of the chat.

Remove favorite

With favorite: 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

The type 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

string
required
Instance name.

Headers

Request body

string
Phone number or JID. Use to favorite the entire chat.
string
Message ID. Use to favorite a specific message. Takes precedence over number.
boolean
required
true favorites, false removes the favorite.
You must send at least one of number and messageId.

Error responses

Error 400

Pin chat

POST /api/chat/pinChat/:instance

Find message

Retrieve a favorited message.