{"record":{"id":"daa7d283079dc0e3","repo":"bitwarden/server","slug":"users-invalid","errorCode":null,"errorMessage":"Users invalid.","messagePattern":"Users invalid\\.","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"src/Api/AdminConsole/Controllers/OrganizationUsersController.cs","lineNumber":776,"sourceCode":"\n    [HttpPatch(\"restore\")]\n    [Obsolete(\"This endpoint is deprecated. Use PUT method instead\")]\n    [Authorize<ManageUsersRequirement>]\n    public async Task<ListResponseModel<OrganizationUserBulkResponseModel>> PatchBulkRestoreAsync(Guid orgId, [FromBody] OrganizationUserBulkRequestModel model)\n    {\n        return await BulkRestoreAsync(orgId, model);\n    }\n\n    [HttpPut(\"enable-secrets-manager\")]\n    [Authorize<ManageUsersRequirement>]\n    public async Task BulkEnableSecretsManagerAsync(Guid orgId,\n        [FromBody] OrganizationUserBulkRequestModel model)\n    {\n        var orgUsers = (await _organizationUserRepository.GetManyAsync(model.Ids))\n            .Where(ou => ou.OrganizationId == orgId && !ou.AccessSecretsManager).ToList();\n        if (orgUsers.Count == 0)\n        {\n            throw new BadRequestException(\"Users invalid.\");\n        }\n\n        var additionalSmSeatsRequired = await _countNewSmSeatsRequiredQuery.CountNewSmSeatsRequiredAsync(orgId, orgUsers.Count);\n        if (additionalSmSeatsRequired > 0)\n        {\n            // Self-hosted instances can't autoscale their Stripe subscription, so reject before touching billing.\n            if (_globalSettings.SelfHosted)\n            {\n                throw new BadRequestException(new V2_UpdateUserCommand.CannotAutoscaleSecretsManagerSeatsOnSelfHost().Message);\n            }\n\n            var organization = await _organizationRepository.GetByIdAsync(orgId);\n            var plan = await _pricingClient.GetPlanOrThrow(organization!.PlanType);\n            var update = new SecretsManagerSubscriptionUpdate(organization, plan, true)\n                .AdjustSeats(additionalSmSeatsRequired);\n            await _updateSecretsManagerSubscriptionCommand.UpdateSubscriptionAsync(update);\n        }\n","sourceCodeStart":758,"sourceCodeEnd":794,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/src/Api/AdminConsole/Controllers/OrganizationUsersController.cs#L758-L794","documentation":"Error \"Users invalid.\" thrown in bitwarden/server.","triggerScenarios":"Thrown when a bulk organization user operation receives one or more user IDs that are invalid, do not belong to the organization, or cannot be processed.","commonSituations":"See trigger scenarios.","solutions":["Verify every user ID in the bulk request exists in the organization; remove stale or malformed IDs.","Fetch the current member list and rebuild the request payload from it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e93b962371d80964556f5590c6615f5160a437a1","analyzedAt":"2026-08-13T14:22:19.382Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}