Read site chat history
list_messages
Reads the conversation between the people on a site and the agent that builds it, in one chat.
It reads one chat, which is main, the chat every site comes with, unless you pass chatId. One call returns the 10 newest messages, ordered oldest first inside that page, alongside hasMore and oldestCursor. While hasMore is true, send oldestCursor back as cursor to get the 10 before those, and repeat until it is false. A cursor in any other shape is refused with That page cursor is not valid. Ask for the first page instead!
Messages still queued to run are left out, and list_queued_messages reads those. Use it to see what has already been asked and built before sending a new message. See Site chat.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
cursor |
object | No | The oldestCursor object from the previous response, with the fields Created_At and Id. Leave it out to read the newest page. |
chatId |
string | No | The chat to read: main for the chat every site comes with, or the chatKey of another chat from list_chats. Defaults to main. |