Conversations
Read conversation history from a workspace. Requires the conversations scope and a workspace_id.
GET
/v1/conversationsconversations scopeList conversations in a workspace ordered by most recent activity.
Query parameters
| Parameter | Type | Description |
|---|---|---|
| workspace_id * | string | Required. Workspace to list conversations from. |
| limit | integer | Max results to return. Default 20, max 100. |
| before | string | Cursor for pagination — return conversations before this conversation ID. |
conversations = client.conversations.list(workspace_id="ws_abc123")
for conv in conversations:
print(f"{conv.id}: {conv.title} ({conv.message_count} messages)")const conversations = await client.conversations.list({ workspaceId: 'ws_abc123' });
for (const conv of conversations) {
console.log(`${conv.id}: ${conv.title} (${conv.messageCount} messages)`);
}curl "https://api.smarts.bio/v1/conversations?workspace_id=ws_abc123" \
-H "Authorization: Bearer sk_live_..."
# Response:
# {
# "status": "success",
# "data": [
# {
# "id": "conv_xyz789",
# "title": "BRCA1 variant analysis",
# "createdAt": "2024-01-15T10:30:00Z",
# "updatedAt": "2024-01-15T11:45:00Z",
# "messageCount": 12
# }
# ],
# "hasMore": false
# }# List conversations in a workspace smarts conversation list -w ws_abc123
GET
/v1/conversations/:idconversations scopeRetrieve a specific conversation including its full message history.
Query parameters
| Parameter | Type | Description |
|---|---|---|
| workspace_id * | string | Required. Must match the workspace the conversation belongs to. |
conv = client.conversations.get(
conversation_id="conv_xyz789",
workspace_id="ws_abc123"
)
for msg in conv.messages:
print(f"[{msg.role}]: {msg.content[:100]}")const conv = await client.conversations.get('conv_xyz789', {
workspaceId: 'ws_abc123',
});
for (const msg of conv.messages) {
console.log(`[${msg.role}]: ${msg.content.slice(0, 100)}`);
}curl "https://api.smarts.bio/v1/conversations/conv_xyz789?workspace_id=ws_abc123" \
-H "Authorization: Bearer sk_live_..."
# Response:
# {
# "status": "success",
# "data": {
# "id": "conv_xyz789",
# "title": "BRCA1 variant analysis",
# "messages": [
# { "role": "user", "content": "Find BRCA1 variants associated with breast cancer", "timestamp": "..." },
# { "role": "assistant", "content": "I found 23 variants...", "timestamp": "..." }
# ]
# }
# }# Show a conversation with its full message history smarts conversation show conv_xyz789 -w ws_abc123