accounts.listIdentitiesByActivity
List an account's identities by recent activity.
The account's identities ordered by their latest recorded client activity, newest day first, ties by identity id, identities with no recorded activity last; open one identity's clients for the detail (GET /identities/:identityId/clients). Paged by keyset; a live list, so an identity seen between pages can move ahead of the cursor. A domain-scoped key sees the identities its scope reaches, as the mailbox listing does; its pages are bounded in work, so one may hold fewer than limit identities while more follow. The list ends only when nextCursor is absent.
openemail.accounts.listIdentitiesByActivity(
accountId: string,
options?: AccountsListIdentitiesByActivityOptions,
): PagePromise<AccountsListIdentitiesByActivityResult, IdentityActivity>It calls GET /accounts/{accountId}/activity: List an account's identities by recent activity in the API reference.
Example
for await (const identityActivity of openemail.accounts.listIdentitiesByActivity(accountId)) {
// every item of every page (await the call instead for one page)
}Arguments
| Argument | Type | Description |
|---|---|---|
accountId | string | Account ULID identifier. The path's {accountId}. |
Options
The last argument, options, a AccountsListIdentitiesByActivityOptions, takes:
| Option | Type | Sent as | Description |
|---|---|---|---|
limit | number | query limit | Page size (default 100) |
cursor | string | query cursor | Opaque page cursor from a previous response |
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, AccountsListIdentitiesByActivityResult. Iterated with for await, it is every IdentityActivity of every page, each page fetched as the loop reaches it.
Errors
| Status | What it means |
|---|---|
400 | validation_failed, or invalid_cursor for a cursor that is not one this list issued, or one issued for another account or scope |
401 | unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a WWW-Authenticate: Bearer challenge |
403 | insufficient_scope: a mailbox credential, which is not a directory principal |
404 | Account not found or not accessible to this principal |
503 | temporary_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
AccountsListIdentitiesByActivityResult
/** What `accounts.listIdentitiesByActivity` answers. */
type AccountsListIdentitiesByActivityResult = {
identities: IdentityActivity[]
/** Opaque cursor for the next page; absent on the last page */
nextCursor?: string
}It names these types of the API, each on a page of its own: IdentityActivity.