import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const message = await commune.messages.get('49a3999c-0ce1-4ea6-ab68-e08a5c73e498');
console.log(message.data.thread_id); // thread_f47ac10b-58cc-4372-a567-0e02b2c3d479
console.log(message.data.direction); // inbound
from commune import CommuneClient
client = CommuneClient()
message = client.messages.get("49a3999c-0ce1-4ea6-ab68-e08a5c73e498")
print(message.data.thread_id)
print(message.data.direction)
get_message(id="49a3999c-0ce1-4ea6-ab68-e08a5c73e498")
curl "https://api.commune.email/v1/messages/49a3999c-0ce1-4ea6-ab68-e08a5c73e498" \
-H "Authorization: Bearer comm_..."
commune messages get 49a3999c-0ce1-4ea6-ab68-e08a5c73e498
{
"data": {
"channel": "email",
"message_id": "49a3999c-0ce1-4ea6-ab68-e08a5c73e498",
"thread_id": "thread_f47ac10b-58cc-4372-a567-0e02b2c3d479",
"direction": "inbound",
"participants": [
{ "role": "sender", "identity": "customer@example.com" },
{ "role": "to", "identity": "support@mycompany.com" }
],
"content": "Hi, I need help with my order.",
"content_html": "<p>Hi, I need help with my order.</p>",
"attachments": [],
"created_at": "2026-02-25T10:30:00.000Z",
"metadata": {
"created_at": "2026-02-25T10:30:00.000Z",
"subject": "Order help",
"inbox_id": "inbox_abc123",
"domain_id": "domain_xyz789",
"inbox_address": "support@mycompany.com",
"message_id": "<49a3999c-0ce1-4ea6-ab68-e08a5c73e498@resend.dev>",
"resend_id": "49a3999c-0ce1-4ea6-ab68-e08a5c73e498",
"in_reply_to": null,
"references": [],
"delivery_status": "delivered",
"delivery_data": {
"sent_at": "2026-02-25T10:30:00.000Z",
"delivered_at": "2026-02-25T10:30:05.000Z"
},
"has_attachments": false,
"attachment_count": 0,
"attachment_ids": [],
"spam_checked": true,
"spam_score": 0.02,
"spam_action": "accept",
"spam_flagged": false,
"spam_reasons": [],
"prompt_injection_checked": true,
"prompt_injection_detected": false,
"prompt_injection_risk": "none",
"prompt_injection_score": 0.01
}
}
}
{
"error": "Message not found"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
Messages
Get message
Retrieve a single message by its ID.
GET
/
v1
/
messages
/
:id
import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const message = await commune.messages.get('49a3999c-0ce1-4ea6-ab68-e08a5c73e498');
console.log(message.data.thread_id); // thread_f47ac10b-58cc-4372-a567-0e02b2c3d479
console.log(message.data.direction); // inbound
from commune import CommuneClient
client = CommuneClient()
message = client.messages.get("49a3999c-0ce1-4ea6-ab68-e08a5c73e498")
print(message.data.thread_id)
print(message.data.direction)
get_message(id="49a3999c-0ce1-4ea6-ab68-e08a5c73e498")
curl "https://api.commune.email/v1/messages/49a3999c-0ce1-4ea6-ab68-e08a5c73e498" \
-H "Authorization: Bearer comm_..."
commune messages get 49a3999c-0ce1-4ea6-ab68-e08a5c73e498
{
"data": {
"channel": "email",
"message_id": "49a3999c-0ce1-4ea6-ab68-e08a5c73e498",
"thread_id": "thread_f47ac10b-58cc-4372-a567-0e02b2c3d479",
"direction": "inbound",
"participants": [
{ "role": "sender", "identity": "customer@example.com" },
{ "role": "to", "identity": "support@mycompany.com" }
],
"content": "Hi, I need help with my order.",
"content_html": "<p>Hi, I need help with my order.</p>",
"attachments": [],
"created_at": "2026-02-25T10:30:00.000Z",
"metadata": {
"created_at": "2026-02-25T10:30:00.000Z",
"subject": "Order help",
"inbox_id": "inbox_abc123",
"domain_id": "domain_xyz789",
"inbox_address": "support@mycompany.com",
"message_id": "<49a3999c-0ce1-4ea6-ab68-e08a5c73e498@resend.dev>",
"resend_id": "49a3999c-0ce1-4ea6-ab68-e08a5c73e498",
"in_reply_to": null,
"references": [],
"delivery_status": "delivered",
"delivery_data": {
"sent_at": "2026-02-25T10:30:00.000Z",
"delivered_at": "2026-02-25T10:30:05.000Z"
},
"has_attachments": false,
"attachment_count": 0,
"attachment_ids": [],
"spam_checked": true,
"spam_score": 0.02,
"spam_action": "accept",
"spam_flagged": false,
"spam_reasons": [],
"prompt_injection_checked": true,
"prompt_injection_detected": false,
"prompt_injection_risk": "none",
"prompt_injection_score": 0.01
}
}
}
{
"error": "Message not found"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const message = await commune.messages.get('49a3999c-0ce1-4ea6-ab68-e08a5c73e498');
console.log(message.data.thread_id); // thread_f47ac10b-58cc-4372-a567-0e02b2c3d479
console.log(message.data.direction); // inbound
from commune import CommuneClient
client = CommuneClient()
message = client.messages.get("49a3999c-0ce1-4ea6-ab68-e08a5c73e498")
print(message.data.thread_id)
print(message.data.direction)
get_message(id="49a3999c-0ce1-4ea6-ab68-e08a5c73e498")
curl "https://api.commune.email/v1/messages/49a3999c-0ce1-4ea6-ab68-e08a5c73e498" \
-H "Authorization: Bearer comm_..."
commune messages get 49a3999c-0ce1-4ea6-ab68-e08a5c73e498
{
"data": {
"channel": "email",
"message_id": "49a3999c-0ce1-4ea6-ab68-e08a5c73e498",
"thread_id": "thread_f47ac10b-58cc-4372-a567-0e02b2c3d479",
"direction": "inbound",
"participants": [
{ "role": "sender", "identity": "customer@example.com" },
{ "role": "to", "identity": "support@mycompany.com" }
],
"content": "Hi, I need help with my order.",
"content_html": "<p>Hi, I need help with my order.</p>",
"attachments": [],
"created_at": "2026-02-25T10:30:00.000Z",
"metadata": {
"created_at": "2026-02-25T10:30:00.000Z",
"subject": "Order help",
"inbox_id": "inbox_abc123",
"domain_id": "domain_xyz789",
"inbox_address": "support@mycompany.com",
"message_id": "<49a3999c-0ce1-4ea6-ab68-e08a5c73e498@resend.dev>",
"resend_id": "49a3999c-0ce1-4ea6-ab68-e08a5c73e498",
"in_reply_to": null,
"references": [],
"delivery_status": "delivered",
"delivery_data": {
"sent_at": "2026-02-25T10:30:00.000Z",
"delivered_at": "2026-02-25T10:30:05.000Z"
},
"has_attachments": false,
"attachment_count": 0,
"attachment_ids": [],
"spam_checked": true,
"spam_score": 0.02,
"spam_action": "accept",
"spam_flagged": false,
"spam_reasons": [],
"prompt_injection_checked": true,
"prompt_injection_detected": false,
"prompt_injection_risk": "none",
"prompt_injection_score": 0.01
}
}
}
{
"error": "Message not found"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
Path Parameters
string
required
The message ID. This is the
message_id field returned by Send email or List messages.Response
object
Hide properties
Hide properties
string
Always
"email" for email messages.string
Unique message identifier.
string
Thread this message belongs to. Format:
thread_<uuid>.string
"inbound" for received messages, "outbound" for sent messages.object[]
string
Plain text body of the message.
string | null
HTML body of the message.
null if no HTML body was present.string[]
Array of attachment IDs associated with this message.
string
ISO 8601 timestamp when this message was created.
object
Show Metadata properties
Show Metadata properties
string
Email subject line.
string | null
ID of the inbox this message belongs to.
string | null
ID of the domain this message belongs to.
string | null
Full email address of the inbox.
string | null
Full RFC 5322 Message-ID as seen by the recipient. Format:
<id@resend.dev>.string | null
Plain Resend API message ID without angle brackets.
string | null
RFC 5322
In-Reply-To header from the original email. Present on reply messages.string[]
RFC 5322
References header values forming the thread chain.string
One of:
sent, delivered, bounced, failed, complained, suppressed, blocked, credit_limit.object
Show Delivery data properties
Show Delivery data properties
string
ISO 8601 timestamp of send event.
string
ISO 8601 timestamp of delivery confirmation.
string
ISO 8601 timestamp of bounce.
string
Human-readable bounce reason.
string
One of:
hard, soft.string
ISO 8601 timestamp of spam complaint.
string
ISO 8601 timestamp of failure.
string
Reason for delivery failure.
string
ISO 8601 timestamp of most recent delivery attempt.
boolean
true if this message has one or more attachments.number
Number of attachments on this message.
string[]
IDs of attachments linked to this message.
boolean
Whether spam analysis was performed.
number
Spam probability score between 0.0 (clean) and 1.0 (spam).
string
Action taken. One of:
accept, flag, reject.boolean
true if flagged as spam.string[]
Reasons this message was flagged, if applicable.
boolean
Whether prompt injection analysis ran on this message.
boolean
true if a prompt injection attempt was detected.string
Risk level. One of:
none, low, medium, high, critical.number
Rule-based injection score between 0.0 and 1.0.
string
Comma-separated rule signals that contributed to the score.
boolean
Whether a model-based check was also run (Business/Enterprise plans).
number
Combined rule + model score. Present when model checking is enabled.
object
Structured data fields extracted from the message when an extraction schema is configured on the inbox.
Structured extraction requires the Business plan or higher.
Last modified on March 19, 2026
Was this page helpful?

