ai.v1.AssistantService
ListMessages
ListMessages lists the messages of one of the caller's conversations, newest first. Errors: - INVALID_ARGUMENT: malformed request or page token. - NOT_FOUND: CONVERSATION_NOT_FOUND. - UNAVAILABLE: SERVICE_UNAVAILABLE; retry later. - UNAUTHENTICATED: missing or invalid credentials.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/ai.v1.AssistantService/ListMessages' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"conversationId": "1",
"limit": 100,
"pageToken": "eyJvZmZzZXQiOjEwMH0"
}'Responses
{
"messages": [
{
"createdAt": "2025-01-01T00:00:00Z",
"messageId": "1",
"role": "USER",
"runId": "1",
"text": "value"
}
],
"nextPageToken": "eyJvZmZzZXQiOjIwMH0"
}ai.v1.ListMessagesRequestai.v1.ListMessagesResponseConversation to read.
Maximum messages to return. 0 means the default of 50; maximum 200.
Opaque, keyset-backed, exclusive cursor from a previous response. Bound to the caller, the conversation, created_at and message_id.
Public message ID.
Author of the message.
Message text in Markdown. For an assistant message, the final text of its run; tool activity and views are not part of it.
When the message was recorded.
The run the message started (user) or the run that wrote it (assistant). Replay that run with WatchRun from after_seq 0 to show its tool activity and views.
Cursor for the next page. Empty when no more results exist.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |