Skip to Content

List an account's limit incidents.

The account's own limit episodes (enforced refusals only — shadow would-refuses are operator-facing), newest first: which limit fired, at what scope, when, and whether a notice was delivered to the account's notice mailbox.

openemail.accounts.listLimitIncidents(
  accountId: string,
  options?: AccountsListLimitIncidentsOptions,
): PagePromise<AccountsListLimitIncidentsResult, LimitIncident>

It calls GET /accounts/{accountId}/limit-incidents: List an account's limit incidents in the API reference.

Example

for await (const limitIncident of openemail.accounts.listLimitIncidents(accountId)) {
  // every item of every page (await the call instead for one page)
}

Arguments

ArgumentTypeDescription
accountIdstringAccount ULID identifier. The path's {accountId}.

Options

The last argument, options, a AccountsListLimitIncidentsOptions, takes:

OptionTypeSent asDescription
sincenumberquery sinceOnly episodes that opened at or after this instant (ms since epoch). Default: the last 7 days
beforenumberquery beforeLegacy exclusive timestamp bound (ms since epoch). This skips every row tied at that instant; use nextCursor/cursor for lossless paging
cursorstringquery cursorOpaque nextCursor from the previous page. Preserves tied timestamps and the original since bound; repeat the same direction, shadow, account and near filters. Require the unchanged cursor echo in the response: an older Worker ignores this parameter
direction('send' | 'recv' | 'forward' | 'storage' | 'mint')query directionNarrow to one limit family
limitnumberquery limitPage size (default 100, max 500)

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

Errors

StatusWhat it means
401unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge
404Account not found or not accessible to this principal
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

AccountsListLimitIncidentsResult

/** What `accounts.listLimitIncidents` answers. */
type AccountsListLimitIncidentsResult = {
  /** Present exactly when the request supplied cursor, echoed unchanged. Require this echo when paging: an older Worker ignores the unknown cursor and could return the newest page again */
  cursor?: string
  incidents: LimitIncident[]
  /** Opaque position for the next older page; absent when this read found no further row. Use cursor, repeating the same filters */
  nextCursor?: string
}

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