DocumentationMulti-tenant

Multi-tenant

X-Tenant-Id header and data isolation.

MailingCore is multi-tenant: each organization (tenant) has isolated data — domains, templates, logs, contacts, and independent quotas.

Required header

On almost all routes (except public auth and health):

X-Tenant-Id: clxxxxxxxxxxxxxxxx

Get IDs with GET /tenants after authenticating with JWT. The dashboard stores the selected tenant and sends it automatically.

Isolation

  • An admin only accesses tenants where they are a member
  • API keys belong to one tenant; they do not cross data between organizations
  • Prisma queries filter by tenantId on every operation

Members and roles

ActionEndpoint
List membersGET /tenants/:id/members
InvitePOST /tenants/:id/members
Change rolePATCH /tenants/:id/members/:adminId
RemoveDELETE /tenants/:id/members/:adminId