{"record":{"id":"fc6e9430d532a142","repo":"bitwarden/server","slug":"you-cannot-have-a-send-with-a-deletion-date-in-the","errorCode":null,"errorMessage":"You cannot have a Send with a deletion date in the past. Adjust the deletion date and try again.","messagePattern":"You cannot have a Send with a deletion date in the past\\. Adjust the deletion date and try again\\.","errorType":"validation","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"src/Api/Tools/Models/Request/SendRequestModel.cs","lineNumber":220,"sourceCode":"    }\n\n    /// <summary>\n    /// Validates that the request is internally consistent for send administration.\n    /// </summary>\n    /// <exception cref=\"BadRequestException\">\n    /// Thrown when the send's deletion date has already expired or when its\n    /// expiration occurs after its deletion.\n    /// </exception>\n    public void ValidateEdit()\n    {\n        var now = DateTime.UtcNow;\n        // Add 1 minute for a sane buffer and client clock float\n        var nowPlus1Minute = now.AddMinutes(1);\n        if (DeletionDate.HasValue)\n        {\n            if (DeletionDate.Value <= nowPlus1Minute)\n            {\n                throw new BadRequestException(\"You cannot have a Send with a deletion date in the past. \" +\n                                              \"Adjust the deletion date and try again.\");\n            }\n\n            if (DeletionDate.Value > now.AddDays(31))\n            {\n                throw new BadRequestException(\"You cannot have a Send with a deletion date that far \" +\n                                              \"into the future. Adjust the Deletion Date to a value less than 31 days from now \" +\n                                              \"and try again.\");\n            }\n        }\n\n        if (ExpirationDate.HasValue)\n        {\n            if (ExpirationDate.Value <= nowPlus1Minute)\n            {\n                throw new BadRequestException(\"You cannot have a Send with an expiration date in the past. \" +\n                                              \"Adjust the expiration date and try again.\");\n            }","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/src/Api/Tools/Models/Request/SendRequestModel.cs#L202-L238","documentation":"Thrown as BadRequestException (HTTP 400) from SendRequestModel.ValidateEdit() when DeletionDate is set and is at or before (now + 1 minute). The deletion date must be in the future; a Send cannot be saved with a deletion date already elapsed. ValidateEdit() runs on both create (via ValidateCreation) and edit (PUT).","triggerScenarios":"Any create/edit Send request where DeletionDate <= DateTime.UtcNow.AddMinutes(1).","commonSituations":"Client clock skew; user picks a default deletion in the past; timezone bug sending local time as UTC; long delay before submission; editing a Send whose deletion date was set near the original creation boundary.","solutions":["Set DeletionDate to a future value (now + at least a few minutes, max 31 days).","Transmit DeletionDate in UTC.","Respect the 1-minute skew buffer.","Default the client's deletion-date picker to a sane future window (e.g. 7 days)."],"exampleFix":"// before\nmodel.DeletionDate = DateTime.Now; // local, within buffer -> 400\n\n// after\nmodel.DeletionDate = DateTime.UtcNow.AddDays(7); // UTC, future","handlingStrategy":"validation","validationCode":"// Client: validate deletion date before submit\nvar now = DateTime.UtcNow;\nif (model.DeletionDate.HasValue && model.DeletionDate.Value <= now.AddMinutes(1)) {\n    ShowUser(\"Deletion date must be in the future.\");\n    return;\n}\nawait client.PostAsync(\"sends\", JsonContent.Create(model));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Send DeletionDate in UTC.","Default the picker to a sensible future window (e.g. 7 days).","Respect the 1-minute skew buffer in client checks."],"tags":["send","http-400","validation","datetime","deletion-date","bitwarden-server"],"backgroundTag":null,"analyzedSha":"e93b962371d80964556f5590c6615f5160a437a1","analyzedAt":"2026-08-13T14:22:19.382Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}