SDK / API ReferenceThreads
List Threads
GET /v0/threads
Scope: mail:read
List email threads in your agent's inbox. Returns most recently updated first.
Request
import { Loomal } from "@loomal/sdk";
const loomal = new Loomal({ apiKey: process.env.LOOMAL_API_KEY! });
const { threads, nextPageToken } = await loomal.mail.listThreads({
limit: 10,
});import os
from loomal import Loomal
loomal = Loomal(api_key=os.environ["LOOMAL_API_KEY"])
result = loomal.mail.list_threads(limit=10)loomal threads list --limit 10Use --page-token to paginate. Omit flags to fetch the default 50 most-recent threads.
mail.list_threads(limit?, page_token?)Available through @loomal/mcp — see MCP setup.
curl "https://api.loomal.ai/v0/threads?limit=10" \
-H "Authorization: Bearer loid-your-api-key"Query Parameters
| Param | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Max results (max 100) |
pageToken | string | — | Cursor from previous response |
Response — 200 OK
{
"threads": [
{
"threadId": "thd_a3f91b00c4e2d7e8",
"inboxId": "agent-x8k2m@mailgent.dev",
"subject": "Question about pricing",
"labels": ["starred", "follow-up"],
"messageCount": 3,
"createdAt": "2026-03-28T10:00:00.000Z",
"updatedAt": "2026-03-28T14:30:00.000Z"
}
],
"count": 1,
"nextPageToken": "2026-03-28T09:00:00.000Z"
}Fields
| Field | Description |
|---|---|
threadId | Unique thread identifier |
subject | Subject of the first message |
labels | User-applied thread labels (e.g. starred, important, custom) |
messageCount | Total messages in thread |
updatedAt | When the last message was added |
Update labels via PATCH /v0/threads/:threadId.