Skip to main content

Get a specific WABA message

Agent Skill

Automate this endpoint with an AI agent using the 2chat-whatsapp-waba skill:

npx skills add 2ChatCo/agent-skills -s 2chat-whatsapp-waba

This endpoint returns a single message you sent or received on a WhatsApp Business API number, identified by its UUID within the conversation it belongs to.

Endpointโ€‹

GET https://api.p.2chat.io/open/waba/message/{session_key}/{message_uuid}

Authenticationโ€‹

Include your API key in the X-User-API-Key header. Learn more about authentication.

API costโ€‹

1API credit

Each call to this endpoint deducts 1 API credit from your plan's API credit pool.

Parametersโ€‹

ParameterInRequiredDescription
session_keypathYesThe conversation the message belongs to (e.g. WA-WAN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432)
message_uuidpathYesThe UUID of the message (e.g. MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485)
include_errorqueryNoSet to true to add waba_event to the message: the last delivery status WhatsApp reported and, if the message failed, the reason. Defaults to false

Both values come back on every message returned by Get Messages, on every outbound webhook, and in the reply to Send Message โ€” store them if you plan to look a message up later.

Why a message failedโ€‹

error: true tells you that a message was not sent, but not why. Add include_error=true to get the reason WhatsApp gave, without subscribing to the Message Failed webhook:

GET https://api.p.2chat.io/open/waba/message/{session_key}/{message_uuid}?include_error=true

The message then carries waba_event, with WhatsApp's error code and 2Chat's label and category for it. See Failed message below. Without include_error, the response doesn't change.

Invocationโ€‹

curl --location --request GET 'https://api.p.2chat.io/open/waba/message/WA-WAN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432/MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485' \
--header 'X-User-API-Key: your_api_key_here'

Responseโ€‹

Success (HTTP 200 OK)โ€‹

{
"success": true,
"message": {
"id": "MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485",
"uuid": "MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485",
"session_key": "WA-WAN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432",
"message": {
"text": "hi, do you have this in stock?"
},
"created_at": "2026-09-20T14:03:11",
"remote_phone_number": "+5215512345432",
"sent_by": "user",
"is_from_flow_run": false,
"is_from_api": false,
"is_from_chatter": true,
"is_from_agent": false,
"wa_msg_id": "wamid.HBgMNTIxNTUxMjM0NTQzMhUCABIYFjNBOEFFMEJFREE5N0UyRjk5NTU3AA==",
"wa_msg_ack": 3,
"processed": true,
"error": false,
"sent": true,
"received": true,
"read": true
}
}
FieldDescription
idThe unique identifier of the message
uuidSame as id
session_keyThe conversation the message belongs to
message.textThe text content of the message, when present
message.media.urlThe 2Chat-hosted media file URL, when the message carries media
message.media.typeThe type of media
message.media.mime_typeThe MIME type of the media
created_atWhen the message was sent, UTC
remote_phone_numberThe contact's phone number
sent_byWho sent it: user (the contact), agent, or api
is_from_flow_runtrue if the message was sent by a flow reply
is_from_apitrue if the message was sent through 2Chat's API
is_from_chattertrue if the contact sent it
is_from_agenttrue if you or one of your agents sent it
wa_msg_idThe id WhatsApp assigned to the message on their network
wa_msg_ack0: created, 1: sent, 2: delivered, 3: read, -1: not sent
processedtrue once WhatsApp has acknowledged the message
errortrue if WhatsApp reported the message as not sent
senttrue if the message was sent
receivedtrue if the recipient received it
readtrue if the recipient read it, and has read receipts enabled

The delivery fields (processed, error, sent, received, read) are only present once WhatsApp has reported a status for the message.

Failed messageโ€‹

With include_error=true, a message WhatsApp reported a status for also carries waba_event. In this example, a marketing template was not delivered because the contact's number is part of a WhatsApp experiment (130472):

{
"success": true,
"message": {
"id": "MSG3c1e5a7b-92d4-4f0e-b6a8-1d7e9c2f4a60",
"uuid": "MSG3c1e5a7b-92d4-4f0e-b6a8-1d7e9c2f4a60",
"session_key": "WA-WAN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432",
"message": {
"text": "Hi Ana, your order #4821 is ready for pickup."
},
"created_at": "2026-09-21T10:12:05",
"remote_phone_number": "+5215512345432",
"sent_by": "api",
"sent": false,
"received": false,
"read": false,
"is_from_flow_run": false,
"is_from_api": true,
"is_from_chatter": false,
"is_from_agent": false,
"wa_msg_id": "wamid.HBgMNTIxNTUxMjM0NTQzMhUCABEYEjdGMkE5QzQxRDhCMzA2RTFBNwA=",
"wa_msg_ack": -1,
"processed": true,
"error": true,
"waba_event": {
"message_uuid": "MSG3c1e5a7b-92d4-4f0e-b6a8-1d7e9c2f4a60",
"status": 4,
"description": "[{\"code\": 130472, \"title\": \"User's number is part of an experiment\", \"message\": \"User's number is part of an experiment\", \"error_data\": {\"details\": \"Failed to send message because this user's phone number is part of an experiment\"}, \"href\": \"https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes/\"}]",
"errors": [
{
"code": 130472,
"title": "User's number is part of an experiment",
"message": "User's number is part of an experiment",
"error_data": {
"details": "Failed to send message because this user's phone number is part of an experiment"
},
"href": "https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes/",
"label": "User in experiment",
"category": "experiment"
}
],
"created_at": "2026-09-21T10:12:05Z",
"updated_at": "2026-09-21T10:12:07Z"
}
}
}
FieldDescription
waba_event.statusThe last status WhatsApp reported: 1 sent, 2 delivered, 3 read, 4 failed (WhatsApp rejected the message), 5 error (the message never reached WhatsApp, for example because you ran out of API credits)
waba_event.errorsWhy the message failed, one entry per error. null when nothing failed
waba_event.errors[].codeWhatsApp's error code. See WhatsApp's error codes
waba_event.errors[].titleWhatsApp's description of the error
waba_event.errors[].messageWhatsApp's error message, usually the same as title
waba_event.errors[].error_data.detailsWhatsApp's longer explanation, when it sends one
waba_event.errors[].hrefA link to WhatsApp's documentation of the error, when it sends one
waba_event.errors[].label2Chat's short name for the error (e.g. User in experiment). Unknown error (<code>) for codes 2Chat doesn't classify yet
waba_event.errors[].category2Chat's group for the error: transient, rate_limit, template, window, delivery, marketing_limit, opt_out, experiment, media, account or registration. null for codes 2Chat doesn't classify yet
waba_event.descriptionThe same errors as a JSON string, as they were stored. For some older failures errors is null and this is the only field with the reason
waba_event.message_uuidThe message the event belongs to
waba_event.created_atWhen the event was recorded, UTC
waba_event.updated_atWhen the event was last updated, UTC

There is no waba_event if you leave out include_error, or if WhatsApp hasn't reported a status for the message yet.

Errorโ€‹

{
"error": true,
"error_message": "Chat session not found"
}
HTTPWhen
404The conversation is not yours, is not a WABA conversation, or holds no message with that UUID
422message_uuid is not a well-formed MSGโ€ฆ identifier, or include_error is not true or false