Skip to main content

Get an SMS Message

Agent Skill

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

npx skills add 2ChatCo/agent-skills -s 2chat-sms

Get a single SMS message by its UUID. Inbound messages are prefixed SMI, outbound messages SMO. Returns 404 for a message that doesn't exist or doesn't belong to your account.

Endpoint

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

Authentication

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

Path parameters

ParameterDescriptionExample
message_uuidThe UUID of the SMS message. Inbound is prefixed SMI, outbound SMOSMI4f2a1c33-7b6e-4d9a-8c12-9f0e1a2b3c4d

Invocation

curl -L -G 'https://api.p.2chat.io/open/sms/message/SMI4f2a1c33-7b6e-4d9a-8c12-9f0e1a2b3c4d' \
--header 'X-User-API-Key: your_api_key_here'

Response

The fields returned depend on whether the message is inbound (SMI…) or outbound (SMO…).

Success — inbound message (HTTP 200 OK)

{
"success": true,
"message": {
"uuid": "SMI4f2a1c33-7b6e-4d9a-8c12-9f0e1a2b3c4d",
"destination": "+13057654321",
"source": "+447700900123",
"text": "Hi, is my order ready?",
"direction": "inbound",
"price": 0.0,
"voip_number_setup_id": 42,
"created_at": "2026-06-20T10:58:02Z",
"updated_at": "2026-06-20T10:58:02Z"
}
}

Success — outbound message (HTTP 200 OK)

{
"success": true,
"message": {
"uuid": "SMOe8b1d572-6a4c-4f93-8d20-1c7b5e0a9f64",
"destination": "+447700900123",
"source": "+13057654321",
"text": "Yes! It ships today.",
"fragments": 1,
"direction": "outbound",
"price": 0.0075,
"voip_number_setup_id": 42,
"created_at": "2026-06-20T11:01:30Z",
"updated_at": "2026-06-20T11:01:30Z"
}
}
FieldDescriptionExample
uuidUnique identifier of the message. Inbound is prefixed SMI, outbound SMOSMI4f2a1c33-7b6e-4d9a-8c12-9f0e1a2b3c4d
destinationRecipient phone number in E.164 format+13057654321
sourceSender phone number in E.164 format+447700900123
textThe message contentHi, is my order ready?
directioninbound (received) or outbound (sent)inbound
fragmentsNumber of SMS segments (outbound messages only)1
priceThe amount billed to you for the message, in USD0.0075
voip_number_setup_idInternal identifier of the underlying virtual number setup42
created_atWhen the message was created (UTC)2026-06-20T10:58:02Z
updated_atWhen the message was last updated (UTC)2026-06-20T10:58:02Z

Error

A message that doesn't exist or doesn't belong to your account returns 404 Not Found.

{
"error": true,
"error_message": "SMS message not found: SMI4f2a1c33-7b6e-4d9a-8c12-9f0e1a2b3c4d"
}
FieldDescription
errortrue when the request failed
error_messageA description of what went wrong