Conversations

What people have been asking, newest first — and one conversation in full.

Listing

GET /v1/agents/:publicId/conversations, newest activity first.

bash
curl "https://api.tigerbase.cloud/v1/agents/a1b2c3d4…/conversations?limit=50" \
  -H "Authorization: Bearer $TIGERBASE_KEY"
200 OK
[
  {
    "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

limit1 to 200, newest first. The server defaults to 25.
since / untilA Date or an ISO string, filtered in the query. Measured on the LAST message, not when the conversation started.

Each row

visitorWho it was. Also the key you pass back to read the conversation.
channelWhere it came from — "web" for the widget and the browser SDK, "api" for a thread started with ask(), or a messaging channel.
messagesA count. The summaries stay light so listing a few hundred is one small response.
startedAt / lastMessageAtISO timestamps.

NoteWhat `visitor` looks like

A web visitor reads as the bare browser id it has always been. Anybody else is qualified with the channel — 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.

bash
curl "https://api.tigerbase.cloud/v1/agents/a1b2c3d4…/conversations/api%3Aticket-900" \
  -H "Authorization: Bearer $TIGERBASE_KEY"
200 OK
{
  "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

Asking about an agent outside the key's App throws 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

typescript
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

“What has been happening today” includes a conversation opened last week and replied to an hour ago — and that is usually the one somebody is looking for.

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

app/api/digest/route.ts
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

An agent busy enough to exceed it gets a quietly wrong answer. Narrow the window — ask per hour instead of per day — or page by taking the oldest lastMessageAt you received and asking again with until set to it.