Check out our upcoming events and meetups! View events →
Retrieve messages for a specific conversation, including tool calls made by the assistant.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const messageListResponse of client.ai.conversations.messages.list('conversation_id')) {
console.log(messageListResponse.role);
}{
"data": [
{
"role": "user",
"text": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"created_at": "2025-04-15T13:07:28.764Z",
"sent_at": "2025-04-15T13:07:28.764Z"
}
],
"meta": {
"total_pages": 123,
"total_results": 123,
"page_number": 123,
"page_size": 123
}
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The number of messages to return per page.
1 <= x <= 100The page number to retrieve.
x >= 1Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const messageListResponse of client.ai.conversations.messages.list('conversation_id')) {
console.log(messageListResponse.role);
}{
"data": [
{
"role": "user",
"text": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
],
"created_at": "2025-04-15T13:07:28.764Z",
"sent_at": "2025-04-15T13:07:28.764Z"
}
],
"meta": {
"total_pages": 123,
"total_results": 123,
"page_number": 123,
"page_size": 123
}
}