LOOMAL
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 10

Use --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

ParamTypeDefaultDescription
limitnumber50Max results (max 100)
pageTokenstringCursor 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

FieldDescription
threadIdUnique thread identifier
subjectSubject of the first message
labelsUser-applied thread labels (e.g. starred, important, custom)
messageCountTotal messages in thread
updatedAtWhen the last message was added

Update labels via PATCH /v0/threads/:threadId.

On this page