Incoming Message

This event is triggered when a new message is received by your WhatsApp instance.

Best practices

  • Always check 'fromMe' before processing a message to avoid responding to your own bot's messages.

  • Check 'hasMedia' before attempting to download or process the 'media' object.

  • Use the 'source' field to identify if a message was sent via the API or manually via the phone.

Expected Responses

Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.

Webhook Payload Example
application/json
string *
number *
string *
object *
string *
string *
object *
object *

Example

{
"id": "evt_01aaaaaaaaaaaaaaaaaaaaaaaa",
"timestamp": 1634567890123,
"session": "default",
"metadata": {
  "user.id": "123",
  "user.email": "email@example.com"
  },
"engine": "WEBJS",
"event": "message",
"payload": {
  "id": "false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA",
  "timestamp": 1666943582,
  "from": "11111111111@c.us",
  "fromMe": true,
  "source": "api",
  "to": "11111111111@c.us",
  "participant": null,
  "body": "Hello, world!",
  "hasMedia": true,
  "media": {
    "url": "https://api.wawp.net/api/files/example.oga",
    "mimetype": "audio/ogg",
    "filename": "example.oga",
    "s3": {
      "Bucket": "my-bucket",
      "Key": "default/example.oga"
      },
    "error": null
    },
  "ack": -1,
  "ackName": "PENDING",
  "author": "11111111111@c.us",
  "location": {
    "description": "London, UK",
    "latitude": "51.5074",
    "longitude": "0.1278"
    },
  "vCards": {
    "0": "BEGIN:VCARD..."
    },
  "_data": {
    },
  "replyTo": {
    "id": "AAAAAAAAAAAAAAAAAAAA",
    "participant": "11111111111@c.us",
    "body": "Hello!",
    "_data": {
      }
    }
  },
"me": {
  "id": "11111111111@c.us",
  "lid": "123123@lid",
  "pushName": "Wawp Instance"
  }
}

Command Palette

Search for a command to run...