Receive Emails: Reading
Get Thread
Open a whole conversation: its summary and every message in chronological order, optionally with the bodies.
https://g.sendcorex.com/v1command: get_threadArguments
thread_idstringoptionalThe conversation id.
idstringoptionalThe id of any message in the conversation. Use this or
thread_id.include_bodybooleanoptionaltrueaddsbody(htmlandtext) to every message.
Quick start
import axios from 'axios';
const response = await axios.post(
'https://g.sendcorex.com/v1',
{
commands: [
{
command: "get_thread",
args: {
id: "Vj0xQUJDMTIz",
include_body: true
}
}
]
},
{ headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);
const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);Response
{
"type": "SUCCESS",
"results": [
{
"command": "get_thread",
"id": "0",
"type": "SUCCESS",
"data": {
"thread": {
"thread_id": "thr_9a1c4e72",
"subject": "Invoice for September",
"participants": [
"ana@client.com",
"you@yourdomain.com"
],
"last_senders": [
"ana@client.com"
],
"message_count": 2,
"unread_count": 1,
"folders": [
"INBOX",
"Sent"
]
},
"messages": [
{
"message_uid": "Vj0xQUJDMDA5",
"message_id": "<4c1d…@mail.client.com>",
"in_reply_to": null,
"parent_uid": null,
"depth": 0,
"folders": [
"INBOX"
],
"from_name": "Ana Costa",
"from_email": "ana@client.com",
"direction": "inbound",
"to": [
{
"email": "you@yourdomain.com"
}
],
"reply_to": [],
"subject": "Invoice for September",
"preview": "Hi, attached is the invoice for September…",
"is_read": true,
"is_starred": false,
"is_important": false,
"has_attachments": false,
"received_at": "2026-10-09T09:02:41Z",
"body": {
"html": "<p>Hi, attached is the invoice for September.</p>",
"text": "Hi, attached is the invoice for September."
}
}
]
}
}
]
}Response fields
threadThe conversation summary:
thread_id,subject,participants,last_senders,message_count,unread_countandfolders.messages[]Messages in chronological order.
messages[].message_uid / message_idThe mailbox id and the SMTP Message-ID.
messages[].in_reply_to / parent_uid / depthWhere the message sits in the reply tree.
messages[].directioninboundoroutbound.messages[].from_name / from_email / to / reply_toEnvelope data.
messages[].subject / previewSubject and preview.
messages[].is_read / is_starred / is_important / has_attachmentsMessage state.
messages[].received_atWhen the message was received or sent.
messages[].bodyOnly with
include_body: true:{ html, text }.
Errors
HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.
- 401
TOKEN_EXPIREDThe access token has expired. Call Refresh Token and repeat the request.
- 401
INVALID_TOKENThe token is malformed, unknown or revoked.
- 429
RATE_LIMITEDMore than 15 requests/s or 15 in flight for the same IP + mailbox. Wait the number of seconds in Retry-After.
- CMD
INVALID_ARGSA required argument is missing or invalid.
- CMD
NOT_FOUNDThe message, thread or folder does not exist for this token.
- CMD
INTERNALServer error. The detail is only written to the server log.