POST /chats/{chat_jid}/messages

Send a text message to a chat or group

Path parameters

  • chat_jid string Required
application/json

Body Required

  • text string Required
  • reply_to_message_id string

    Message ID to reply to

  • typing_simulation boolean

    Override typing simulation for this message (default: enabled)

  • presence_simulation boolean

    Override presence wrapping for this message (default: enabled)

Responses

  • 200 application/json

    Message sent successfully

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • message_id string
      • status string
      • timestamp integer
  • 400 application/json

    Bad request

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
POST /chats/{chat_jid}/messages
curl \
 --request POST 'http://localhost:7001/chats/6281234567890@s.whatsapp.net/messages' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"text":"Hello, World!","reply_to_message_id":"string","typing_simulation":true,"presence_simulation":true}'
Request examples
{
  "text": "Hello, World!",
  "reply_to_message_id": "string",
  "typing_simulation": true,
  "presence_simulation": true
}
Response examples (200)
{
  "code": 200,
  "data": {
    "status": "sent",
    "timestamp": 1702129024,
    "message_id": "3EB0ABC123DEF456789"
  },
  "status": true,
  "message": "Message sent successfully"
}
Response examples (200)
{
  "status": true,
  "code": 200,
  "message": "Message sent successfully",
  "data": {
    "message_id": "3EB0ABC123DEF456789",
    "status": "sent",
    "timestamp": 1702129024
  }
}
Response examples (400)
{
  "code": 400,
  "error": "Text field is required",
  "status": false,
  "message": "Bad request"
}
Response examples (400)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}
Response examples (401)
{
  "code": 401,
  "error": "Invalid or expired JWT token",
  "status": false,
  "message": "Unauthorized"
}
Response examples (401)
{
  "status": false,
  "code": 401,
  "message": "Unauthorized",
  "error": "Invalid or missing authentication"
}
Response examples (500)
{
  "code": 500,
  "error": "Failed to send message",
  "status": false,
  "message": "Internal server error"
}
Response examples (500)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}