Skip to Content

List vanished (expunged) message UIDs.

Returns UIDs of messages expunged from the label since a specified change sequence (MODSEQ) number.

openemail.labels.listVanished(
  mailboxId: string,
  label: string,
  options?: LabelsListVanishedOptions,
): PagePromise<VanishedResult, number>

It calls GET /mailboxes/{mailboxId}/labels/{label}/vanished: List vanished (expunged) message UIDs in the API reference.

Example

for await (const result of openemail.labels.listVanished(mailboxId, label)) {
  // every item of every page (await the call instead for one page)
}

Arguments

ArgumentTypeDescription
mailboxIdstringMailbox ULID identifier. The path's {mailboxId}.
labelstringLabel or folder name (e.g. INBOX, Archive, custom). The path's {label}.

Options

The last argument, options, a LabelsListVanishedOptions, takes:

OptionTypeSent asDescription
changedSincenumberquery changedSinceFind UIDs expunged after this MODSEQ change sequence number
limitnumberquery limitMaximum UIDs to return per page (max 2000)
cursorstringquery cursorPagination cursor for next page

Every call also takes signal, timeout, retry and headers, which say how that one call is sent (call options).

Answer

It is a listing, a PagePromise. Awaited, it is one page as the API answers it, VanishedResult. Iterated with for await, it is every number of every page, each page fetched as the loop reaches it.

Errors

StatusWhat it means
400validation_failed — malformed query
401unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge
404Mailbox or label not found
410cannot_calculate_changes — requested modseq predates change tracking window
503temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description)

A failed call rejects with a RequestError: its status, and its code, the API's error. Decide on the code: one status covers several.

Types

It names these types of the API, each on a page of its own: VanishedResult.