Sign inGet started

Pin a message in a WhatsApp group

POST
/v1/whatsapp/groups/{group_id}/pinned-messages
const pin = await bird.whatsapp.groups.pins.create("wag_01krdgeqcxet5s7t44vh8rt9mg", {
  message_id: "wam_01kya19eknftrs2s6p82asmvnh",
});
console.log(pin.pinned_until);
Réponse200
{
  "message_id": "wam_01krdgeqcxet5s7t44vh8rt9mg",
  "pinned_until": "2026-09-01T09:14:52Z"
}
Pins one of the group's messages at the top of its chat, where it stays for the number of days you give, from 1 to 30. Pin the message a conversation keeps coming back to, so a participant joining later does not have to scroll for it.
The message has to be one this group carries: a message in another group, or a one-to-one message, returns a 422 WhatsAppMessageNotInGroup. A message_id naming no message the workspace still holds returns a 404 instead, which is also what an id older than the 30 days messages stay readable for gets. Only an active group can be changed; any other status returns a 409 WhatsAppGroupNotActive.
A group holds 3 pinned messages at once, and pinning a fourth unpins the oldest rather than failing. Pinning an already-pinned message replaces its expiry. What the group currently pins is on the group itself, as pinned_messages.
WhatsApp confirms a pin in its reply rather than on a webhook, so the response is the applied pin and the entry appears in the group's pinned_messages straight away. Nothing about a pin is left in flight, so a pin never blocks the next pin or unpin.
Paramètres
group_id
string
ID of the group to pin a message in.
Corps de la requête
message_id
string
obligatoire
The message to pin. It has to be one this group carries: a message in another group, or a one-to-one message, returns a 422 WhatsAppMessageNotInGroup.
duration_days
integer
How many days the message stays pinned before WhatsApp unpins it, from 1 to 30.
Contenu de la réponse
message_id
string
obligatoire
The pinned message, as returned in the send response's id.
pinned_until
string
obligatoire
When the pin is due to lapse, projected from the duration_days the pin was asked for. An entry stays listed until it is unpinned, so a time in the past means WhatsApp has already taken the message off the chat.