Skip to content

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

FieldTypeRequiredNotes
phoneNumberIdstringyesMeta phone number ID
tostringyesDigits only after normalization
contextMessageWamidstringnoReply 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

FieldTypeRequired
textstringyes

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

FieldTypeRequiredNotes
typeenumyesimage, video, audio, document
mediaIdstringyesMeta media id
captionstringnoNot used for audio in payload
filenamestringnoFor 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

FieldTypeRequired
latitudestring | numberyes
longitudestring | numberyes
namestringno
addressstringno

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

FieldTypeRequired
bodyTextstringyes
footerTextstringno
thumbnailProductRetailerIdstringno

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

FieldTypeRequired
catalogIdstringyes
productRetailerIdstringyes
bodyTextstringno
footerTextstringno

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

FieldTypeRequired
catalogIdstringyes
headerTextstringyes
bodyTextstringyes
footerTextstringno
sectionsarrayyes (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

FieldTypeRequired
bodyTextstringyes
cardsarrayyes (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

FieldTypeRequired
bodyTextstringyes
buttonsarrayyes, 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

FieldTypeRequired
bodyTextstringyes
buttonTextstringyes
headerTextstringno
footerTextstringno
sectionsarrayyes (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):

ConditionDispatches to
text is a stringText send
media is an objectMedia send
location is an objectLocation send
bodyText + catalogId + productRetailerIdSingle product (note: bodyText must be present as string for this branch)
bodyText + cards arrayProduct carousel
bodyText + catalogId + sections arrayProduct list
bodyText + (thumbnailProductRetailerId or footerText)Catalog message
bodyText + buttons arrayReply buttons
bodyText + buttonText + sections arrayList 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.