Messages

Send a text message

POST/messages/textScope messages:send

Sends a free-form text reply. Only works while the person's 24-hour window is open, meaning they messaged you in the last 24 hours. Otherwise send a template.

Body

  • tostringrequired

    Recipient phone number with country code, for example +919876543210. Spaces and dashes are ignored. A number without a country code is not guessed at and will not reach anyone.

  • fromstring

    Which of your WhatsApp numbers to send from. Accepts the number itself, its Meta phone_number_id or its Wamafy id. Defaults to your default number.

  • textstringrequired

    The message. Up to 4,096 characters.

Errors

StatusCodeWhen
400NO_OPEN_CONVERSATIONThe window is closed or the person never messaged you. Send a template instead.

Plus the errors any endpoint can return, such as a missing key or scope. See Errors.

# macOS, Linux or Git Bash, with WAMAFY_API_KEY set. The quoting does not work in Windows cmd or PowerShell.
curl -X POST "https://api.wamafy.com/api/v1/public/messages/text" \
  -H "Authorization: Bearer $WAMAFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+919876543210",
  "text": "Yes, the blue one is in stock. Shall I keep it aside for you?"
}'
Response 200
{
  "success": true,
  "data": {
    "messageId": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSRjI",
    "conversationId": "2b7e4f10-8c3a-4d2e-b1f6-0a9c5e7d3b21",
    "status": "sent"
  }
}

Base URL https://api.wamafy.com/api/v1/public

    Send a text message - Wamafy API