message

send a text message to a chat

Send a text message to a chat. The chatId format varies depending on the chat type:

  • Individual chat: {phone_number}@c.us (e.g. 50664083362@c.us)
  • Group chat: {group_id}@g.us (e.g. 123456789-123456789@g.us)
  • Channel/Newsletter: {channel_id}@newsletter (e.g. 123456789@newsletter)
post/instances/{id}/client/action/send-message

Request

  • Base URL: https://waapi.app/api/v1
  • URL: https://waapi.app/api/v1/instances/{id}/client/action/send-message
  • Auth: HTTP bearer

Path parameters

idinteger required

Instance ID

Request body

chatIdstring required

Chat ID <countrycode_short><usernumber>@c.us or @g.us for groups

messagestring required

Text message to send. Can include @123456789 for group chats.

mentionsstring[]

Optional array of contact IDs to mention. Only works in group chats. Make sure to include @123456789 in the message text.

replyToMessageIdstring

Optional message ID to reply to. Format: {fromMe}{chatId}{messageId}

previewLinkboolean

Whether to show link previews in the message. Defaults to true.

firedandforgetboolean

Set to true to process the request asynchronously. Returns a reference UUID for polling via GET /instances/{id}/request/{reference}. Alias: faf

Example request

{
  "chatId": "50664083362@c.us",
  "message": "Hello @50664083362, how are you?",
  "mentions": [
    "50664083362@c.us"
  ],
  "replyToMessageId": "true_491234567890@c.us_3EB0123456789ABCDEF",
  "previewLink": true
}

Response

Request reached the instance. data.status reports whether the action was carried out; on error data carries message and explanation. Payload: Message sent successfully.

status'success' | 'error'

Whether the request reached the instance. success here does not mean the action was carried out — that is reported by data.status, which is the authoritative one. A malformed input arrives as status: success with data.status: error.

Example response

{
  "status": "success",
  "data": {
    "status": "success",
    "instanceId": "1",
    "data": {
      "_data": {
        "id": {
          "fromMe": true,
          "remote": "1234567890@c.us",
          "id": "3EB0123456789ABCDEF",
          "_serialized": "true_1234567890@c.us_3EB0123456789ABCDEF"
        },
        "body": "Hello @1234567890, how are you?",
        "type": "chat",
        "t": 1733207534,
        "from": {
          "server": "c.us",
          "user": "987654321",
          "_serialized": "987654321@c.us"
        },
        "to": {
          "server": "c.us",
          "user": "1234567890",
          "_serialized": "1234567890@c.us"
        },
        "ack": 0
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.