Chat
Pin message
Pin or unpin a message inside a chat
POST
Pin message
Auth:
TokenAccount or TokenInstance • Rate-limit: Global (100/min) • Idempotent: yes
Description
Pins (pin: true) or unpins (pin: false) a message inside a chat. The chat, the message author and the direction (fromMe) are resolved automatically from messageId, you only need to provide the message.
The message must exist in the instance database (it must have been received/sent by it). Otherwise the API returns
message with ID ... not found.Examples
Pin
Withpin: true, the message is pinned to the top of the chat for the time set in duration.
Unpin
Withpin: false, the message is unpinned. The duration field is ignored.
cURL
Success response
chat_jid is resolved from messageId, pinned reflects the final state and duration is echoed only when pinning. The message changes with pin: "Message pinned successfully" or "Message unpinned successfully".
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
true pins, false unpins.ID of the message to pin/unpin. The chat and author are resolved automatically from it.
How long the message stays pinned:
"24h", "7d" or "30d". Used only when pin: true; ignored when unpinning.Error responses
| HTTP | error.message | When it happens |
|---|---|---|
| 400 | Instance name is required | , |
| 400 | Invalid request body: <...> | Malformed JSON. |
| 400 | messageId is required | , |
| 401 | Invalid token | , |
| 404 | Instance not found | , |
| 500 | message with ID <...> not found | Message does not exist in the instance database. |
| 500 | invalid duration "<...>": use "24h", "7d" or "30d" | Invalid duration value. |
| 500 | WhatsApp client is not connected | Instance disconnected. |
Error 400
Related
Pin chat
POST /api/chat/pinChat/:instanceFavorite
POST /api/chat/favorite/:instance