v1

latestOpenAPI 3.0.02026-07-1355113123.3 KB
Messages

Send-Message

post/messages

Request body

tostring 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.

type'audio' | 'contacts' | 'document' | 'hsm' | 'image' | 'location' | 'text' | 'video' | 'voice' | 'unknown'

type of the message

recipient_type'individual' | 'group'

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.

ttlobject
preview_urlboolean

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.

Example request

{
  "preview_url": true,
  "recipient_type": "individual",
  "to": "{whatsapp-id}",
  "type": "text",
  "text": {
    "body": "your-text-message-content"
  }
}

Response

Example response

{
  "messages": [
    {
      "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
    }
  ]
}