Skip to Content
Getting StartedKey Concepts

Key Concepts

msend models communication around a small set of channel-neutral resources. Every API-facing resource uses a prefixed public ID (agt_..., chn_..., cnv_..., msg_..., con_..., evt_...)—internal database IDs are never exposed.

Resource Hierarchy

Organization ├── Agent ──< Channel │ ├── MessageTemplate (WhatsApp templates) │ ├── InboundEvent (raw verified payloads) │ └── Conversation ──< Participant >── Identity >── Contact │ └── Message ──< DeliveryEvent ├── ApiKey (agent-scoped or organization-wide) ├── Event ──< WebhookDelivery └── Consent (per identity + channel kind)

Agents & Channels

  • An Agent (agt_...) represents your AI software. It owns one or more channels and defines how events are delivered (webhook or poll).
  • A Channel (chn_...) is a single connected provider account (one Email mailbox, one Slack app installation, or one WhatsApp Business phone number). Each channel belongs to exactly one agent.

Contacts & Identities

  • A Contact (con_...) represents a person or organization you communicate with.
  • An Identity represents one address for that contact on a specific channel kind: (kind, scope, external_id).
    • For Email and WhatsApp, scope is empty and external_id is the email address or E.164 phone number.
    • For Slack, scope is the Slack team ID and external_id is the Slack user ID.
  • A single contact can have multiple identities (e.g., an email address and a WhatsApp number).

Conversations & Threading

  • A Conversation (cnv_...) is the stable session or thread ID that your agent should key its memory on.
  • conversation.kind is one of direct, group, or channel.
  • thread_key distinguishes threads within a channel (such as Slack thread_ts or email thread roots). Replying to a conversation_id automatically routes the outbound message back to the exact thread or DM the user wrote from.

Messages & Parts

  • Every Message (msg_...) has:
    • text: a plain-text representation, always present for LLM consumption.
    • parts: a structured array of typed content objects (text, image, audio, video, file, location, buttons, list, template, reaction).
    • addressed_to_agent: boolean set by the inbound adapter (true for DMs, @mentions, or replies in a thread the agent participates in).
  • In group chats or Slack channels, use addressed_to_agent (and the channel’s reply_policy) to ensure your agent only responds when spoken to.
Last updated on