{"record":{"id":"b18de4d5901249c3","repo":"bitwarden/server","slug":"ciphers-were-not-unarchived-ensure-the-provided-i","errorCode":null,"errorMessage":"Ciphers were not unarchived. Ensure the provided ID is correct and you have permission to archive it.","messagePattern":"Ciphers were not unarchived\\. Ensure the provided ID is correct and you have permission to archive it\\.","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"src/Api/Vault/Controllers/CiphersController.cs","lineNumber":1120,"sourceCode":"\n    [HttpPut(\"unarchive\")]\n    public async Task<ListResponseModel<CipherResponseModel>> PutUnarchiveMany([FromBody] CipherBulkUnarchiveRequestModel model)\n    {\n        if (!_globalSettings.SelfHosted && model.Ids.Count() > 500)\n        {\n            throw new BadRequestException(\"You can only unarchive up to 500 items at a time.\");\n        }\n\n        var userId = _userService.GetProperUserId(User).Value;\n        var user = await _userService.GetUserByPrincipalAsync(User);\n\n        var cipherIdsToUnarchive = new HashSet<Guid>(model.Ids);\n\n        var unarchivedCipherOrganizationDetails = await _unarchiveCiphersCommand.UnarchiveManyAsync(cipherIdsToUnarchive, userId);\n\n        if (unarchivedCipherOrganizationDetails.Count == 0)\n        {\n            throw new BadRequestException(\"Ciphers were not unarchived. Ensure the provided ID is correct and you have permission to archive it.\");\n        }\n\n        var organizationAbilities = await GetOrganizationAbilitiesAsync(unarchivedCipherOrganizationDetails);\n        var responses = unarchivedCipherOrganizationDetails.Select(cipher =>\n            new CipherResponseModel(cipher, user, GetOrganizationAbility(cipher, organizationAbilities), _globalSettings)).ToArray();\n\n        return new ListResponseModel<CipherResponseModel>(responses);\n    }\n\n    [HttpPut(\"{id}/restore\")]\n    public async Task<CipherResponseModel> PutRestore(Guid id)\n    {\n        var user = await _userService.GetUserByPrincipalAsync(User);\n        var cipher = await GetByIdAsync(id, user.Id);\n        if (cipher == null)\n        {\n            throw new NotFoundException();\n        }","sourceCodeStart":1102,"sourceCodeEnd":1138,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/src/Api/Vault/Controllers/CiphersController.cs#L1102-L1138","documentation":"Error \"Ciphers were not unarchived. Ensure the provided ID is correct and you have permission to archive it.\" thrown in bitwarden/server.","triggerScenarios":"Thrown when a bulk unarchive request completes without unarchiving any ciphers, because none of the supplied IDs matched archived ciphers the user has permission to modify.","commonSituations":"See trigger scenarios.","solutions":["Verify the cipher IDs are correct and belong to your vault or a collection you can manage.","Re-sync the vault, then retry the unarchive with the current IDs.","Confirm you have edit/manage permission on the collection containing the items."],"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"}