List conversation messages
GET/v2/agents/{agentId}/conversations/{conversationId}/messages
Read the messages of one conversation in order, with their roles, content, sources and any feedback, one cursor page at a time.
Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.
Returns the messages of a conversation, oldest first. Call it to show a chat history in your app, to review what an agent said, or to read a conversation after a stream was interrupted.
Request
GET /v2/agents/{agentId}/conversations/{conversationId}/messages
Path parameters:
| Name | Type | Required | Description |
|---|---|---|---|
agentId |
string | Yes | The ID of the agent, starting with agt_. |
conversationId |
string | Yes | The ID of the conversation, starting with conv_. |
Query parameters:
| Name | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Items per page, from 1 to 100. Defaults to 20. |
cursor |
string | No | The nextCursor value from the previous page. |
order |
string | No | asc for oldest first, desc for newest first. Defaults to asc. |
Keep order and limit the same on every request of one walk through the messages, as described in Pagination.
Example request
curl "https://api.askocto.co/v2/agents/agt_8f3k2m/conversations/conv_5n2p8w/messages?limit=50" \
-H "Authorization: Bearer $OCTO_API_KEY"
const url = new URL(
"https://api.askocto.co/v2/agents/agt_8f3k2m/conversations/conv_5n2p8w/messages",
)
url.searchParams.set("limit", "50")
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
})
const { data } = await response.json()
for (const message of data) console.log(`${message.role}: ${message.content}`)
Example response
A successful call returns 200 OK.
{
"data": [
{
"id": "msg_4w7e1b",
"conversationId": "conv_5n2p8w",
"role": "user",
"content": "I would like a refund for the jacket, it arrived damaged.",
"sources": [],
"feedback": null,
"createdAt": "2026-03-20T13:58:00Z"
},
{
"id": "msg_7c1k9s",
"conversationId": "conv_5n2p8w",
"role": "assistant",
"content": "I am sorry about the jacket. Can you share your order number?",
"sources": [{ "id": "src_91xa7d", "title": "Returns and refunds" }],
"feedback": { "rating": "positive", "comment": null },
"createdAt": "2026-03-20T13:58:04Z"
}
],
"nextCursor": null
}
Response fields
| Name | Type | Description |
|---|---|---|
data[].id |
string | The message ID, starting with msg_. |
data[].conversationId |
string | The conversation the message belongs to. |
data[].role |
string | user or assistant. |
data[].content |
string | The text of the message. |
data[].sources |
array | The sources the agent used, each with id and title. Empty for user messages. |
data[].feedback |
object or null | The rating (positive or negative) and comment given to the message, or null. |
data[].createdAt |
string | When the message was sent, as an ISO 8601 UTC time. |
nextCursor |
string or null | Pass it as cursor for the next page. null on the last page. |
Add or change a rating with Update message feedback.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request |
limit is outside 1 to 100, or order has an unknown value. |
| 401 | unauthorized |
The API key is missing, malformed or deleted. |
| 404 | not_found |
The agent or the conversation does not exist in your workspace. |
| 429 | rate_limited |
Too many requests. Wait for the number of seconds in the Retry-After header. |