Email

The `Email` entity.

Definition

TypeScript
interface Email {
  id: string;
  workspaceId: string;
  messageId: string | null;
  inReplyTo: string | null;
  references: string | null;
  subject: string | null;
  from: { name: string; address: string } | null;
  sender: { name: string; address: string } | null;
  to: Array<{ name: string; address: string }>;
  cc: Array<{ name: string; address: string }>;
  bcc: Array<{ name: string; address: string }>;
  replyTo: Array<{ name: string; address: string }>;
  date: string | null;
  bodyPreview: string;
  bodyPreviewTruncated: boolean;
  rawSize: number;
  attachmentCount: number;
  receivedAt: string;
  createdAt: string;
  updatedAt: string;
}

Fields

FieldTypeNotes
idstringreadonly required
workspaceIdstringrequired — Workspace that received this email.
messageIdstring | nullrequired — RFC-5322 Message-ID header value.
inReplyTostring | nullrequired — Message-ID of the email this one replies to, if any.
referencesstring | nullrequired — Space-separated list of referenced Message-IDs for threading.
subjectstring | nullrequired — Subject header, if present.
from{ name: string; address: string; } | nullrequired — Author per the From header.
sender{ name: string; address: string; } | nullrequired — Actual sender per the Sender header, if it differs from From.
toArray<{ name: string; address: string; }>required — Primary recipients (To header).
ccArray<{ name: string; address: string; }>required — Carbon-copy recipients (Cc header).
bccArray<{ name: string; address: string; }>required — Blind-carbon-copy recipients (Bcc header), if exposed by transport.
replyToArray<{ name: string; address: string; }>required — Addresses clients should reply to (Reply-To header).
datestring | nullrequired — Date header parsed as ISO-8601; null when missing or invalid.
bodyPreviewstringrequired — Plaintext preview snippet of the email body.
bodyPreviewTruncatedbooleanrequired — True when the preview is truncated vs. the full body.
rawSizenumberrequired — Size in bytes of the raw .eml payload stored in R2.
attachmentCountnumberrequired — Number of attachments parsed from the message.
receivedAtstringrequired — ISO-8601 timestamp when the email worker received the message.
createdAtstringreadonly required — ISO-8601 timestamp of creation.
updatedAtstringreadonly required — ISO-8601 timestamp of the last update.