curl -X POST https://api.magpipe.ai/functions/v1/get-message \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message_id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-message',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
message_id: '8e4f9a00-c3d4-6e5f-1a2b-890123cdef01'
}),
}
);
const message = await response.json();
console.log('Status:', message.status);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-message',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'message_id': '8e4f9a00-c3d4-6e5f-1a2b-890123cdef01'}
)
message = response.json()
print(f"Status: {message['status']}")
{
"id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01",
"contact_id": "3a1b2c00-d4e5-6f7a-8b9c-012345abcdef",
"thread_id": "a17b4735-15d2-5274-9460-74f8554172cb",
"from_number": "+16045551234",
"to_number": "+14155551234",
"body": "Your appointment is confirmed for tomorrow at 2pm.",
"direction": "outbound",
"status": "delivered",
"is_ai_generated": false,
"sent_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-15T10:30:00Z",
"message_sid": "SM1234567890abcdef",
"delivered_at": "2024-01-15T10:30:02Z",
"sentiment": null,
"agent_id": null,
"translation": null,
"media": [],
"delivery_error": null
}
{
"id": "b40266e5-da45-4a86-9793-e256e231bf77",
"contact_id": null,
"thread_id": "a17b4735-15d2-5274-9460-74f8554172cb",
"from_number": "17789984118",
"to_number": "1059545750567735",
"body": "Scheduling Paul from Lonsdale Electric next week to review the plans.",
"direction": "inbound",
"status": "delivered",
"is_ai_generated": false,
"sent_at": "2026-06-16T17:16:09Z",
"created_at": "2026-06-16T17:16:17Z",
"message_sid": null,
"delivered_at": null,
"sentiment": null,
"agent_id": "2af715f7-c995-4fd5-9f2b-bdb28d5a8c3a",
"translation": null,
"media": [
{
"url": "https://<project>.supabase.co/storage/v1/object/sign/whatsapp-media/inbound/...",
"mime_type": "audio/ogg",
"kind": "audio",
"caption": null
}
],
"delivery_error": null
}
{
"id": "8d626ef9-575f-4497-a725-01f91adbcd8e",
"thread_id": "c91a7e02-4f8b-5d6c-8e0a-1b2c3d4e5f60",
"from_number": "1059545750567735",
"to_number": "+16045628647",
"body": "Hi {{1}}, time for your daily site report.",
"direction": "outbound",
"status": "failed",
"is_ai_generated": false,
"sent_at": "2026-06-10T18:30:18Z",
"created_at": "2026-06-10T18:30:18Z",
"message_sid": null,
"delivered_at": null,
"sentiment": null,
"agent_id": "2af715f7-c995-4fd5-9f2b-bdb28d5a8c3a",
"translation": null,
"media": [],
"delivery_error": {
"code": "131042",
"reason": "Business eligibility payment issue",
"at": "2026-06-10T18:30:26Z"
}
}
Messages
Get Message
Retrieve details of a specific SMS message
POST
/
get-message
curl -X POST https://api.magpipe.ai/functions/v1/get-message \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message_id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-message',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
message_id: '8e4f9a00-c3d4-6e5f-1a2b-890123cdef01'
}),
}
);
const message = await response.json();
console.log('Status:', message.status);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-message',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'message_id': '8e4f9a00-c3d4-6e5f-1a2b-890123cdef01'}
)
message = response.json()
print(f"Status: {message['status']}")
{
"id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01",
"contact_id": "3a1b2c00-d4e5-6f7a-8b9c-012345abcdef",
"thread_id": "a17b4735-15d2-5274-9460-74f8554172cb",
"from_number": "+16045551234",
"to_number": "+14155551234",
"body": "Your appointment is confirmed for tomorrow at 2pm.",
"direction": "outbound",
"status": "delivered",
"is_ai_generated": false,
"sent_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-15T10:30:00Z",
"message_sid": "SM1234567890abcdef",
"delivered_at": "2024-01-15T10:30:02Z",
"sentiment": null,
"agent_id": null,
"translation": null,
"media": [],
"delivery_error": null
}
{
"id": "b40266e5-da45-4a86-9793-e256e231bf77",
"contact_id": null,
"thread_id": "a17b4735-15d2-5274-9460-74f8554172cb",
"from_number": "17789984118",
"to_number": "1059545750567735",
"body": "Scheduling Paul from Lonsdale Electric next week to review the plans.",
"direction": "inbound",
"status": "delivered",
"is_ai_generated": false,
"sent_at": "2026-06-16T17:16:09Z",
"created_at": "2026-06-16T17:16:17Z",
"message_sid": null,
"delivered_at": null,
"sentiment": null,
"agent_id": "2af715f7-c995-4fd5-9f2b-bdb28d5a8c3a",
"translation": null,
"media": [
{
"url": "https://<project>.supabase.co/storage/v1/object/sign/whatsapp-media/inbound/...",
"mime_type": "audio/ogg",
"kind": "audio",
"caption": null
}
],
"delivery_error": null
}
{
"id": "8d626ef9-575f-4497-a725-01f91adbcd8e",
"thread_id": "c91a7e02-4f8b-5d6c-8e0a-1b2c3d4e5f60",
"from_number": "1059545750567735",
"to_number": "+16045628647",
"body": "Hi {{1}}, time for your daily site report.",
"direction": "outbound",
"status": "failed",
"is_ai_generated": false,
"sent_at": "2026-06-10T18:30:18Z",
"created_at": "2026-06-10T18:30:18Z",
"message_sid": null,
"delivered_at": null,
"sentiment": null,
"agent_id": "2af715f7-c995-4fd5-9f2b-bdb28d5a8c3a",
"translation": null,
"media": [],
"delivery_error": {
"code": "131042",
"reason": "Business eligibility payment issue",
"at": "2026-06-10T18:30:26Z"
}
}
Get detailed information about a message, including its delivery status.
Request Body
string
required
The unique identifier of the message to retrieve.
Response
string
Unique message identifier.
string
Associated contact identifier, or
null.string
Stable identifier for the conversation this message belongs to. Deterministic — every inbound and outbound message between the same contact and service number shares the same
thread_id, regardless of direction or phone-number formatting. Use it to group messages into threads.string
The sending phone number.
string
The recipient phone number.
string
The message content.
string
Either
inbound or outbound.string
Message status:
pending, sent, delivered, undelivered, or failed.boolean
Whether this message was generated by the AI agent.
string
ISO 8601 timestamp when the message was sent.
string
ISO 8601 timestamp when the message was created.
string
Carrier message SID for tracking, or
null.string
ISO 8601 timestamp when delivery was confirmed, or
null.string
Detected sentiment:
positive, neutral, negative, or null.string
Agent that generated the message, or
null.string
Translated message content, or
null.array
Attachments on the message (inbound WhatsApp photos, voice notes, video, documents). Empty array when there are none. Each URL is freshly signed on every request and valid for 24 hours — re-fetch the message to get a new link rather than persisting the URL.
Show media item properties
Show media item properties
object
Present (non-
null) only when status is failed or undelivered. Explains why the provider rejected delivery — works for both WhatsApp (Meta) and SMS (SignalWire).Show delivery_error properties
Show delivery_error properties
curl -X POST https://api.magpipe.ai/functions/v1/get-message \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message_id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01"}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/get-message',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
message_id: '8e4f9a00-c3d4-6e5f-1a2b-890123cdef01'
}),
}
);
const message = await response.json();
console.log('Status:', message.status);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/get-message',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={'message_id': '8e4f9a00-c3d4-6e5f-1a2b-890123cdef01'}
)
message = response.json()
print(f"Status: {message['status']}")
{
"id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01",
"contact_id": "3a1b2c00-d4e5-6f7a-8b9c-012345abcdef",
"thread_id": "a17b4735-15d2-5274-9460-74f8554172cb",
"from_number": "+16045551234",
"to_number": "+14155551234",
"body": "Your appointment is confirmed for tomorrow at 2pm.",
"direction": "outbound",
"status": "delivered",
"is_ai_generated": false,
"sent_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-15T10:30:00Z",
"message_sid": "SM1234567890abcdef",
"delivered_at": "2024-01-15T10:30:02Z",
"sentiment": null,
"agent_id": null,
"translation": null,
"media": [],
"delivery_error": null
}
{
"id": "b40266e5-da45-4a86-9793-e256e231bf77",
"contact_id": null,
"thread_id": "a17b4735-15d2-5274-9460-74f8554172cb",
"from_number": "17789984118",
"to_number": "1059545750567735",
"body": "Scheduling Paul from Lonsdale Electric next week to review the plans.",
"direction": "inbound",
"status": "delivered",
"is_ai_generated": false,
"sent_at": "2026-06-16T17:16:09Z",
"created_at": "2026-06-16T17:16:17Z",
"message_sid": null,
"delivered_at": null,
"sentiment": null,
"agent_id": "2af715f7-c995-4fd5-9f2b-bdb28d5a8c3a",
"translation": null,
"media": [
{
"url": "https://<project>.supabase.co/storage/v1/object/sign/whatsapp-media/inbound/...",
"mime_type": "audio/ogg",
"kind": "audio",
"caption": null
}
],
"delivery_error": null
}
{
"id": "8d626ef9-575f-4497-a725-01f91adbcd8e",
"thread_id": "c91a7e02-4f8b-5d6c-8e0a-1b2c3d4e5f60",
"from_number": "1059545750567735",
"to_number": "+16045628647",
"body": "Hi {{1}}, time for your daily site report.",
"direction": "outbound",
"status": "failed",
"is_ai_generated": false,
"sent_at": "2026-06-10T18:30:18Z",
"created_at": "2026-06-10T18:30:18Z",
"message_sid": null,
"delivered_at": null,
"sentiment": null,
"agent_id": "2af715f7-c995-4fd5-9f2b-bdb28d5a8c3a",
"translation": null,
"media": [],
"delivery_error": {
"code": "131042",
"reason": "Business eligibility payment issue",
"at": "2026-06-10T18:30:26Z"
}
}