Which tenant is assigned to a thread when a customer belongs to multiple tenants?
Plain picks the tenant in three steps and stops at the first one that finds a match. If none match, threadTenantId is null.
- Explicit tenant. If you pass a
tenantIdentifierinupsertThreadorcreateThread, Plain uses it. The customer must be a member of that tenant, otherwise the call returns athreadCustomerIsNotMemberOfTenanterror. - Tier source tenant. If no
tenantIdentifieris given, Plain finds the thread's tier and checks whether that tier traces back to exactly one non-domain tenant the customer belongs to. If it does, that tenant is set on the thread. - Sole membership. Otherwise, if the customer belongs to exactly one non-domain tenant, Plain uses that tenant.
Set the tenant after creation
Use the updateThreadTenant GraphQL mutation to set or change the tenant on an existing thread. The customer must be a member of the target tenant.
Domain-based tenants
Domain-based tenants are never set as a thread's tenant. They are excluded from the sole membership step and from updateThreadTenant, but they still count towards finding the tier. You can turn domain-based tenants on or off without breaking thread references.
SLAs and tiers
Tiers and SLAs do not depend on the thread tenant. Even when threadTenantId is null, Plain evaluates tiers across all of the customer's tenants and companies and applies the highest-priority one. SLAs apply whether or not a tenant is set on the thread.