WhatsApp Business API
  1. Messages
WhatsApp Business API
  • Registration
    • Request-Code
      POST
    • Register-Account
      POST
  • Application
    • Set-Shards
      POST
    • Reset-Application-Settings
      DELETE
    • Get-Application-Settings
      GET
    • Update-Application-Settings
      PATCH
    • Get-Media-Providers
      GET
    • Update-Media-Providers
      POST
    • Delete-Media-Providers
      DELETE
  • Certificates
    • Upload-Certificate
      POST
    • Download-CA-Certificate
      GET
    • Delete Webhook CA Certificate
      DELETE
    • Download Webhook CA Certificate
      GET
    • Upload Webhook CA Certificate
      POST
  • Contacts
    • Check-Contact
      POST
  • Groups
    • Get-All-Groups
      GET
    • Create-Group
      POST
    • Get-Group-Info
      GET
    • Update-Group-Info
      PUT
    • Demote-Group-Admin
      DELETE
    • Promote-To-Group-Admin
      PATCH
    • Delete-Group-Icon
      DELETE
    • Get-Group-Icon-Binary
      GET
    • Set-Group-Icon
      POST
    • Delete-Group-Invite
      DELETE
    • Get-Group-Invite
      GET
    • Leave-Group
      POST
    • Remove-Group-Participant
      DELETE
  • Health
    • Check-Health
    • Get-Metrics (since v2.21.3)
    • Get-App-Stats
    • Get-DB-Stats
    • Get-Support-Info
  • Media
    • Upload-Media
    • Delete-Media
    • Download-Media
  • Messages
    • Send-Message
      POST
    • Mark-Message-As-Read
      PUT
  • Two-Step Verification
    • Disable-Two-Step
    • Enable-Two-Step
  • Backup
    • Restore
      • Backup-Settings
      • Restore-Settings
  • Business Profile
    • Get-Business-Profile
    • Update-Business-Profile
  • Profile
    • Get-Profile-About
    • Update-Profile-About
    • Get-Profile-Photo
    • Update-Profile-Photo
  • Users
    • Create-User
    • Login-User
    • Logout-User
    • Delete-User
    • Get-User
    • Update-User
  • Delete-Profile-Photo
    DELETE
  1. Messages

Send-Message

http://whatsapp.local
http://whatsapp.local
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
optional
The media object containing 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
Full contact address(es)
birthday
string 
optional
YYYY-MM-DD formatted string
emails
array[object (Email) {2}] 
optional
Contact email address(es)
ims
array[string]
optional
name
object (Name) 
optional
Full contact name
Example:
{"first_name":"John","formatted_name":"John Smith","last_name":"Smith"}
org
object (Org) 
optional
Contact organization information
Example:
{"company":"WhatsApp","department":"Design","title":"Manager"}
phones
array[object (Phone) {3}] 
optional
Contact phone number(s)
urls
array[object (Root Type for Url) {2}] 
optional
Contact URL(s)
document
Document
optional
The media object containing a 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
The containing element for the message content — Indicates that the message is highly structured. Parameters contained within provide the structure.
Example:
{"element_name":"hello_world","language":{"code":"en","policy":"deterministic"},"localizable_params":[{"default":"1234"}],"namespace":"business_a_namespace"}
element_name
string 
required
The element name that indicates which template to use within the namespace
language
object (Language) 
required
Example:
{"code":"en","policy":"deterministic"}
localizable_params
array[object (LocalizableParam) {3}] 
required
This field is an array of values to apply to variables in the template
namespace
string 
required
The namespace that will be used
image
Image
optional
The media object containing an 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
Address of the location. Only displayed if name is present.
latitude
string 
required
Latitude of the location
longitude
string 
required
Longitude of the location
name
string 
required
Name of the location
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://. For more information, see the Sending URLs in Text Messages section.
recipient_type
enum<string> 
optional
Determines whether the recipient is an individual or a group
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
When recipient_type is individual, this field is the WhatsApp ID (phone number) returned from contacts endpoint. When recipient_type is group, this field is the WhatsApp group ID.
ttl
object 
optional
type
enum<string> 
optional
type of the message
Allowed values:
audiocontactsdocumenthsmimagelocationtextvideovoiceunknown
Default:
text
video
Video
optional
The media object containing a 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
Only returned with a failed request. Contains an array of error objects that are present when there is an error.
code
integer <int32>
optional
See the https://developers.facebook.com/docs/whatsapp/api/errors for more information.
details
string 
optional
error detail
href
string 
optional
location for error detail
title
string 
optional
error title
meta
object 
Meta
optional
Contains generic information such as WhatsApp Business API Client version.
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
Previous
Download-Media
Next
Mark-Message-As-Read
Built with