๐Ÿ“„ Send Web WhatsApp Message

Send messages using a Web WhatsApp Channel (integration_2). This supports text, media (image, video, document, audio), and both group and individual recipients.


๐Ÿ”— Endpoint

POST /api/v1/web-whatsapp/:id/messages
  • :id = ID of the Web WhatsApp channel

๐Ÿ” Authentication

All requests must include a valid API key passed as a Bearer token in the Authorization header:

You can get your API key from the /companies page.

Authorization: Bearer YOUR_API_KEY

๐Ÿ“ฅ Request

๐Ÿ”ธ Path Parameters

ParameterTypeRequiredDescription
idstringโœ… YesWeb WhatsApp Channel ID

๐Ÿ”ธ Body Parameters

ParameterTypeRequiredDescription
phone_numberstringโœ… YesRecipient's phone number (international format)
recipient_typestringโœ… YesEither "number" or "group"
typestringโœ… YesType of message: text, image, video, audio, document
messagestringโœ… For textMessage content (text only)
linkstringโœ… For mediaPublic URL to the media file
captionstringOptionalMedia caption (for image/video/document)

๐Ÿงช Example Requests

curl -X POST https://smart.botatende.com/api/v1/web-whatsapp/57/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "254712XXXXXX",
    "recipient_type": "number",
    "type": "text",
    "message": "Hello from Web WhatsApp"
  }'
curl --location 'https://smart.botatende.com/api/v1/web-whatsapp/57/messages' \
 -H "Authorization: Bearer YOUR_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{
    "phone_number": "254712XXXXXX",
    "recipient_type": "number",
    "type": "audio",
    "message": "Hello",
    "caption": "Caption",
    "link": "https://botatende-bulk-message.nyc3.digitaloceanspaces.com/customer/messages/attachments/bdf4504d-6fa5-4d3b-a826-13464d722a3f-cenaza-4.mp3.opus"
}'

๐Ÿ“ค Response

โœ… Success (200)

Example (Text Message)

{
  "message": "Message sent successfully",
  "data": [
    {
      "index": 0,
      "result": {
        "key": {
          "remoteJid": "254712XXXXXX@s.whatsapp.net",
          "fromMe": true,
          "id": "3EB04AB1CAAB22C9F6BF04"
        },
        "message": {
          "extendedTextMessage": {
            "text": "Hello"
          }
        },
        "messageTimestamp": "1750913718",
        "status": "PENDING"
      }
    }
  ]
}

Example (Audio Message)

{
  "message": "Message sent successfully",
  "data": [
    {
      "index": 0,
      "result": {
        "key": {
          "remoteJid": "254712XXXXXX@s.whatsapp.net",
          "fromMe": true,
          "id": "3EB0A1B6AACA12B67CACE6"
        },
        "message": {
          "audioMessage": {
            "url": "https://mmg.whatsapp.net/...",
            "mimetype": "audio/ogg; codecs=opus",
            "fileLength": "267445",
            "seconds": 31,
            "ptt": true
          }
        },
        "messageTimestamp": "1750914095",
        "status": "PENDING"
      }
    }
  ]
}

โŒ Error Responses

Invalid Channel ID

{ "error": "Invalid request", "code": "invalid_id_param" }

Missing Required Fields

{ "error": "type is required", "code": "missing_type" }

Channel Not Found

{ "message": "Unknown Channel" }

Internal Error

{
  "message": "Something went wrong. Our team has been notified and will look into this shortly"
}