{"record":{"id":"164264961b518c61","repo":"n8n-io/n8n","slug":"maximum-number-of-users-reached-164264","errorCode":null,"errorMessage":"Maximum number of users reached","messagePattern":"Maximum number of users reached","errorType":"exception","errorClass":"ForbiddenError","httpStatus":403,"severity":"warning","filePath":"packages/cli/src/controllers/invitation.controller.ts","lineNumber":66,"sourceCode":"\t) {\n\t\tif (invitations.length === 0) return [];\n\n\t\tconst isWithinUsersLimit = this.license.isWithinUsersLimit();\n\n\t\tif (isSsoCurrentAuthenticationMethod()) {\n\t\t\tthis.logger.debug(\n\t\t\t\t'SSO is enabled, so users are managed by the Identity Provider and cannot be added through invites',\n\t\t\t);\n\t\t\tthrow new BadRequestError(\n\t\t\t\t'SSO is enabled, so users are managed by the Identity Provider and cannot be added through invites',\n\t\t\t);\n\t\t}\n\n\t\tif (!isWithinUsersLimit) {\n\t\t\tthis.logger.debug(\n\t\t\t\t'Request to send email invite(s) to user(s) failed because the user limit quota has been reached',\n\t\t\t);\n\t\t\tthrow new ForbiddenError(RESPONSE_ERROR_MESSAGES.USERS_QUOTA_REACHED);\n\t\t}\n\n\t\tif (!(await this.ownershipService.hasInstanceOwner())) {\n\t\t\tthis.logger.debug(\n\t\t\t\t'Request to send email invite(s) to user(s) failed because the owner account is not set up',\n\t\t\t);\n\t\t\tthrow new BadRequestError('You must set up your own account before inviting others');\n\t\t}\n\n\t\tconst attributes = invitations.map(({ email, role }) => {\n\t\t\tif (role === 'global:admin' && !this.license.isAdvancedPermissionsLicensed()) {\n\t\t\t\tthrow new ForbiddenError(\n\t\t\t\t\t'Cannot invite admin user without advanced permissions. Please upgrade to a license that includes this feature.',\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn { email, role };\n\t\t});\n","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/controllers/invitation.controller.ts#L48-L84","documentation":"A ForbiddenError (HTTP 403) thrown when this.license.isWithinUsersLimit() returns false at invite time. The message comes from the shared constant RESPONSE_ERROR_MESSAGES.USERS_QUOTA_REACHED ('Maximum number of users reached'). The license seats or the hard user cap has been exhausted, so no new invited users can be created.","triggerScenarios":"POST /invite when the active license's seat count is at or above the limit, or when running without a license and the free-tier active-user cap is reached. Checked after the SSO block, before the owner-exists check.","commonSituations":"Self-hosted instance on a fixed-seat enterprise license that has been fully assigned; Cloud plan at its user cap; team grew beyond the purchased tier; deactivated-but-not-deleted users still counting against the quota.","solutions":["Upgrade the license to add more seats, or remove/deactivate existing users to free seats.","Audit active users via the Admin UI > Users and delete users who no longer need access.","If on Cloud, increase the plan tier in the billing portal.","Re-check with this.license.isWithinUsersLimit() (or GET /license) before retrying the invite."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify seat availability before inviting.\nconst license = await api.get('/license');\nif (license.seatsUsed >= license.seatsLimit) {\n  throw new Error('User quota reached — upgrade or remove users.');\n}","typeGuard":"function hasFreeSeats(l: { seatsUsed: number; seatsLimit: number }): boolean {\n  return l.seatsUsed < l.seatsLimit;\n}","tryCatchPattern":"try {\n  await api.post('/invite', invites);\n} catch (e) {\n  if (e.response?.status === 403 && /quota/i.test(e.response.data.message)) {\n    promptUpgradeOrCleanup();\n    return;\n  }\n  throw e;\n}","preventionTips":["Monitor seat usage against the license limit.","Deactivate departed users so seats are freed.","Upgrade the license tier before headcount exceeds the cap."],"tags":["invitations","license","quota","rest-api","forbidden"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}