Get a specific WABA message
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โ
Each call to this endpoint deducts 1 API credit from your plan's API credit pool.
Parametersโ
| Parameter | In | Required | Description |
|---|---|---|---|
session_key | path | Yes | The conversation the message belongs to (e.g. WA-WAN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432) |
message_uuid | path | Yes | The UUID of the message (e.g. MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485) |
include_error | query | No | Set 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
- Python
- JavaScript
- PHP
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'
import requests
session_key = "WA-WAN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432"
message_uuid = "MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485"
url = f"https://api.p.2chat.io/open/waba/message/{session_key}/{message_uuid}"
headers = {
"X-User-API-Key": "your_api_key_here"
}
response = requests.get(url, headers=headers)
print(response.json())
const axios = require('axios');
const sessionKey = 'WA-WAN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432';
const messageUuid = 'MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485';
const response = await axios.get(`https://api.p.2chat.io/open/waba/message/${sessionKey}/${messageUuid}`, {
headers: {
'X-User-API-Key': 'your_api_key_here'
}
});
console.log(response.data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.p.2chat.io/open/waba/message/WA-WAN95841312-b54d-46e3-b0bc-6414f4a5296b-5215512345432/MSGaf1fa3a1-0d8d-4aa5-b117-f9425b651485',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-User-API-Key: your_api_key_here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
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
}
}
| Field | Description |
|---|---|
id | The unique identifier of the message |
uuid | Same as id |
session_key | The conversation the message belongs to |
message.text | The text content of the message, when present |
message.media.url | The 2Chat-hosted media file URL, when the message carries media |
message.media.type | The type of media |
message.media.mime_type | The MIME type of the media |
created_at | When the message was sent, UTC |
remote_phone_number | The contact's phone number |
sent_by | Who sent it: user (the contact), agent, or api |
is_from_flow_run | true if the message was sent by a flow reply |
is_from_api | true if the message was sent through 2Chat's API |
is_from_chatter | true if the contact sent it |
is_from_agent | true if you or one of your agents sent it |
wa_msg_id | The id WhatsApp assigned to the message on their network |
wa_msg_ack | 0: created, 1: sent, 2: delivered, 3: read, -1: not sent |
processed | true once WhatsApp has acknowledged the message |
error | true if WhatsApp reported the message as not sent |
sent | true if the message was sent |
received | true if the recipient received it |
read | true 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"
}
}
}
| Field | Description |
|---|---|
waba_event.status | The 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.errors | Why the message failed, one entry per error. null when nothing failed |
waba_event.errors[].code | WhatsApp's error code. See WhatsApp's error codes |
waba_event.errors[].title | WhatsApp's description of the error |
waba_event.errors[].message | WhatsApp's error message, usually the same as title |
waba_event.errors[].error_data.details | WhatsApp's longer explanation, when it sends one |
waba_event.errors[].href | A link to WhatsApp's documentation of the error, when it sends one |
waba_event.errors[].label | 2Chat's short name for the error (e.g. User in experiment). Unknown error (<code>) for codes 2Chat doesn't classify yet |
waba_event.errors[].category | 2Chat'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.description | The 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_uuid | The message the event belongs to |
waba_event.created_at | When the event was recorded, UTC |
waba_event.updated_at | When 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"
}
| HTTP | When |
|---|---|
404 | The conversation is not yours, is not a WABA conversation, or holds no message with that UUID |
422 | message_uuid is not a well-formed MSGโฆ identifier, or include_error is not true or false |