Skip to Content

List delivery statuses for a thread or a set of messages.

Batch delivery status, so a thread or a page of the Sent folder costs one request rather than one per message. Exactly one of threadId or messageIds is required. Messages with no delivery record are simply absent from the response — the list is never padded with placeholders. Pages contain at most 100 statuses and may be shorter to fit the response byte budget. Follow nextCursor until absent; cursors expire after one hour.

openemail.deliveries.list(
  mailboxId: string,
  options?: DeliveriesListOptions,
): PagePromise<MessageDeliveryList, MessageDeliveryStatus>

It calls GET /mailboxes/{mailboxId}/deliveries: List delivery statuses for a thread or a set of messages in the API reference.

Example

for await (const messageDeliveryStatus of openemail.deliveries.list(mailboxId)) {
  // every item of every page (await the call instead for one page)
}

Arguments

ArgumentTypeDescription
mailboxIdstringMailbox ULID identifier. The path's {mailboxId}.

Options

The last argument, options, a DeliveriesListOptions, takes:

OptionTypeSent asDescription
threadIdstringquery threadIdConversation thread identifier
limitnumberquery limitMaximum statuses per page; defaults to 100
cursorstringquery cursorContinuation cursor from the preceding page
messageIdsstringquery messageIdsComma-separated message identifiers (at most 100)

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, MessageDeliveryList. Iterated with for await, it is every MessageDeliveryStatus of every page, each page fetched as the loop reaches it.

Errors

StatusWhat it means
400invalid_request for invalid selectors or limit; invalid_cursor for a malformed, expired, or differently scoped cursor
401unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge
404Mailbox not found or not accessible
413delivery_status_too_large: a single delivery status exceeds the response byte budget
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: MessageDeliveryList, MessageDeliveryStatus.