Skip to main content
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"}'
{
  "id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01",
  "contact_id": "3a1b2c00-d4e5-6f7a-8b9c-012345abcdef",
  "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
}
Get detailed information about a message, including its delivery status.

Request Body

message_id
string
required
The unique identifier of the message to retrieve.

Response

id
string
Unique message identifier.
contact_id
string
Associated contact identifier, or null.
from_number
string
The sending phone number.
to_number
string
The recipient phone number.
body
string
The message content.
direction
string
Either inbound or outbound.
status
string
Message status: pending, sent, delivered, undelivered, or failed.
is_ai_generated
boolean
Whether this message was generated by the AI agent.
sent_at
string
ISO 8601 timestamp when the message was sent.
created_at
string
ISO 8601 timestamp when the message was created.
message_sid
string
Carrier message SID for tracking, or null.
delivered_at
string
ISO 8601 timestamp when delivery was confirmed, or null.
sentiment
string
Detected sentiment: positive, neutral, negative, or null.
agent_id
string
Agent that generated the message, or null.
translation
string
Translated message content, or null.
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"}'
{
  "id": "8e4f9a00-c3d4-6e5f-1a2b-890123cdef01",
  "contact_id": "3a1b2c00-d4e5-6f7a-8b9c-012345abcdef",
  "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
}