bitwarden/server · error · BadRequestException

You cannot have a Send with a deletion date in the past. Adj

Error message

You cannot have a Send with a deletion date in the past. Adjust the deletion date and try again.

What it means

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).

Source

Thrown at src/Api/Tools/Models/Request/SendRequestModel.cs:220

    }

    /// <summary>
    /// Validates that the request is internally consistent for send administration.
    /// </summary>
    /// <exception cref="BadRequestException">
    /// Thrown when the send's deletion date has already expired or when its
    /// expiration occurs after its deletion.
    /// </exception>
    public void ValidateEdit()
    {
        var now = DateTime.UtcNow;
        // Add 1 minute for a sane buffer and client clock float
        var nowPlus1Minute = now.AddMinutes(1);
        if (DeletionDate.HasValue)
        {
            if (DeletionDate.Value <= nowPlus1Minute)
            {
                throw new BadRequestException("You cannot have a Send with a deletion date in the past. " +
                                              "Adjust the deletion date and try again.");
            }

            if (DeletionDate.Value > now.AddDays(31))
            {
                throw new BadRequestException("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.");
            }
        }

        if (ExpirationDate.HasValue)
        {
            if (ExpirationDate.Value <= nowPlus1Minute)
            {
                throw new BadRequestException("You cannot have a Send with an expiration date in the past. " +
                                              "Adjust the expiration date and try again.");
            }

View on GitHub (pinned to e93b962371)

Solutions

  1. Set DeletionDate to a future value (now + at least a few minutes, max 31 days).
  2. Transmit DeletionDate in UTC.
  3. Respect the 1-minute skew buffer.
  4. Default the client's deletion-date picker to a sane future window (e.g. 7 days).

Example fix

// before
model.DeletionDate = DateTime.Now; // local, within buffer -> 400

// after
model.DeletionDate = DateTime.UtcNow.AddDays(7); // UTC, future
Defensive patterns

Strategy: validation

Validate before calling

// Client: validate deletion date before submit
var now = DateTime.UtcNow;
if (model.DeletionDate.HasValue && model.DeletionDate.Value <= now.AddMinutes(1)) {
    ShowUser("Deletion date must be in the future.");
    return;
}
await client.PostAsync("sends", JsonContent.Create(model));

Prevention

When it happens

Trigger: Any create/edit Send request where DeletionDate <= DateTime.UtcNow.AddMinutes(1).

Common situations: 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.

Related errors


AI-assisted analysis of bitwarden/server@e93b962371 (2026-08-13). Data as JSON: /api/errors/fc6e9430d532a142. Report an issue: GitHub.