HostMentor Docs

Send a message

POST/{phone_number_id}/messages

Sends one message to one customer. Pick the kind of message in the example list on the right; every example is a complete request you can copy.

  • Outside the 24-hour window, only template messages are allowed.
  • To quote an earlier message, add context.message_id.
  • To mark an incoming message as read, send "status": "read" and its message_id instead of a message. The response is then { "success": true }.

Authorization

apiKey
apikey<token>

Your HostMentor API key, from the dashboard under Messaging → WhatsApp → API keys.

In: header

Path Parameters

phone_number_id*string

ID of your WhatsApp number, from the dashboard or List your phone numbers. It isn't the phone number itself.

Request Body

application/json

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://wa.hostmentor.com/v3/106540352242922/messages" \  -H "apikey: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "messaging_product": "whatsapp",    "to": "919876543210",    "type": "text",    "text": {      "body": "Your order #1042 has shipped. Track it at https://example.com/t/1042",      "preview_url": true    }  }'

{  "messaging_product": "whatsapp",  "contacts": [    {      "input": "919876543210",      "wa_id": "919876543210"    }  ],  "messages": [    {      "id": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSNzM0QkY3RURGMzhDQ0M1ODAA"    }  ]}