gitroomhq/postiz-app · error · HttpException
'The organization plan does not include team members'
Error message
'The organization plan does not include team members'
What it means
Thrown as HTTP 400 when adding a team member by email if the organization's subscription tier (pricing[tier].team_members) does not include team member functionality. Without STRIPE_PUBLISHABLE_KEY set, tier defaults to ULTIMATE so this only fires on billing-enabled deployments.
Source
Thrown at libraries/nestjs-libraries/src/database/prisma/organizations/organization.service.ts:112
? `${user.name} (${user.email})`
: user.email;
await this._notificationsService.sendEmail(
body.email,
`${user.name || user.email} invited you to join "${org.name}"`,
`${inviter} has invited you to join the "${org.name}" team.<br /><a href="${url}">Accept the invitation</a> to get started.<br />The link will expire in 2 days.`
);
}
return { url };
}
async addTeamMemberByEmail(org: Organization, body: AdminAddTeamMemberDto) {
const tier =
// @ts-ignore
org?.subscription?.subscriptionTier ||
(!process.env.STRIPE_PUBLISHABLE_KEY ? 'ULTIMATE' : 'FREE');
if (!pricing[tier].team_members) {
throw new HttpException(
'The organization plan does not include team members',
400
);
}
const users = await this._organizationRepository.getUsersByEmail(
body.email
);
if (!users.length) {
throw new HttpException('No Postiz account found for this email', 400);
}
if (users.length > 1) {
throw new HttpException(
'Multiple accounts exist for this email (different login providers)',
400
);
}View on GitHub (pinned to 0f1647f749)
Solutions
- Upgrade the organization to a plan that includes team members before inviting
- Verify org.subscription.subscriptionTier reflects the actual plan — refresh/re-sync the subscription if it's stale
- Check the pricing configuration includes the tier key being looked up (avoid undefined crashes that look like this error)
Defensive patterns
Strategy: validation
Validate before calling
const tier = org?.subscription?.subscriptionTier ?? 'FREE';
if (!pricing[tier]?.team_members) {
throw new Error('Upgrade required: plan lacks team members');
} Type guard
const planSupportsTeamMembers = (tier: string): boolean => !!pricing[tier]?.team_members;
Try / catch
try { await addTeamMember(orgId, email); } catch (e) { if (/does not include team members/.test(e.message)) { showUpgradePrompt(); return; } throw e; } Prevention
- Gate the invite UI on the plan's team_members flag
- Re-sync subscription tier after plan changes
When it happens
Trigger: Calling addTeamMemberByEmail for an org on a FREE/lower tier whose pricing plan lacks team_members, where org.subscription.subscriptionTier resolves to that tier.
Common situations: Free-tier org attempting to invite collaborators; subscription downgraded but invite UI still shown; stale subscriptionTier on the org record after a plan change; custom pricing config missing the tier.
Related errors
- Unauthorized
- No Postiz account found for this email
- Multiple accounts exist for this email (different login prov
- User is already a member of this organization
- Could not add the user to the organization
AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27).
Data as JSON: /api/errors/c23736811cf417a1.
Report an issue: GitHub.