- Registration
- Application
- Certificates
- Contacts
- Groups
- Health
- Media
- Messages
- Two-Step Verification
- Backup
- Business Profile
- Profile
- Users
- Delete-Profile-PhotoDELETE
Send-Message
http://whatsapp.local
http://whatsapp.local
POST
/messages
Messages
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://whatsapp.local/messages' \
--header 'Content-Type: application/json' \
--data-raw '{
"recipient_type": "individual",
"text": {
"body": "<Message Text>"
},
"to": "{{Recipient-WA-ID}}",
"type": "text"
}'
Response Response Example
{
"messages": [
{
"id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
}
]
}
Request
Body Params application/json
audio
Audio
One of
Example:
{"id":"<Media Id, from Media API>"}
id
string
required
contacts
array[object (Contact) {8}]
optional
addresses
array[object (Address) {7}]
optional
birthday
string
optional
emails
array[object (Email) {2}]
optional
ims
array[string]
optional
name
object (Name)
optional
Example:
{"first_name":"John","formatted_name":"John Smith","last_name":"Smith"}
org
object (Org)
optional
Example:
{"company":"WhatsApp","department":"Design","title":"Manager"}
phones
array[object (Phone) {3}]
optional
urls
array[object (Root Type for Url) {2}]
optional
document
Document
One of
Example:
{"caption":"<Message Caption>","filename":"<Filename>","id":"<Media Id, from Media API>"}
caption
string
required
filename
string
required
id
string
required
hsm
object (Hsm)
optional
Example:
{"element_name":"hello_world","language":{"code":"en","policy":"deterministic"},"localizable_params":[{"default":"1234"}],"namespace":"business_a_namespace"}
element_name
string
required
language
object (Language)
required
Example:
{"code":"en","policy":"deterministic"}
localizable_params
array[object (LocalizableParam) {3}]
required
namespace
string
required
image
Image
One of
Example:
{"caption":"<Message Caption>","id":"<Media Id, from Media API>"}
caption
string
required
id
string
required
location
object (Location)
optional
Example:
{"address":"<Location's Address>","latitude":"<Latitude>","longitude":"<Longitude>","name":"<Location Name>"}
address
string
required
latitude
string
required
longitude
string
required
name
string
required
preview_url
boolean
optional
To include a URL preview, set preview_url to true in the message body and make sure the URL begins with http:// or https://. For more information, see the Sending URLs in Text Messages section.
recipient_type
enum<string>
optional
Specifying recipient_type in the request is optional when the value is individual.
However, recipient_type is required when using group. If sending a text message to a group, see the Sending Group Messages documentation.
Allowed values:
individualgroup
Default:
individual
text
object (Text)
optional
Example:
{"body":"<Message Text>"}
body
string
required
to
string
required
ttl
object
optional
type
enum<string>
optional
Allowed values:
audiocontactsdocumenthsmimagelocationtextvideovoiceunknown
Default:
text
video
Video
One of
Example:
{"caption":"<Message Caption>","id":"<Media Id, from Media API>"}
caption
string
required
id
string
required
Examples
Responses
🟢200Success
application/json
Body
errors
array[object (Error) {4}]
optional
code
integer <int32>
optional
details
string
optional
href
string
optional
title
string
optional
meta
object
Meta
Example:
{"api_status":"stable","version":"whatsapp-business-api-client-version"}
api_status
enum<string>
optional
Allowed values:
deprecatedexperimentalstable
version
string
optional
messages
array[object (Message) {1}]
optional
id
string
optional
Modified at 2023-08-15 03:06:39