List the messages of one of the key's conversations
curl --request GET \
--url https://api.chattler.ai/v1/agents/{agent_id}/conversations/{conversation_id}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chattler.ai/v1/agents/{agent_id}/conversations/{conversation_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chattler.ai/v1/agents/{agent_id}/conversations/{conversation_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"id": "<string>",
"role": "user",
"type": "<string>",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"next_cursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Conversations
List the messages of one of the key's conversations
Return the messages of a conversation that belongs to the authenticated API key, newest first. Only user and assistant messages are returned: tool exchanges, tool-activity rows and the system prompt are never exposed.
Authentication
- Authorization:
Bearer cht_live_<key_id>.<secret>; bothread-onlyandfullkeys may read.
Path Parameters
- agent_id: The agent the key is bound to
- conversation_id: A conversation id from the conversations endpoint or a chat response. A conversation of another key or channel, or an unknown id, is
conversation_not_found
Query Parameters
- date_from, date_to: ISO-8601 bounds on
created_at;date_tois exclusive; same UTC rules as the conversations endpoint - limit: page size, 1-100 (default 20)
- cursor: the
next_cursorvalue from the previous page
Example Request
curl -X GET "/v1/agents/{agent_id}/conversations/{conversation_id}/messages?limit=50" \
-H "Authorization: Bearer cht_live_{key_id}.{secret}"
Response
- data: array of messages, newest first, each with
id,role(userorassistant),type(text,image,file, …),content(text; non-text payloads are rendered as their text or name) andcreated_at - next_cursor: opaque string for the next page, or
nullon the last page
Errors
invalid_api_key(401),agent_mismatch(403)conversation_not_found(404): not this key’s conversationvalidation_error(422): badlimit, dates, or a malformedcursorrate_limit_exceeded(429),api_rate_limit_unavailable(503),internal_error(500)
GET
/
v1
/
agents
/
{agent_id}
/
conversations
/
{conversation_id}
/
messages
List the messages of one of the key's conversations
curl --request GET \
--url https://api.chattler.ai/v1/agents/{agent_id}/conversations/{conversation_id}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chattler.ai/v1/agents/{agent_id}/conversations/{conversation_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chattler.ai/v1/agents/{agent_id}/conversations/{conversation_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"id": "<string>",
"role": "user",
"type": "<string>",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"next_cursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
Agent API key: Authorization: Bearer cht_live_<key_id>.
Query Parameters
Required range:
1 <= x <= 100