bitwarden/server · error · BadRequestException
No ciphers were archived. Ensure the provided IDs are correc
Error message
No ciphers were archived. Ensure the provided IDs are correct and you have permission to archive them.
What it means
PUT /ciphers/archive (PutArchiveMany) runs ArchiveManyAsync over the submitted id set; if none of the ids could be archived (all wrong, not owned, lacking permission, or already archived/deleted), the server returns HTTP 400.
Source
Thrown at src/Api/Vault/Controllers/CiphersController.cs:916
[HttpPut("archive")]
public async Task<ListResponseModel<CipherResponseModel>> PutArchiveMany([FromBody] CipherBulkArchiveRequestModel model)
{
if (!_globalSettings.SelfHosted && model.Ids.Count() > 500)
{
throw new BadRequestException("You can only archive up to 500 items at a time.");
}
var userId = _userService.GetProperUserId(User).Value;
var user = await _userService.GetUserByPrincipalAsync(User);
var cipherIdsToArchive = new HashSet<Guid>(model.Ids);
var archivedCiphers = await _archiveCiphersCommand.ArchiveManyAsync(cipherIdsToArchive, userId);
if (archivedCiphers.Count == 0)
{
throw new BadRequestException("No ciphers were archived. Ensure the provided IDs are correct and you have permission to archive them.");
}
var organizationAbilities = await GetOrganizationAbilitiesAsync(archivedCiphers);
var responses = archivedCiphers.Select(cipher =>
new CipherResponseModel(cipher, user, GetOrganizationAbility(cipher, organizationAbilities), _globalSettings)).ToArray();
return new ListResponseModel<CipherResponseModel>(responses);
}
[HttpDelete("{id}")]
public async Task Delete(Guid id)
{
var userId = _userService.GetProperUserId(User).Value;
var cipher = await GetByIdAsync(id, userId);
if (cipher == null)
{
throw new NotFoundException();
}View on GitHub (pinned to e93b962371)
Solutions
- Re-sync the vault and submit only ids you own or can edit that are not already archived.
- Filter out already-archived/deleted ids before sending.
- For org ciphers, confirm edit permission on the relevant collections.
Defensive patterns
Strategy: validation
Validate before calling
async function safeBulkArchive(ids) {
const valid = await filterOwnedEditableNotArchived(ids);
if (valid.length === 0) throw new Error('No archivable ciphers in the submitted set');
return api.put('/ciphers/archive', { ids: valid });
} Type guard
function hasAnyArchivable(ciphers: { editable?: boolean; deletedDate?: string | null }[]): boolean {
return ciphers.some(c => c.editable === true && !c.deletedDate);
} Prevention
- Filter out already-archived/deleted and unowned ids before bulk archive.
- Re-sync the vault before bulk operations on stale snapshots.
- Confirm edit permission for org ciphers in the set.
When it happens
Trigger: A bulk PUT /ciphers/archive where every submitted id is invalid, unowned, uneditable, or already archived.
Common situations: Bulk-archiving ids from a stale vault snapshot; archiving org ciphers without edit rights; mixing in already-archived ids.
Related errors
- Cipher was not archived. Ensure the provided ID is correct a
- You can only archive up to 500 items at a time.
- You can only delete up to 500 items at a time. Consider usin
- You can only delete up to 500 items at a time.
- Cipher was not unarchived. Ensure the provided ID is correct
AI-assisted analysis of bitwarden/server@e93b962371 (2026-08-13).
Data as JSON: /api/errors/bd01b3765db651b4.
Report an issue: GitHub.