post
https://partner.gupshup.io/partner/app//bizai/agent_event
Tells the agent something happened for a consumer, such as a payment. This can send a real
WhatsApp message to the number in to. event.payload is a JSON string, not an object.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Request parameters
| Parameter | Type | Required | In | Description |
|---|---|---|---|---|
Authorization | string | Yes | Header | Partner app token, sent raw. Bearer <token> is also accepted. |
Content-Type | string | Yes | Header | application/json |
appId | string (uuid) | Yes | Path | Partner Portal app id. Stands in for Meta's entity_id. |
to | string | Yes | Body | Consumer phone number, E.164. The consumer must already have a conversation with the business. |
event | object | Yes | Body | The business event. |
event.type | string | Yes | Body | Max 256 chars. e.g. payment_received. |
event.description | string | Yes | Body | Max 1024 chars. |
event.payload | string | Yes | Body | JSON-encoded event data. Max 4096 chars. |
Example request
curl --location --request POST 'https://partner.gupshup.io/partner/app/<appId>/bizai/agent_event' \
--header 'Authorization: <PARTNER_APP_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"to": "+919999999999",
"event": {
"type": "payment_received",
"description": "Customer payment processed successfully",
"payload": "{\"amount\": 99.99, \"currency\": \"USD\"}"
}
}'Response parameters — 200
200| Parameter | Type | Description |
|---|---|---|
status | string | Always accepted. |
agent_event_id | string | Id to read the event back with GET /agent_event/{agentEventId}. |
Example response — 200 OK
200 OK{
"status": "accepted",
"agent_event_id": "pfbid0AgentEventExampleId"
}Error responses
400 Bad Request — The app is not live, or WASS does not consider it live.
{
"message": "App is not live.",
"status": "error"
}400 Bad Request — The app has no phone number attached. Checked before the live check.
{
"message": "Phone id not found for the given App",
"status": "error"
}401 Unauthorized — Authorization is missing or invalid, belongs to another app, or appId is unknown or not a UUID.
{
"status": "error",
"message": "Unauthorised access to the resource. Please review request parameters and headers and retry"
}405 Method Not Allowed — Any method other than GET, POST, PUT or DELETE, e.g. PATCH.
{
"status": "error",
"message": "Request method 'PATCH' is not supported"
}429 Too Many Requests — More than 30 /bizai/** requests in 60 seconds for this app. The 31st is rejected.
{
"status": "error",
"message": "Too Many Requests"
} 429Per-app rate limit exceeded. Retry after the 60-second window.
