Send an agent a notification
/v1/whatsapp/numbers/{number_id}/agent/notifications// The agent decides whether and how to tell the contact. The answer reads
// accepted; read it back to see whether the agent acted on it.
const notification = await bird.whatsapp.agents.notifications.create("wan_01krdgeqcxet5s7t44vh8rt9mg", {
to: "+14155551234",
name: "order_shipped",
description: "Order 88213 left the warehouse and arrives on Thursday.",
payload: JSON.stringify({ order_id: "88213", carrier: "ACME Courier" }),
});
console.log(notification.id, notification.status);# The agent decides whether and how to tell the contact. The answer reads
# accepted; read it back to see whether the agent acted on it.
notification = client.whatsapp.agents.notifications.create(
"wan_01krdgeqcxet5s7t44vh8rt9mg",
to="+14155551234",
name="order_shipped",
description="Order 88213 left the warehouse and arrives on Thursday.",
payload='{"order_id":"88213","carrier":"ACME Courier"}',
)
print(notification.id, notification.status)notification, err := client.Whatsapp.Agents.Notifications.Create(context.Background(), "wan_01krdgeqcxet5s7t44vh8rt9mg", bird.WhatsappAgentsNotificationsCreateParams{
To: "+14155551234",
Name: "order_shipped",
Description: "Order 88213 left the warehouse and arrives on Thursday.",
Payload: `{"order_id":"88213","carrier":"ACME Courier"}`,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(*notification.Id, *notification.Status)// The agent decides whether and how to tell the contact. The answer reads
// accepted; read it back to see whether the agent acted on it.
$notification = $bird->whatsapp->agents->notifications->create(
'wan_01krdgeqcxet5s7t44vh8rt9mg',
(new WhatsAppAgentNotificationCreate())
->setTo('+14155551234')
->setName('order_shipped')
->setDescription('Order 88213 left the warehouse and arrives on Thursday.')
->setPayload('{"order_id":"88213","carrier":"ACME Courier"}'),
);
echo $notification->getId(), ' ', $notification->getStatus();bird whatsapp agents notifications create <number-id> \
--description 'Order 88213 left the warehouse and arrives on Thursday.' \
--name order_shipped \
--payload '{"order_id":"88213","carrier":"ACME Courier","eta":"2026-10-02"}' \
--to +14155551234curl -X POST "https://us1.platform.bird.com/v1/whatsapp/numbers/{number_id}/agent/notifications" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155551234",
"name": "order_shipped",
"description": "Order 88213 left the warehouse and arrives on Thursday.",
"payload": "{\"order_id\":\"88213\",\"carrier\":\"ACME Courier\",\"eta\":\"2026-10-02\"}"
}'{
"id": "waan_01krdgeqcxet5s7t44vh8rt9m7",
"to": {
"phone_number": "+14155551234"
},
"name": "order_shipped",
"description": "Order 88213 left the warehouse and arrives on Thursday.",
"payload": "{\"order_id\":\"88213\",\"carrier\":\"ACME Courier\",\"eta\":\"2026-10-02\"}",
"status": "accepted",
"created_at": "2026-10-01T08:00:00Z"
}
Tells the agent that something happened in your systems for one contact, such as a payment landing, an order shipping or an identity check passing. The agent decides whether and how to tell the contact, drawing on description and payload, and may write to them without waiting for their next message.
Bird takes the notification, hands it to WhatsApp in the background and keeps asking WhatsApp what became of it, so this answers 202 with the notification as you sent it at status: accepted. A read in the first moments after the 202 can answer 404 while the hand-off is still in flight. Read it back, or list the notifications, to see it settle: success when the agent acted on it, skipped with WhatsApp's reason when the agent chose to say nothing, or failed with what went wrong. The notification records whether the agent acted on it, not what the agent said to the contact. A number without an agent returns 404, and one whose agent WhatsApp is still preparing returns 409.
Parâmetros
number_idstringID of the WhatsApp number (wan_ prefix), as returned by the number list.
Corpo da requisição
toThe contact the notification is about: a phone number in E.164 format (for example +14155551234), or the contact's business-scoped user ID (for example US.13491208655302741918), the same forms a message's to accepts. A phone number is normalized before the call reaches WhatsApp, so spacing does not matter. WhatsApp documents a phone number for this call; a business-scoped user ID is passed through as given.
nameYour own name for what happened, such as payment_received or order_shipped. The agent reads it as the kind of thing that happened, so keep one name per kind. WhatsApp calls this the event type.
descriptionWhat happened, in a sentence the agent can tell the contact.
payloadDetails the agent may draw on when it writes to the contact, as one JSON string. WhatsApp passes it to the agent unchanged and does not read it itself.
Payload de resposta
idUnique identifier for the notification.
toThe contact the notification was about: the phone number or business-scoped user ID you addressed it to, in the same shape a message's to uses.
Mostrar atributos secundários
to.phone_numberPhone number in E.164 format, when known.
to.bsuidBusiness-scoped user ID, Meta's identifier for the WhatsApp user. Present only on the WhatsApp-user side of the message.
to.group_idThe group this address was addressed as, or reached through. It appears on a message's to and nowhere else: never on from, and never on an event's recipient. Outbound, it stands in for the recipient, because a group send names no single phone number. Inbound, it qualifies one: to carries the business phone_number that received the message and the group it arrived through, while from stays the participant who wrote it. Its presence on to is what tells a group message from a one-to-one one, in either direction.
to.usernamePresent only on a message received from a WhatsApp user, on from; never on an outbound send's to, where the profile is not known. Absent when the contact has not adopted one, and on a message received before this workspace started recording them. Same form as a number's own username (WhatsAppNumberProfile.username), without a leading @; a message cannot be addressed by it.
to.display_namePresent only on a message received from a WhatsApp user, on from; never on an outbound send's to, where the profile is not known. Absent when the message carries no profile, and on a message received before this workspace started recording them.
nameYour own name for what happened, as you sent it.
descriptionWhat happened, as you sent it.
payloadThe data you attached, as you sent it.
statusWhere the notification stands. accepted from the moment Bird takes it, then one of the three final states once WhatsApp has answered.
skipped_reasonWhatsApp's own account of why the agent chose to say nothing, passed through. Present only when status is skipped. Show it to the person who sent the notification; never match on its text.
errorWhy the notification failed. Present only when status is failed.
Mostrar atributos secundários
error.descriptionWhatsApp's own explanation, passed through: what it said when it refused the notification, or its failure summary once it had worked on it. Show it to the person who sent the notification; never match on its text. Carries Bird's own words instead when the failure was Bird's verdict, such as no outcome arriving within a day.
error.meta_error_codeWhatsApp's most specific code when it refused the notification outright: its error subcode where it sent one, otherwise its top-level code. Treat it as an opaque string. Null when WhatsApp took the notification and reported the failure later, which carries no code, and when the failure was Bird's own verdict.
created_atWhen Bird accepted the notification.
Recursos relacionados
Continue com a documentação, guias e exemplos sobre este tópico.