Conversations
What people have been asking, newest first — and one conversation in full.
Listing
GET /v1/agents/:publicId/conversations, newest activity first.
curl "https://api.tigerbase.cloud/v1/agents/a1b2c3d4…/conversations?limit=50" \
-H "Authorization: Bearer $TIGERBASE_KEY"[
{
"visitor": "api:ticket-900",
"channel": "api",
"messages": 4,
"startedAt": "2026-10-30T08:14:02.000Z",
"lastMessageAt": "2026-10-31T09:40:51.000Z"
},
{
"visitor": "tb-bba2ef31-…",
"channel": "web",
"messages": 2,
"startedAt": "2026-10-31T07:02:19.000Z",
"lastMessageAt": "2026-10-31T07:03:05.000Z"
}
]Query parameters
| limit | 1 to 200, newest first. The server defaults to 25. |
|---|---|
| since / until | A Date or an ISO string, filtered in the query. Measured on the LAST message, not when the conversation started. |
Each row
| visitor | Who it was. Also the key you pass back to read the conversation. |
|---|---|
| channel | Where it came from — "web" for the widget and the browser SDK, "api" for a thread started with ask(), or a messaging channel. |
| messages | A count. The summaries stay light so listing a few hundred is one small response. |
| startedAt / lastMessageAt | ISO timestamps. |
NoteWhat `visitor` looks like
api:ticket-900, telegram:… — so two ids can be compared without knowing where either came from. The same number on two different channels is two different people, and an unqualified id would hide that.Reading one
GET /v1/agents/:publicId/conversations/:visitor. Pass the visitor exactly as the list gave it, prefix included, and URL-encode it — the SDK does that for you.
curl "https://api.tigerbase.cloud/v1/agents/a1b2c3d4…/conversations/api%3Aticket-900" \
-H "Authorization: Bearer $TIGERBASE_KEY"{
"visitor": "api:ticket-900",
"channel": "api",
"messages": [
{ "role": "user", "content": "My order is 4471." },
{ "role": "model", "content": "Got it — I've noted that your order number is 4471." }
]
}The messages come back in order, each with a role and content. A message may carry more than those two fields and the type allows for it, so a field added later does not break your build.
Both need the read scope
TipAn agent that is not yours is not found
not_found — the same as an id that never existed. You cannot use this API to discover whether an id is in use. That is deliberate, and it is why a 404 here does not necessarily mean you typed it wrong.Filtering by date
const yesterday = new Date(Date.now() - 24 * 60 * 60 * 1000);
await tigerbase.conversations(agentPublicId, {
since: yesterday,
limit: 200,
});NoteOn the last message, not the first
Filtered in the query rather than after it. Without it a caller wanting yesterday has to ask for 200 and discard most of them, and silently miss anything past the 200th — which is exactly what happens to the busy agent whose numbers matter most.
A value the server cannot read is refused with bad_request rather than ignored, and so is an until that is not after since. A caller who sends since="last tuesday" and gets a full list back has no way to tell it was dropped.
A worked example
import { tigerbase } from "@/lib/tigerbase";
/** Yesterday's conversations, per agent, for an internal digest. */
export async function GET() {
const since = new Date(Date.now() - 24 * 60 * 60 * 1000);
const agents = await tigerbase.agents();
const digest = await Promise.all(
agents.map(async (agent) => {
const recent = await tigerbase.conversations(agent.publicId, {
since,
limit: 200,
});
return {
agent: agent.name,
conversations: recent.length,
messages: recent.reduce((n, c) => n + c.messages, 0),
};
}),
);
return Response.json(digest);
}Warning200 is a ceiling, not a page size
lastMessageAt you received and asking again with until set to it.