Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/controllers/api/v1/messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ module Api
module V1
class MessagesController < BaseController

def index
chat = current_api_account.chats.find(params[:conversation_id])

render json: {
messages: chat.transcript_for_api
}
end

def create
chat = current_api_account.chats.find(params[:conversation_id])

Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
namespace :v1 do
resources :key_requests, only: [ :create, :show ]
resources :conversations, only: [ :index, :show, :create ] do
resources :messages, only: :create
resources :messages, only: [ :index, :create ]
resource :agent_trigger, only: :create
resources :participants, only: :create
end
Expand Down
32 changes: 32 additions & 0 deletions public/ai/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,38 @@ Creates a new conversation. Include `agent_ids` to create a group chat with agen

---

### List Messages in Conversation

```
GET /api/v1/conversations/:id/messages
```

Returns the message transcript for a conversation. This is a convenience endpoint that returns the same transcript data as the conversation show endpoint.

**Response:**
```json
{
"messages": [
{
"role": "user",
"content": "Let's plan the Q1 roadmap",
"author": "Daniel",
"timestamp": "2026-01-15T09:00:00Z"
},
{
"role": "assistant",
"content": "I'd be happy to help...",
"author": "Research Assistant",
"timestamp": "2026-01-15T09:00:15Z"
}
]
}
```

Note: Like the conversation show endpoint, this excludes images, thinking traces, and tool calls.

---

### Post Message to Conversation

```
Expand Down