Get a thread and a page of its messages
Returns a bounded page of inbound and outbound thread messages interleaved in chronological order using stable cursor pagination.
GET
/
email_inboxes
/
{inbox_id}
/
threads
/
{thread_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.emailInboxes.threads.retrieve('inbox_id', 'thread_id');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.email_inboxes.threads.retrieve(
"inbox_id",
"thread_id",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
thread, err := client.EmailInboxes.Threads.Get(
context.TODO(),
"inbox_id",
"thread_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", thread.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.emailInboxes().threads().retrieve("inbox_id", "thread_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.email_inboxes.threads.retrieve("inbox_id", "thread_id")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->emailInboxes->threads->retrieve(
'inbox_id',
'thread_id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:threads retrieve \
--api-key 'My API Key' \
--inbox-id inbox_id \
--thread-id thread_idcurl --request GET \
--url https://api.telnyx.com/v2/email_inboxes/{inbox_id}/threads/{thread_id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "33333333-3333-3333-3333-333333333333",
"record_type": "email_thread",
"inbox_id": "11111111-1111-1111-1111-111111111111",
"subject": "Project update",
"preview": null,
"message_count": 2,
"unread_count": 1,
"last_message_id": "55555555-5555-5555-5555-555555555555",
"last_message_at": "2026-07-15T12:30:00Z",
"created_at": "2026-07-14T10:00:00Z",
"updated_at": "2026-07-15T12:30:00Z",
"labels": [
"needs_review"
],
"messages": [
{
"id": "55555555-5555-5555-5555-555555555555",
"record_type": "email_message",
"direction": "inbound",
"status": "received",
"inbox_id": "11111111-1111-1111-1111-111111111111",
"thread_id": "33333333-3333-3333-3333-333333333333",
"message_id": "<message@example.com>",
"in_reply_to": "<earlier@example.com>",
"references": [
"<earlier@example.com>"
],
"from": {
"email": "alice@example.com",
"name": "Alice"
},
"to": [
{
"email": "agent@inbox.example.test"
}
],
"cc": [],
"bcc": [],
"reply_to": [],
"subject": "Project update",
"text_body_url": null,
"html_body_url": null,
"reply_text": "Thanks, I will send it today.",
"has_quoted_text": true,
"headers": {},
"inline_files": [],
"attachments": [],
"labels": [],
"read_at": null,
"received_at": "2026-07-15T12:30:00Z",
"sent_at": null,
"created_at": "2026-07-15T12:30:00Z",
"updated_at": "2026-07-15T12:30:00Z"
}
]
},
"meta": {
"page_size": 25,
"page_cursor": "MjAyNi0wNy0xNVQxMjozMDowMFp8NTU1NTU1NTUtNTU1NS01NTU1LTU1NTUtNTU1NTU1NTU1NTU1"
}
}{
"errors": [
{
"code": "10006",
"title": "Not authorized",
"detail": "Invalid API key",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested resource was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "subject can't be blank",
"source": {
"pointer": "/data/attributes/subject"
}
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "Inbox threads are temporarily unavailable. Please try again later."
}
]
}Authorizations
Telnyx API key supplied as Authorization: Bearer <token>. In production, auth may be validated by the API gateway and forwarded via Telnyx auth headers.
Path Parameters
Email inbox UUID.
Email thread UUID.
Query Parameters
Number of thread messages to return. Defaults to 25; maximum is 100.
Required range:
1 <= x <= 100Opaque message cursor returned by the previous thread-detail page.
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.emailInboxes.threads.retrieve('inbox_id', 'thread_id');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.email_inboxes.threads.retrieve(
"inbox_id",
"thread_id",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
thread, err := client.EmailInboxes.Threads.Get(
context.TODO(),
"inbox_id",
"thread_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", thread.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.emailInboxes().threads().retrieve("inbox_id", "thread_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.email_inboxes.threads.retrieve("inbox_id", "thread_id")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->emailInboxes->threads->retrieve(
'inbox_id',
'thread_id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:threads retrieve \
--api-key 'My API Key' \
--inbox-id inbox_id \
--thread-id thread_idcurl --request GET \
--url https://api.telnyx.com/v2/email_inboxes/{inbox_id}/threads/{thread_id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "33333333-3333-3333-3333-333333333333",
"record_type": "email_thread",
"inbox_id": "11111111-1111-1111-1111-111111111111",
"subject": "Project update",
"preview": null,
"message_count": 2,
"unread_count": 1,
"last_message_id": "55555555-5555-5555-5555-555555555555",
"last_message_at": "2026-07-15T12:30:00Z",
"created_at": "2026-07-14T10:00:00Z",
"updated_at": "2026-07-15T12:30:00Z",
"labels": [
"needs_review"
],
"messages": [
{
"id": "55555555-5555-5555-5555-555555555555",
"record_type": "email_message",
"direction": "inbound",
"status": "received",
"inbox_id": "11111111-1111-1111-1111-111111111111",
"thread_id": "33333333-3333-3333-3333-333333333333",
"message_id": "<message@example.com>",
"in_reply_to": "<earlier@example.com>",
"references": [
"<earlier@example.com>"
],
"from": {
"email": "alice@example.com",
"name": "Alice"
},
"to": [
{
"email": "agent@inbox.example.test"
}
],
"cc": [],
"bcc": [],
"reply_to": [],
"subject": "Project update",
"text_body_url": null,
"html_body_url": null,
"reply_text": "Thanks, I will send it today.",
"has_quoted_text": true,
"headers": {},
"inline_files": [],
"attachments": [],
"labels": [],
"read_at": null,
"received_at": "2026-07-15T12:30:00Z",
"sent_at": null,
"created_at": "2026-07-15T12:30:00Z",
"updated_at": "2026-07-15T12:30:00Z"
}
]
},
"meta": {
"page_size": 25,
"page_cursor": "MjAyNi0wNy0xNVQxMjozMDowMFp8NTU1NTU1NTUtNTU1NS01NTU1LTU1NTUtNTU1NTU1NTU1NTU1"
}
}{
"errors": [
{
"code": "10006",
"title": "Not authorized",
"detail": "Invalid API key",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested resource was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "subject can't be blank",
"source": {
"pointer": "/data/attributes/subject"
}
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "Inbox threads are temporarily unavailable. Please try again later."
}
]
}