Logo
Search
Docs

List messages

GET https://app.sulus.ai/api/v1/agents/{agent_id}/chats/{chat_id}/messages

List messages (oldest first)

Authentication

Send a bearer token created on your dashboard's Developer page:

Authorization: Bearer <YOUR_API_KEY>

Path parameters

agent_id string Required

The agent id (UUID).

Validation: uuid (route-constrained)
Stored in ai_projects.uid
chat_id string Required

The chat id (UUID).

Validation: uuid (route-constrained)
Stored in ai_chats.uid

Query parameters

per_page integer Optional Default: 30

Messages per page.

Validation: integer, clamped 1–100
before_id integer Optional Nullable

Cursor for older pages: pass the id of the first message from the previous response.

Validation: integer — fetch messages with id < before_id
Stored in ai_chat_messages.id

Errors

StatusMeaningBody
404 Agent not found, or you do not have access to it
404 Chat not found in this agent, or it was created by a different token
401 Missing or invalid bearer token
403 Feature ai_chat not enabled for the account

Notes

  • usage token counts appear only on freshly generated assistant replies, never in this history listing.
curl --request GET \
  --url https://app.sulus.ai/api/v1/agents/{agent_id}/chats/{chat_id}/messages \
  --header 'Authorization: Bearer <YOUR_API_KEY>'
import requests

url = "https://app.sulus.ai/api/v1/agents/{agent_id}/chats/{chat_id}/messages"
headers = {"Authorization": "Bearer <YOUR_API_KEY>"}

response = requests.get(url, headers=headers)
print(response.json())
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	url := "https://app.sulus.ai/api/v1/agents/{agent_id}/chats/{chat_id}/messages"
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Add("Authorization", "Bearer <YOUR_API_KEY>")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
Response 200
{
    "object": "list",
    "data": [
        {
            "id": 9001,
            "object": "message",
            "role": "user",
            "content": "Summarise our refund policy.",
            "model": null,
            "created_at": "2026-07-30T14:19:58.000000Z"
        },
        {
            "id": 9002,
            "object": "message",
            "role": "assistant",
            "content": "Refunds are available within 30 days of purchase, provided the item is unused.",
            "model": "sulus-chat-1",
            "created_at": "2026-07-30T14:20:11.000000Z"
        }
    ],
    "has_more": false
}