{"record":{"id":"e676e1f0c2ec249d","repo":"bitwarden/server","slug":"you-cannot-have-a-send-with-a-deletion-date-that-f","errorCode":null,"errorMessage":"You cannot have a Send with a deletion date that far into the future. Adjust the Deletion Date to a value less than 31 days from now and try again.","messagePattern":"You cannot have a Send with a deletion date that far into the future\\. Adjust the Deletion Date to a value less than 31 days from now and try again\\.","errorType":"validation","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"src/Api/Tools/Models/Request/SendRequestModel.cs","lineNumber":226,"sourceCode":"    /// 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            }\n\n            if (DeletionDate.HasValue && ExpirationDate.Value > DeletionDate.Value)\n            {\n                throw new BadRequestException(\n                    \"You cannot have a Send with an expiration date greater than the deletion date. \" +\n                    \"Adjust the expiration date and try again.\");","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/bitwarden/server/blob/e93b962371d80964556f5590c6615f5160a437a1/src/Api/Tools/Models/Request/SendRequestModel.cs#L208-L244","documentation":"Thrown as BadRequestException (HTTP 400) from SendRequestModel.ValidateEdit() when DeletionDate is set and is more than 31 days in the future. The server enforces a hard 31-day maximum lifetime on Sends; a background job deletes them after this window.","triggerScenarios":"Any create/edit Send request where DeletionDate > DateTime.UtcNow.AddDays(31).","commonSituations":"User picks a far-future deletion (e.g. 1 year); client defaults to a very long retention; timezone or year-field input error (e.g. 2099); copy-paste of a long duration.","solutions":["Set DeletionDate to 31 days or less from now.","Cap the client's deletion-date picker maximum at now + 31 days.","Validate the chosen date against the 31-day ceiling before submission.","Check for year/timezone input mistakes producing a distant date."],"exampleFix":"// before\nmodel.DeletionDate = DateTime.UtcNow.AddYears(1); // > 31 days -> 400\n\n// after\nmodel.DeletionDate = DateTime.UtcNow.AddDays(30); // within 31 days","handlingStrategy":"validation","validationCode":"// Client: enforce the 31-day ceiling\nvar now = DateTime.UtcNow;\nif (model.DeletionDate.HasValue && model.DeletionDate.Value > now.AddDays(31)) {\n    ShowUser(\"Deletion date cannot be more than 31 days away.\");\n    return;\n}\nawait client.PostAsync(\"sends\", JsonContent.Create(model));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap the deletion-date picker maximum at now + 31 days.","Validate against the ceiling before submission.","Watch for year/timezone input errors producing far-future dates."],"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"}