---
title: "Bulk delete inbox messages as a background job"
method: POST
path: "/v1/inbox/bulk-delete/async"
tags: ["Inbox"]
---

# Bulk delete inbox messages as a background job

`POST /v1/inbox/bulk-delete/async`

## Request

- Base URL: `https://api.winnr.app`
- URL: `https://api.winnr.app/v1/inbox/bulk-delete/async`
- Auth: HTTP bearer

Same request body as `/v1/inbox/bulk-delete`, but the delete runs as a
background job and the call returns immediately with a job id.

Prefer this for large selections. The delete uses one IMAP connection
per mailbox, so a selection spanning many mailboxes can run for
minutes — longer than the 30s API Gateway request limit, which would
return a gateway timeout even though the delete completes. The job runs
with a 15 minute budget instead.

Poll `GET /v1/jobs/{job_id}`. While running, `progress.delete` reads
like `"12/40 mailboxes"`. On completion `result` carries the same shape
the synchronous endpoint returns: `deleted`, `failed`, `errors`.

## Request body

- object
  - `messages` object[], required
    - `uid` string, required: IMAP message UID.
    - `mailbox` string, email, required: Mailbox the message belongs to.

## Response `200`

Job accepted and started

- object
  - `meta` Meta
    - `request_id` string
    - `timestamp` string, date-time
  - `data` object
    - `job_id` string
    - `status` string
    - `total` integer: Messages queued for deletion.
    - `mailboxes` integer: Distinct mailboxes the job will connect to.

## Other responses

- `400`: Invalid request
- `502`: The job could not be started. Nothing was deleted.

---

[API](https://skmtc.dev/winnr/apis/winnr-api.md) · [All operations](https://skmtc.dev/winnr/apis/winnr-api/llms.txt) · [OpenAPI document](https://skmtc.dev/winnr/apis/winnr-api/revisions/a4f960beb1eb?raw)
