Send Message

posthttps://api.telnyx.com/v2/whatsapp_messages

Send text messages, media/documents, and message templates to your customers.

curl -X POST \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --header "Authorization: Bearer YOUR_API_KEY" \ --data-raw '{ "whatsapp_user_id": "15125551212", "to": "15125557878", "type": "text", "recipient_type": "individual", "text": {"body": "This is a WhatsApp message!"} }' \ https://api.telnyx.com/v2/whatsapp_messages

Parameters

In Body (application/json)
whatsapp_user_id
string
()
required
The sender's WhatsApp ID.
to
string
()
required
The WhatsApp ID (phone number) returned from contacts endpoint.
audio
object
()
optional
The media object containing audio details.
document
object
()
optional
The media object containing a document reference
image
object
()
optional
The media object containing an image
location
object
()
optional
preview_url
boolean
()
optional
Specifying preview_url in the request is optional when not including a URL in your message. To include a URL preview, set preview_url to true in the message body and make sure the URL begins with http:// or https://.
template
object
()
optional
text
object
()
optional
type
string
()
optional
type of the message
Default:
"text"
Options: [ "audio", "contacts", "document", "image", "location", "template", "text", "video", "voice", "unknown" ]
video
object
()
optional
The media object containing a video

Responses

200
Successful response
default
Unexpected error

Success Response

{
  "data": {
    "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU",
    "record_type": "whatsapp_message_id"
  }
}

...

patchhttps://api.telnyx.com/v2/whatsapp_messages/{message_id}

...

...

Parameters

Responses

Success Response

Was this page helpful?