Accountmaker Docs
Types

Email Message

Record of an email sent or received through the system with delivery tracking.

email message delivery tracking

Email Message

An Email Message is a record of an email sent or received through AM’s email infrastructure.

Schema

interface EmailMessage {
  id: string; // "eml_..." - Unique identifier
  account_id: string; // Owning account
  hostname: string; // Sending domain
  direction: "in" | "out"; // Inbound or outbound
  from_contact: EmailContact;
  reply_to_contacts: EmailContact[];
  to_contacts: EmailContact[];
  cc_contacts: EmailContact[];
  bcc_contacts: EmailContact[];
  subject: string;
  body_text: string;
  body_html: string;
  received_at: string | null;
  sent_at: string | null;
}

interface EmailContact {
  email: string;
  name?: string;
}

Properties

PropertyTypeDescription
idstringKSUID with eml_ prefix
account_idstringAccount that owns message
hostnamestringDomain used for sending
directionenumin for received, out for sent
from_contactobjectSender information
reply_to_contactsarrayReply-to contacts
to_contactsarrayPrimary recipients
cc_contactsarrayCC recipients
bcc_contactsarrayBCC recipients
subjectstringEmail subject line
body_textstringPlain text content
body_htmlstringHTML content
received_atstring?When inbound email was received
sent_atstring?When outbound email was sent

Example

{
  "id": "eml_2kHfPZcN9xW4mE8RtY7vB",
  "account_id": "acc_1jGePYbM8wV3lD7QsX6uA",
  "hostname": "mail.example.com",
  "direction": "out",
  "from_contact": {
    "email": "noreply@example.com",
    "name": "Acme Corp"
  },
  "reply_to_contacts": [],
  "to_contacts": [{ "email": "user@example.com", "name": "Jane Doe" }],
  "cc_contacts": [],
  "bcc_contacts": [],
  "subject": "Welcome to Acme",
  "body_text": "Welcome...",
  "body_html": "<h1>Welcome</h1>...",
  "sent_at": "2025-01-15T10:30:00Z"
}