curl -X GET https://api.myweave.ai/functions/v1/threads/550e8400-e29b-41d4-a716-446655440000/messages \
-H "X-API-Key: your-api-key-here"
const threadId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.myweave.ai/functions/v1/threads/${threadId}/messages`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data, count } = await response.json();
console.log(`Retrieved ${count} messages`);
data.forEach(msg => {
console.log(`[${msg.role}]: ${msg.content}`);
});
import requests
thread_id = '550e8400-e29b-41d4-a716-446655440000'
url = f"https://api.myweave.ai/functions/v1/threads/{thread_id}/messages"
headers = {"X-API-Key": "your-api-key-here"}
response = requests.get(url, headers=headers)
result = response.json()
print(f"Retrieved {result['count']} messages")
for message in result['data']:
print(f"[{message['role']}]: {message['content']}")
{
"data": [
{
"id": "b8f3e1c0-1234-5678-9abc-def012345678",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"content": "Hello, I need help with leadership development",
"role": "user",
"response_id": null,
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "c9f4e2d1-2345-6789-abcd-ef0123456789",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"content": "I'd be happy to help you with leadership development. Let's start by understanding your current goals and challenges in your leadership role...",
"role": "assistant",
"response_id": "resp_abc123xyz",
"created_at": "2024-01-15T10:30:15Z"
}
],
"count": 2
}
{
"error": "threadId is required in path"
}
{
"error": "Thread not found"
}
{
"error": "Failed to fetch messages"
}
Chat & Conversations
Get Thread Messages
Retrieve all messages from a conversation thread
GET
/
functions
/
v1
/
threads
/
:threadId
/
messages
curl -X GET https://api.myweave.ai/functions/v1/threads/550e8400-e29b-41d4-a716-446655440000/messages \
-H "X-API-Key: your-api-key-here"
const threadId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.myweave.ai/functions/v1/threads/${threadId}/messages`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data, count } = await response.json();
console.log(`Retrieved ${count} messages`);
data.forEach(msg => {
console.log(`[${msg.role}]: ${msg.content}`);
});
import requests
thread_id = '550e8400-e29b-41d4-a716-446655440000'
url = f"https://api.myweave.ai/functions/v1/threads/{thread_id}/messages"
headers = {"X-API-Key": "your-api-key-here"}
response = requests.get(url, headers=headers)
result = response.json()
print(f"Retrieved {result['count']} messages")
for message in result['data']:
print(f"[{message['role']}]: {message['content']}")
{
"data": [
{
"id": "b8f3e1c0-1234-5678-9abc-def012345678",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"content": "Hello, I need help with leadership development",
"role": "user",
"response_id": null,
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "c9f4e2d1-2345-6789-abcd-ef0123456789",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"content": "I'd be happy to help you with leadership development. Let's start by understanding your current goals and challenges in your leadership role...",
"role": "assistant",
"response_id": "resp_abc123xyz",
"created_at": "2024-01-15T10:30:15Z"
}
],
"count": 2
}
{
"error": "threadId is required in path"
}
{
"error": "Thread not found"
}
{
"error": "Failed to fetch messages"
}
Overview
Get all messages from a specific conversation thread. Messages are fetched from the database and automatically enriched with full content LLM for assistant responses.Path Parameters
string
required
Thread identifier (UUID)
Response
array
Array of messages in chronological order (oldest first)
number
Total number of messages in the thread
curl -X GET https://api.myweave.ai/functions/v1/threads/550e8400-e29b-41d4-a716-446655440000/messages \
-H "X-API-Key: your-api-key-here"
const threadId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.myweave.ai/functions/v1/threads/${threadId}/messages`,
{
method: 'GET',
headers: {
'X-API-Key': 'your-api-key-here'
}
}
);
const { data, count } = await response.json();
console.log(`Retrieved ${count} messages`);
data.forEach(msg => {
console.log(`[${msg.role}]: ${msg.content}`);
});
import requests
thread_id = '550e8400-e29b-41d4-a716-446655440000'
url = f"https://api.myweave.ai/functions/v1/threads/{thread_id}/messages"
headers = {"X-API-Key": "your-api-key-here"}
response = requests.get(url, headers=headers)
result = response.json()
print(f"Retrieved {result['count']} messages")
for message in result['data']:
print(f"[{message['role']}]: {message['content']}")
{
"data": [
{
"id": "b8f3e1c0-1234-5678-9abc-def012345678",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"content": "Hello, I need help with leadership development",
"role": "user",
"response_id": null,
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": "c9f4e2d1-2345-6789-abcd-ef0123456789",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"content": "I'd be happy to help you with leadership development. Let's start by understanding your current goals and challenges in your leadership role...",
"role": "assistant",
"response_id": "resp_abc123xyz",
"created_at": "2024-01-15T10:30:15Z"
}
],
"count": 2
}
{
"error": "threadId is required in path"
}
{
"error": "Thread not found"
}
{
"error": "Failed to fetch messages"
}
Features
- Automatic Content Enrichment: Assistant messages are automatically fetched LLM with full content
- Chronological Order: Messages returned in order from oldest to newest
- Database-backed: Fast retrieval from database with LLM enrichment
- Complete History: All user and assistant messages in the conversation
Use Cases
- Display Conversation: Show full chat history to users
- Context Retrieval: Get conversation context for analysis
- Message Export: Export conversation for records
- UI Rendering: Populate chat interface with history
Notes
- Messages are ordered by
created_atin ascending order (oldest first) - Assistant messages with
response_idare enriched with full content LLM - Thread must exist in the database to retrieve messages
- Only returns
userandassistantrole messages (no system messages)
Was this page helpful?

