Skip to main content
GET
https://api.myweave.ai
/
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"
{
  "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
}

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

threadId
string
required
Thread identifier (UUID)

Response

data
array
Array of messages in chronological order (oldest first)
count
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"
{
  "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
}

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_at in ascending order (oldest first)
  • Assistant messages with response_id are enriched with full content LLM
  • Thread must exist in the database to retrieve messages
  • Only returns user and assistant role messages (no system messages)