{"record":{"id":"c23736811cf417a1","repo":"gitroomhq/postiz-app","slug":"the-organization-plan-does-not-include-team-membe","errorCode":null,"errorMessage":"'The organization plan does not include team members'","messagePattern":"'The organization plan does not include team members'","errorType":"http","errorClass":"HttpException","httpStatus":400,"severity":"error","filePath":"libraries/nestjs-libraries/src/database/prisma/organizations/organization.service.ts","lineNumber":112,"sourceCode":"        ? `${user.name} (${user.email})`\n        : user.email;\n      await this._notificationsService.sendEmail(\n        body.email,\n        `${user.name || user.email} invited you to join \"${org.name}\"`,\n        `${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.`\n      );\n    }\n    return { url };\n  }\n\n  async addTeamMemberByEmail(org: Organization, body: AdminAddTeamMemberDto) {\n    const tier =\n      // @ts-ignore\n      org?.subscription?.subscriptionTier ||\n      (!process.env.STRIPE_PUBLISHABLE_KEY ? 'ULTIMATE' : 'FREE');\n\n    if (!pricing[tier].team_members) {\n      throw new HttpException(\n        'The organization plan does not include team members',\n        400\n      );\n    }\n\n    const users = await this._organizationRepository.getUsersByEmail(\n      body.email\n    );\n    if (!users.length) {\n      throw new HttpException('No Postiz account found for this email', 400);\n    }\n\n    if (users.length > 1) {\n      throw new HttpException(\n        'Multiple accounts exist for this email (different login providers)',\n        400\n      );\n    }","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/database/prisma/organizations/organization.service.ts#L94-L130","documentation":"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.","triggerScenarios":"Calling addTeamMemberByEmail for an org on a FREE/lower tier whose pricing plan lacks team_members, where org.subscription.subscriptionTier resolves to that tier.","commonSituations":"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.","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)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const tier = org?.subscription?.subscriptionTier ?? 'FREE';\nif (!pricing[tier]?.team_members) {\n  throw new Error('Upgrade required: plan lacks team members');\n}","typeGuard":"const planSupportsTeamMembers = (tier: string): boolean => !!pricing[tier]?.team_members;","tryCatchPattern":"try { await addTeamMember(orgId, email); } catch (e) { if (/does not include team members/.test(e.message)) { showUpgradePrompt(); return; } throw e; }","preventionTips":["Gate the invite UI on the plan's team_members flag","Re-sync subscription tier after plan changes"],"tags":["billing","team-members","subscription-tier","plan-limit"],"backgroundTag":"plan-feature-not-included","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}