cURL
curl "https://reygrid.com/api/v1/agents/{AgentId}/conversations/user_42/messages?size=50" \
-H "Authorization: Bearer $REYGRID_API_KEY"from reygrid import ReyGrid
client = ReyGrid(api_key="YOUR_API_KEY")
res = client.list_messages("{AgentId}", "user_42", size=50)
for message in res.messages: # newest first
print(message.role, message.content)import { ReyGrid } from "reygrid";
const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });
const { messages } = await client.listMessages("{AgentId}", "user_42", { size: 50 });
for (const m of messages) console.log(m.role, m.content); // newest first{
"success": true,
"userId": "user_42",
"messages": [
{
"id": "msg_x6tWaZ3H9oOKd",
"role": "assistant",
"content": "Your order #1042 shipped yesterday and should arrive within 2 business days.",
"feedback": {
"rating": "up",
"createdAt": "2026-10-05T10:22:01.000Z"
},
"createdAt": "2026-10-05T10:21:36.002Z"
},
{
"id": "msg_mgGdMG8f9PUjc",
"role": "user",
"content": "Where is my order #1042?",
"createdAt": "2026-10-05T10:21:34.120Z"
}
],
"pagination": {
"totalMessages": 14,
"totalPages": 1,
"currentPage": 1,
"pagingCounter": 1,
"hasNextPage": false
}
}{
"error": "Unauthorized",
"code": "AUTH_REQUIRED"
}{
"success": false,
"error": {
"code": "CONVERSATION_NOT_FOUND",
"message": "This conversation does not exist"
}
}Messages
List conversation messages
Returns a paginated list of messages.
conversationRef can be either a conversationId or a persistent userId.
GET
/
agents
/
{agentId}
/
conversations
/
{conversationRef}
/
messages
cURL
curl "https://reygrid.com/api/v1/agents/{AgentId}/conversations/user_42/messages?size=50" \
-H "Authorization: Bearer $REYGRID_API_KEY"from reygrid import ReyGrid
client = ReyGrid(api_key="YOUR_API_KEY")
res = client.list_messages("{AgentId}", "user_42", size=50)
for message in res.messages: # newest first
print(message.role, message.content)import { ReyGrid } from "reygrid";
const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });
const { messages } = await client.listMessages("{AgentId}", "user_42", { size: 50 });
for (const m of messages) console.log(m.role, m.content); // newest first{
"success": true,
"userId": "user_42",
"messages": [
{
"id": "msg_x6tWaZ3H9oOKd",
"role": "assistant",
"content": "Your order #1042 shipped yesterday and should arrive within 2 business days.",
"feedback": {
"rating": "up",
"createdAt": "2026-10-05T10:22:01.000Z"
},
"createdAt": "2026-10-05T10:21:36.002Z"
},
{
"id": "msg_mgGdMG8f9PUjc",
"role": "user",
"content": "Where is my order #1042?",
"createdAt": "2026-10-05T10:21:34.120Z"
}
],
"pagination": {
"totalMessages": 14,
"totalPages": 1,
"currentPage": 1,
"pagingCounter": 1,
"hasNextPage": false
}
}{
"error": "Unauthorized",
"code": "AUTH_REQUIRED"
}{
"success": false,
"error": {
"code": "CONVERSATION_NOT_FOUND",
"message": "This conversation does not exist"
}
}Authorizations
ReyGrid API key sent as a Bearer token.
Path Parameters
The ID of the agent.
A conversation ID or persistent user ID. When a user ID is provided, it identifies the user's persistent conversation.
Query Parameters
Page number.
Required range:
x >= 1Number of items per page.
Required range:
1 <= x <= 100