# 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.

## `GET /api/v1/accounts/{accountId}/activity`

### Path parameters

- `accountId` (string, required) — Account ULID identifier

### Query parameters

- `limit` (integer, ≥ 1, ≤ 200) — Page size (default 100)
- `cursor` (string) — Opaque page cursor from a previous response

### Responses

**200** — Page of identities, most recently active first

`application/json` → object

- `identities` (IdentityActivity[], required)
  - `activityDay` (string | null, required) — The UTC date (YYYY-MM-DD) of the identity's latest recorded client activity; null means no recorded activity. Show it as returned, not converted to a local timezone
  - `id` (string, required) — Identity ULID
  - `primaryAddress` (string | null, required) — The identity's primary address, or null for one without
- `nextCursor` (string) — Opaque cursor for the next page; absent on the last page

**400** — validation_failed, or invalid_cursor for a cursor that is not one this list issued, or one issued for another account or scope

`application/json` → ErrorOrValidation

**401** — unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge

`application/json` → ErrorBody

**403** — insufficient_scope: a mailbox credential, which is not a directory principal

`application/json` → ErrorBody

**404** — Account not found or not accessible to this principal

`application/json` → ErrorBody

**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)

`application/json` → ErrorBody

### Example request

```bash
curl -X GET 'https://api.open.email/api/v1/accounts/{accountId}/activity' \
  -H 'Authorization: Bearer oek_…'
```

## TypeScript SDK

[`openemail.accounts.listIdentitiesByActivity`](/docs/sdks/typescript/accounts/list-identities-by-activity)

```ts
for await (const identityActivity of openemail.accounts.listIdentitiesByActivity(accountId)) {
  // every item of every page (await the call instead for one page)
}
```
