{"record":{"id":"6a3b98942f602f1e","repo":"bitwarden/server","slug":"you-can-only-restore-up-to-500-items-at-a-time","errorCode":null,"errorMessage":"You can only restore up to 500 items at a time.","messagePattern":"You can only restore up to 500 items at a time\\.","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"src/Api/Vault/Controllers/CiphersController.cs","lineNumber":1168,"sourceCode":"    {\n        var userId = _userService.GetProperUserId(User).Value;\n        var cipher = await GetByIdAsyncAdmin(id);\n        if (cipher == null || !cipher.OrganizationId.HasValue ||\n            !await CanDeleteOrRestoreCipherAsAdminAsync(cipher.OrganizationId.Value, new[] { cipher.Id }))\n        {\n            throw new NotFoundException();\n        }\n\n        await _cipherService.RestoreAsync(new CipherDetails(cipher), userId, true);\n        return new CipherMiniResponseModel(cipher, _globalSettings, cipher.OrganizationUseTotp);\n    }\n\n    [HttpPut(\"restore\")]\n    public async Task<ListResponseModel<CipherMiniResponseModel>> PutRestoreMany([FromBody] CipherBulkRestoreRequestModel model)\n    {\n        if (!_globalSettings.SelfHosted && model.Ids.Count() > 500)\n        {\n            throw new BadRequestException(\"You can only restore up to 500 items at a time.\");\n        }\n\n        var userId = _userService.GetProperUserId(User).Value;\n        var cipherIdsToRestore = new HashSet<Guid>(model.Ids.Select(i => new Guid(i)));\n\n        var restoredCiphers = await _cipherService.RestoreManyAsync(cipherIdsToRestore, userId);\n        var responses = restoredCiphers.Select(c => new CipherMiniResponseModel(c, _globalSettings, c.OrganizationUseTotp));\n        return new ListResponseModel<CipherMiniResponseModel>(responses);\n    }\n\n    [HttpPut(\"restore-admin\")]\n    public async Task<ListResponseModel<CipherMiniResponseModel>> PutRestoreManyAdmin([FromBody] CipherBulkRestoreRequestModel model)\n    {\n        if (!_globalSettings.SelfHosted && model.Ids.Count() > 500)\n        {\n            throw new BadRequestException(\"You can only restore up to 500 items at a time.\");\n        }\n","sourceCodeStart":1150,"sourceCodeEnd":1186,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/src/Api/Vault/Controllers/CiphersController.cs#L1150-L1186","documentation":"Error \"You can only restore up to 500 items at a time.\" thrown in bitwarden/server.","triggerScenarios":"Thrown when a restore request includes more than 500 cipher IDs in a single bulk restore operation.","commonSituations":"See trigger scenarios.","solutions":["Split the restore request into batches of 500 items or fewer.","Use the vault purge or bulk management UI options for very large restore operations."],"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"}