Skip to main content
Internal documentation for developers. This page covers the Mail Inboxes API: creation, AI assignment, alias management, unread counts, and inbound email routing. Not intended for end users.

Route Map


Auth Pattern


Inbox Object Schema


Alias Generation

When a new inbox is created, a unique alias is generated:
Alias availability check:

AI Assignment

When aiEnabled: true and agentId is set, every inbound email triggers the AI Employee to generate a response.

Inbound Email Processing Flow


Unread Counts


Prisma Indexes Used


Known Issues / Gotchas

  • Alias uniqueness: alias must be globally unique across ALL organizations (not just within an org). The DB constraint is global.
  • Deleting an inbox: Deleting doesn’t revoke the email alias immediately — emails sent to a deleted alias will bounce. Consider a grace period or soft-delete.
  • AI response sender: Emails are sent FROM {alias}@mail.zappway.ai, not from the customer’s domain. This is a known limitation mentioned in user docs.
  • Knowledge source access: datastoreIds and datasourceIds must belong to the same organization. Cross-org knowledge access is blocked by the permission layer.