Skip to main content

messages.sent event

messages.sent fires only for messages sent through the D-API API (/messages/send/* and /interactive/send/*). Messages sent from the phone itself or from other devices linked to the same number do not trigger messages.sent — they arrive in messages.received with fromMe: true.
Use this event to confirm that a message fired through the API was sent successfully and to record the final content delivered to WhatsApp.
The payload has exactly the same structure as the messages.received event for the same type (same fields, media_data with file_length/mimetype, context_info, etc.), just with fromMe: true and isMetaAI: false. For the full reference of all fields, see the messages.received page.
The difference is in the roles: from is your number (the session) and to is the recipient.
When media is sent by external URL, the payload may include pending_media_url (the original URL provided in the request) inside media_data. Also, the message id may come in uppercase.

Examples by type


Other sendable types

The types below can also be sent through the API. The exact messages.sent payload format for these types is not documented here to avoid incorrect examples — when sent, the webhook follows the same structure as the corresponding messages.received, with fromMe: true.
Polls (poll) are reported in messages.received as poll_update (votes). An album sends multiple media items and may trigger more than one individual media event (image/video). Confirm the format in a test environment before handling these types in production.

Sending endpoints

Each sendable type maps to an API endpoint:
Avoid using messages.sent to trigger auto-reply automations. Since it confirms messages that you yourself sent through the API, treating it as a reply trigger can cause loops.