Skip to main content
GET
https://api.agent-mind.com
/
api
/
v1
/
agent
/
conversations
/
{conversation_id}
/
messages
Get Conversation Messages
curl --request GET \
  --url https://api.agent-mind.com/api/v1/agent/conversations/{conversation_id}/messages \
  --header 'Authorization: Bearer <token>'

Overview

Retrieve all messages from a specific conversation. Useful for displaying conversation history or exporting chat logs.

Path Parameters

conversation_id
string
required
The UUID of the conversation to retrieve messages from.

Query Parameters

limit
integer
default:"50"
Maximum number of messages to return. Default is 50.

Response

{
  "conversation_id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Python web scraping discussion",
  "messages": [
    {
      "id": "770e8400-e29b-41d4-a716-446655440002",
      "role": "user",
      "content": "How do I scrape data from a website?",
      "created_at": "2024-03-20T10:30:00Z"
    },
    {
      "id": "880e8400-e29b-41d4-a716-446655440003",
      "role": "assistant",
      "content": "For web scraping in Python, I recommend using BeautifulSoup or Scrapy...",
      "created_at": "2024-03-20T10:30:15Z"
    }
  ],
  "count": 2
}

Examples

import requests

conversation_id = "550e8400-e29b-41d4-a716-446655440000"
url = f"https://api.leedab.com/api/v1/agent/conversations/{conversation_id}/messages"
headers = {
    "Authorization": "Bearer am_live_your_api_key"
}

response = requests.get(url, headers=headers)
data = response.json()

print(f"Conversation: {data['title']}")
for msg in data["messages"]:
    print(f"{msg['role'].upper()}: {msg['content'][:100]}...")

Error Responses

404 Not Found

{
  "error": "conversation_not_found"
}

401 Unauthorized

{
  "detail": "Invalid or missing API key"
}