Skip to main content
POST
/
api
/
whatsapp-web-send-message
cURL
curl --request POST \
  --url https://www.wassly.com/api/whatsapp-web-send-message \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --header 'apikey: <api-key>' \
  --form 'message=<string>' \
  --form 'instance_id=<string>' \
  --form 'contact_mobile_number=<string>' \
  --form 'contact_name=<string>' \
  --form document='@example-file' \
  --form media='@example-file'
{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "message_type": "media",
    "conversation_id": 2,
    "remaining_conversations": 40969
  }
}

Overview

This endpoint sends a WhatsApp message to a specified contact using the Wassly API. It allows you to send text messages through a connected WhatsApp Web instance.

Authentication

This endpoint requires API key authentication via the request header. Required Header:
  • apikey: Your Wassly API key (use {apikey} variable)
  • Autherizaion: Bearer token: The token been generated from the login API (required)

Request Parameters

Form-Data Body Parameters

ParameterTypeRequiredDescription
messagestringNoThe text message content to send to the recipient, Required only when you wont send a document or a media
instance_idstringYesThe unique identifier of your WhatsApp instance. This ID is obtained when you create a WhatsApp instance
contact_mobile_numberstringYesThe recipient’s phone number in international format (e.g., +country_codemobile_number). Must include country code with + prefix
contact_namestringNoOptional display name for the contact
documentfileNoOptional when you want to send a document
mediafileNoOptional when you want to image, video or audio

Example Usage

POST {{baseUrl}}/api/whatsapp-web-send-message
Headers:
  apikey: {{apikey}}
Body (form-data):
  message: ""
  instance_id: "Obtained from List Devices API"
  contact_mobile_number: "+"
  contact_name: ""

Response

Upon successful message delivery, the API will return a confirmation response with the message status and details.

Notes

  • Ensure your WhatsApp instance is connected and active before sending messages
  • Phone numbers must be in international format with country code
  • The instance must have an active WhatsApp Web session

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

apikey
string
header
required

Body

multipart/form-data
message
string
instance_id
string
contact_mobile_number
string
contact_name
string
document
file

Pass this as a file to send a document to the customer

media
file

Pass this as a file to send an image, video or audo to the customer

Response

200 - application/json

OK

success
boolean
required
message
string
required
data
object
required