Thread

The `Thread` entity.

Definition

TypeScript
interface Thread {
  id: string;
  workspaceId: string;
  title: string | null;
  createdByUserId: string | null;
  parentMessageId: string | null;
  lastMessageAt: string | null;
  createdAt: string;
  updatedAt: string;
  unreadCount: number;
}

Fields

FieldTypeNotes
idstringreadonly required
workspaceIdstringrequired — Workspace that owns this thread.
titlestring | nullrequired — Thread title; auto-generated from the first assistant turn or user-set.
createdByUserIdstring | nullrequired — User who initiated this thread; null for threads initiated by external visitors on deployed apps.
parentMessageIdstring | nullrequired — For sub-threads spawned by a delegation, the message that rooted the delegation. Null for top-level threads.
lastMessageAtstring | nullrequired — ISO-8601 timestamp of the most recent message; denormalized for recency sort.
createdAtstringreadonly required — ISO-8601 timestamp of creation.
updatedAtstringreadonly required — ISO-8601 timestamp of the last update.
unreadCountnumberrequired — Number of messages newer than the caller's read pointer in this thread. 0 if the caller has no participant row or has read everything.