Messages
Base: /v2/messages
All routes require auth, plan, Premium/Enterprise, and phoneNumberId ownership — see overview and Account.
Also read: HTTP API v2 Overview
Common POST fields
| Field | Type | Required | Notes |
|---|---|---|---|
phoneNumberId | string | yes | Meta phone number ID |
to | string | yes | Digits only after normalization |
contextMessageWamid | string | no | Reply context |
Typical success data (Meta send message)
All POST .../messages/... JSON endpoints wrap Meta’s response in { success: true, data }. A typical successful data value:
json
{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "15551234567",
"wa_id": "15551234567"
}
],
"messages": [
{
"id": "wamid.HBgL..."
}
]
}On failure, Meta errors may surface as 500 INTERNAL_ERROR with a message from the HTTP client layer; treat as transport/upstream issues and inspect message.
POST /v2/messages/send/text
Body
| Field | Type | Required |
|---|---|---|
text | string | yes |
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/text" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"text": "Hello from the API"
}'Response 200: envelope with data as in Typical success data (Meta send message).
POST /v2/messages/send/media
Body — media
| Field | Type | Required | Notes |
|---|---|---|---|
type | enum | yes | image, video, audio, document |
mediaId | string | yes | Meta media id |
caption | string | no | Not used for audio in payload |
filename | string | no | For document |
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/media" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"media": {
"type": "image",
"mediaId": "1234567890",
"caption": "Check this out"
}
}'Response 200: same Meta send shape as above.
POST /v2/messages/send/location
Body — location
| Field | Type | Required |
|---|---|---|
latitude | string | number | yes |
longitude | string | number | yes |
name | string | no |
address | string | no |
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/location" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"location": {
"latitude": 37.422,
"longitude": -122.084,
"name": "HQ",
"address": "1600 Amphitheatre Parkway"
}
}'Response 200: same Meta send shape.
POST /v2/messages/send/interactive/catalog-message
| Field | Type | Required |
|---|---|---|
bodyText | string | yes |
footerText | string | no |
thumbnailProductRetailerId | string | no |
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/interactive/catalog-message" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"bodyText": "Browse our catalog",
"footerText": "Tap below"
}'Response 200: same Meta send shape.
POST /v2/messages/send/interactive/product
| Field | Type | Required |
|---|---|---|
catalogId | string | yes |
productRetailerId | string | yes |
bodyText | string | no |
footerText | string | no |
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/interactive/product" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"catalogId": "CATALOG_ID",
"productRetailerId": "SKU-001",
"bodyText": "Featured item"
}'Response 200: same Meta send shape.
POST /v2/messages/send/interactive/product-list
| Field | Type | Required |
|---|---|---|
catalogId | string | yes |
headerText | string | yes |
bodyText | string | yes |
footerText | string | no |
sections | array | yes (min 1) |
Each section: { "title": string, "product_items": [ { "product_retailer_id": string } ] } (at least one product per section).
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/interactive/product-list" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"catalogId": "CATALOG_ID",
"headerText": "Shop",
"bodyText": "Pick a product",
"sections": [
{
"title": "Featured",
"product_items": [{ "product_retailer_id": "SKU-001" }]
}
]
}'Response 200: same Meta send shape.
POST /v2/messages/send/interactive/product-carousel
| Field | Type | Required |
|---|---|---|
bodyText | string | yes |
cards | array | yes (min 2 cards) |
Each card: { "catalogId": string, "productRetailerId": string }.
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/interactive/product-carousel" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"bodyText": "Swipe to browse",
"cards": [
{ "catalogId": "CATALOG_ID", "productRetailerId": "SKU-001" },
{ "catalogId": "CATALOG_ID", "productRetailerId": "SKU-002" }
]
}'Response 200: same Meta send shape.
POST /v2/messages/send/interactive/button
| Field | Type | Required |
|---|---|---|
bodyText | string | yes |
buttons | array | yes, 1–3 items |
Each button: { "id": string, "title": string } → sent as reply buttons.
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/interactive/button" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"bodyText": "Choose one",
"buttons": [
{ "id": "yes", "title": "Yes" },
{ "id": "no", "title": "No" }
]
}'Response 200: same Meta send shape.
POST /v2/messages/send/interactive/list
| Field | Type | Required |
|---|---|---|
bodyText | string | yes |
buttonText | string | yes |
headerText | string | no |
footerText | string | no |
sections | array | yes (min 1) |
Each section: title + rows (min 1). Each row: id, title, optional description.
Example request:
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send/interactive/list" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"bodyText": "Select an option",
"buttonText": "Open menu",
"headerText": "Menu",
"sections": [
{
"title": "Options",
"rows": [
{ "id": "1", "title": "Option A", "description": "Details" }
]
}
]
}'Response 200: same Meta send shape.
POST /v2/messages/send (smart dispatcher)
Single endpoint that infers message type from the JSON body (same base fields + optional contextMessageWamid):
| Condition | Dispatches to |
|---|---|
text is a string | Text send |
media is an object | Media send |
location is an object | Location send |
bodyText + catalogId + productRetailerId | Single product (note: bodyText must be present as string for this branch) |
bodyText + cards array | Product carousel |
bodyText + catalogId + sections array | Product list |
bodyText + (thumbnailProductRetailerId or footerText) | Catalog message |
bodyText + buttons array | Reply buttons |
bodyText + buttonText + sections array | List message |
Example request (text via smart send):
bash
curl -sS -X POST "https://api.avenping.com/v2/messages/send" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumberId": "109876543210987",
"to": "15551234567",
"text": "Hello via smart send"
}'Response 200: same Meta send shape as dedicated text route.
Response 400 when no branch matches:
json
{
"success": false,
"error": "VALIDATION_ERROR",
"message": "Unsupported message payload."
}For interactive types, prefer the explicit path URLs above when documenting examples; use /send when you want one integration point.