ThreadParticipant

A participant in a thread. Exactly one identity field is populated per row (enforced by a CHECK constraint). The populated field determines the participant's kind: - `userId` → Aeontel user - `agentId` → agent - `swarmId` → swarm - `externalIdentity` → external visitor on a deployed app `displayName` is required for visitors (they have no other human-readable identity) and optional as a cache for the rest.

Definition

TypeScript
interface ThreadParticipant {
  id: string;
  threadId: string;
  userId: string | null;
  agentId: string | null;
  swarmId: string | null;
  externalIdentity: string | null;
  displayName: string | null;
  joinedAt: string;
  lastReadMessageId: string | null;
  lastReadAt: string | null;
}

Fields

FieldTypeNotes
idstringreadonly required
threadIdstringrequired — Thread this participant belongs to.
userIdstring | nullrequired — Set when the participant is an Aeontel user.
agentIdstring | nullrequired — Set when the participant is an agent.
swarmIdstring | nullrequired — Set when the participant is a swarm.
externalIdentitystring | nullrequired — Opaque identity string supplied by a deployed app for non-Aeontel visitors.
displayNamestring | nullrequired — Human-readable name; required for visitors, optional cache for others.
joinedAtstringrequired — ISO-8601 timestamp of when this participant joined.
lastReadMessageIdstring | nullrequired — Most recent message this participant has read. Messages with a later createdAt are unread for them.
lastReadAtstring | nullrequired — ISO-8601 timestamp of when lastReadMessageId was set. Useful for 'read 5m ago' UI.