# Types (/docs/reference/types)

> The core TypeScript types of Better IAM, what each one represents, and their exact fields, generated from the published declarations.



You will meet a handful of types over and over: the policy document you write, the decision you get back, the
request you pass to `iam.require`, and the tenant, identity, and session records the API returns. This page
explains what each one represents and when you handle it, followed by its exact fields.

> **Always in sync with the code.** 
  The tables are generated from the packages' `.d.ts` files every time the site builds, so field names,
  optionality, and doc comments match the code you install. Select a type in a table to see its full definition.

## Policy documents [#policy-documents]

A policy is a JSON document you store with `policies.create` or attach to a role. It holds
up to 128 statements; each statement allows or denies some actions on some resource
patterns, optionally only when its conditions hold. Better IAM validates every document
with `validatePolicy` before storing it and again before evaluating it, so a malformed or hand-edited document can
never change a decision. See [Policies](/docs/authorization/policies) and try documents in the
[playground](/playground).

<TypeTable
  id="type-table-policy.d.ts-PolicyDocument"
  type="{
  &#x22;id&#x22;: &#x22;policy.d.ts-PolicyDocument&#x22;,
  &#x22;name&#x22;: &#x22;PolicyDocument&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;version&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;1&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;1&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;statements&#x22;,
      &#x22;description&#x22;: &#x22;The policy's statements. Each allows or denies actions on resource patterns, optionally under conditions.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;PolicyStatement[]&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

`PolicyStatement` is one rule. `effect` is `allow` or `deny`; `actions` and `resources` are glob patterns where `*`
matches any run of characters and `?` exactly one; `conditions` maps an operator (such as `StringEquals`) to the
context keys it tests. `sid` is an optional name that shows up in decision traces.

<TypeTable
  id="type-table-policy.d.ts-PolicyStatement"
  type="{
  &#x22;id&#x22;: &#x22;policy.d.ts-PolicyStatement&#x22;,
  &#x22;name&#x22;: &#x22;PolicyStatement&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;sid&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;effect&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;\&#x22;allow\&#x22; | \&#x22;deny\&#x22;&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;actions&#x22;,
      &#x22;description&#x22;: &#x22;Action names or patterns, such as `documents:*`.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string[]&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;resources&#x22;,
      &#x22;description&#x22;: &#x22;Resource patterns such as `document/*`, where `*` matches any run of characters.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string[]&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;conditions&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;Partial<Record<ConditionOperator, Record<string, ConditionValue[] | ConditionValue>>> | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;Partial<Record<ConditionOperator, Record<string, union>>>&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

### Decisions [#decisions]

A `Decision` is the answer to "may this principal perform this action on this resource?". `allowed` is the verdict,
`reason` says why: the policy engine's `allowed`, `explicit-deny`, `no-grant`, or `boundary-deny`, or a platform
reason decided before any policy is read, such as `TENANT_INACTIVE` (the tenant is suspended), `TENANT_MISMATCH`
(the credential belongs to another tenant), `ROOT_OVERRIDE` (a platform root administrator), `IMPERSONATOR_DENIED`
(a "view as" session asked for more than the administrator may do), `CLEARANCE_REQUIRED` (with
[security clearances](/docs/features/security-clearances): the resource's classification label is above the session's
clearance), or `CREDENTIAL_AUTHORITY_REVOKED`. `matched`
lists the statements that matched. Server calls strip `matched` before
returning decisions to callers so they do not leak policy contents.

<TypeTable
  id="type-table-policy.d.ts-Decision"
  type="{
  &#x22;id&#x22;: &#x22;policy.d.ts-Decision&#x22;,
  &#x22;name&#x22;: &#x22;Decision&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;allowed&#x22;,
      &#x22;description&#x22;: &#x22;Whether the request is allowed.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;reason&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;matched&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string[]&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

## Authorization requests [#authorization-requests]

`AuthorizationRequest` is what you pass to `iam.authorize` (which returns a `Decision`) and `iam.require` (which
throws `ACCESS_DENIED` instead). It names the tenant, the action, and the resource, and carries the caller's
credential: pass the incoming request's `headers` (which contain the session cookie or bearer token) or a raw
`token`. Load the resource's identity from your own trusted storage, never from the request body.

<TypeTable
  id="type-table-options.d.ts-AuthorizationRequest"
  type="{
  &#x22;id&#x22;: &#x22;options.d.ts-AuthorizationRequest&#x22;,
  &#x22;name&#x22;: &#x22;AuthorizationRequest&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;tenantId&#x22;,
      &#x22;description&#x22;: &#x22;The tenant (organization or project) the record belongs to, or the call acts in.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;action&#x22;,
      &#x22;description&#x22;: &#x22;An action name, such as `documents:read`.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;resource&#x22;,
      &#x22;description&#x22;: &#x22;The resource the request is about: its `type` and `id`.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;{ type: string; id: string; }&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;headers&#x22;,
      &#x22;description&#x22;: &#x22;HTTP request headers carrying the caller's session cookie or `Authorization: Bearer` token.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;HeadersInit | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;token&#x22;,
      &#x22;description&#x22;: &#x22;A one-time token from a delivered link, or a bearer token, depending on the call.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

`CredentialInput` is the first argument of every `iam.api` method: who is calling. The same shape is embedded in
`AuthorizationRequest`.

<TypeTable
  id="type-table-index.d.ts-CredentialInput"
  type="{
  &#x22;id&#x22;: &#x22;index.d.ts-CredentialInput&#x22;,
  &#x22;name&#x22;: &#x22;CredentialInput&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;headers&#x22;,
      &#x22;description&#x22;: &#x22;HTTP request headers carrying the caller's session cookie or `Authorization: Bearer` token.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;HeadersInit | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;token&#x22;,
      &#x22;description&#x22;: &#x22;A one-time token from a delivered link, or a bearer token, depending on the call.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

## Tenants [#tenants]

A tenant is an account in the tenant tree: the platform root, an organization, or a project
inside one. `type` must be allowed as a child of the parent's type by the `hierarchy` option, `slug` is the sign-in
alias people type to find their organization, and `status` controls whether anyone can sign in (suspension is
inherited by every descendant). The policy objects configure how people sign in and how elevated access works in
that tenant. See [Tenants and identities](/docs/concepts/tenants-and-identities).

<TypeTable
  id="type-table-index.d.ts-Tenant"
  type="{
  &#x22;id&#x22;: &#x22;index.d.ts-Tenant&#x22;,
  &#x22;name&#x22;: &#x22;Tenant&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;name&#x22;,
      &#x22;description&#x22;: &#x22;A human-readable name.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;type&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;parentId&#x22;,
      &#x22;description&#x22;: &#x22;The id of the parent: the parent tenant, or the parent resource.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | null&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;status&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;TenantStatus&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;TenantStatus&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;slug&#x22;,
      &#x22;description&#x22;: &#x22;Optional globally unique sign-in alias, like an AWS account alias.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;region&#x22;,
      &#x22;description&#x22;: &#x22;Home region, when the deployment runs in several regions (`regions` option). Unset means the parent's region;\nsign-in for a tenant homed elsewhere is sent to that region's deployment.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;boundary&#x22;,
      &#x22;description&#x22;: &#x22;A policy document that limits the maximum access without granting any.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;PolicyDocument | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;authPolicy&#x22;,
      &#x22;description&#x22;: &#x22;The tenant's authentication policy (see TenantAuthPolicy).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;TenantAuthPolicy | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;accessPolicy&#x22;,
      &#x22;description&#x22;: &#x22;The tenant's rules for just-in-time elevation (see TenantAccessPolicy).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;TenantAccessPolicy | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;limits&#x22;,
      &#x22;description&#x22;: &#x22;The tenant's plan limits: maximum numbers of identities, groups, roles, and other records.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;TenantLimits | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;createdAt&#x22;,
      &#x22;description&#x22;: &#x22;When it was created, in milliseconds since the Unix epoch.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;deletedAt&#x22;,
      &#x22;description&#x22;: &#x22;Set when a tenant is tombstoned; purge workers remove data after the retention window.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;id&#x22;,
      &#x22;description&#x22;: &#x22;The record's unique id.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;tenantId&#x22;,
      &#x22;description&#x22;: &#x22;The tenant (organization or project) the record belongs to, or the call acts in.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;uniqueKey&#x22;,
      &#x22;description&#x22;: &#x22;Optional database-enforced natural key, unique within collection and tenant.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

### Authentication policy [#authentication-policy]

`TenantAuthPolicy` lets one organization tighten sign-in without changing your deployment: require MFA (for
everyone or only owners), restrict sign-in methods, shorten session lifetimes and idle timeouts, cap concurrent
sessions, enforce password rules and history, limit sign-in to IP ranges, bind sessions to the network they started
on, and control whether support staff may impersonate members. Set it with
[`tenants.setAuthPolicy`](/docs/reference/api/tenants#setauthpolicy); the
[tenant policy guide](/docs/authentication/tenant-policy) explains every field.

<TypeTable
  id="type-table-index.d.ts-TenantAuthPolicy"
  type="{
  &#x22;id&#x22;: &#x22;index.d.ts-TenantAuthPolicy&#x22;,
  &#x22;name&#x22;: &#x22;TenantAuthPolicy&#x22;,
  &#x22;description&#x22;: &#x22;Per-tenant authentication rules layered under the deployment's configuration; never looser than it.&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;requireMfa&#x22;,
      &#x22;description&#x22;: &#x22;Every human sign-in must complete MFA; people without a factor enroll on their next sign-in.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;allowedMethods&#x22;,
      &#x22;description&#x22;: &#x22;Sign-in methods the tenant accepts; unset accepts every method the deployment enables.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;AuthMethod[] | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sessionLifetimeMs&#x22;,
      &#x22;description&#x22;: &#x22;Absolute session lifetime, capped by the deployment's `sessionLifetimeMs`.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sessionIdleTimeoutMs&#x22;,
      &#x22;description&#x22;: &#x22;Idle timeout, capped by the deployment's `sessionIdleTimeoutMs` and by the lifetime.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;maxAttempts&#x22;,
      &#x22;description&#x22;: &#x22;Attempts per rate-limit window for this tenant's authentication flows, never above the deployment's limits.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;minPasswordLength&#x22;,
      &#x22;description&#x22;: &#x22;Minimum password length for people in this tenant (12 to 128; the deployment minimum is 12).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;maxSessions&#x22;,
      &#x22;description&#x22;: &#x22;Concurrent user sessions per person (1 to 100); issuing one more ends the oldest.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;allowImpersonation&#x22;,
      &#x22;description&#x22;: &#x22;Lets administrators holding `iam:identities:impersonate` open sessions as members (\&#x22;view as\&#x22;); off by default.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;trustedDeviceDays&#x22;,
      &#x22;description&#x22;: &#x22;How long a remembered device may skip MFA (0 to 365 days; 0 disables); never longer than the deployment allows.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;passwordHistory&#x22;,
      &#x22;description&#x22;: &#x22;Reject reuse of this many most recent passwords, counting the current one (1 to 24).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;passwordMaxAgeDays&#x22;,
      &#x22;description&#x22;: &#x22;Passwords older than this many days stop signing in (PASSWORD_EXPIRED) until reset (1 to 3650).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;passwordMinClasses&#x22;,
      &#x22;description&#x22;: &#x22;Character classes (lowercase, uppercase, digits, symbols) a new password must mix (2 to 4).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;passwordRejectPersonalInfo&#x22;,
      &#x22;description&#x22;: &#x22;Reject passwords that contain the person's email local part or a word of their name.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;notifyNewSignIn&#x22;,
      &#x22;description&#x22;: &#x22;Email people when a session starts from a client no live session or remembered device of theirs has used; overrides the deployment default.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;allowedIpRanges&#x22;,
      &#x22;description&#x22;: &#x22;Networks (IPv4/IPv6 addresses or CIDR blocks) sessions may be issued from and used from; sign-ins and sessions\nwhose recorded client IP falls outside them are refused with IP_NOT_ALLOWED. Needs `http.clientInfo` to record IPs.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string[] | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;mfaEmailCodes&#x22;,
      &#x22;description&#x22;: &#x22;Let people without an authenticator satisfy the MFA requirement with a one-time code emailed to their address\n(`auth.requestMfaCode`); overrides the deployment default. Root administrators always need an authenticator.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;requireMfaForOwners&#x22;,
      &#x22;description&#x22;: &#x22;Owners must complete MFA even when the rest of the tenant need not (`requireMfa` covers everyone).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;bindSessionsToIp&#x22;,
      &#x22;description&#x22;: &#x22;A user session is usable only from the client IP it was issued from; used elsewhere it is refused with\nSESSION_NETWORK_MISMATCH (the person signs in again from the new network, the old session keeps working from the\nold one). Needs recorded client IPs (`http.clientInfo`); sessions or requests without one are not judged.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

### Access policy [#access-policy]

`TenantAccessPolicy` sets minimum rules for just-in-time elevation in a tenant,
which individual bindings cannot weaken: a maximum activation length and whether activations always need a
justification, MFA, or an approval (and how long an approval stays usable). Set it with
[`tenants.setAccessPolicy`](/docs/reference/api/tenants#setaccesspolicy). See
[Just-in-time elevation](/docs/features/privileged-access/elevation).

<TypeTable
  id="type-table-index.d.ts-TenantAccessPolicy"
  type="{
  &#x22;id&#x22;: &#x22;index.d.ts-TenantAccessPolicy&#x22;,
  &#x22;name&#x22;: &#x22;TenantAccessPolicy&#x22;,
  &#x22;description&#x22;: &#x22;Floors for just-in-time activation across a tenant (`tenants.setAccessPolicy`): every eligible binding is at least\nthis strict, and a binding may only tighten further. Unset fields leave the binding's own settings in charge.&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;maxActivationMs&#x22;,
      &#x22;description&#x22;: &#x22;Caps every binding's `maxActivationMs` (one minute to seven days).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;requireJustification&#x22;,
      &#x22;description&#x22;: &#x22;Every activation must state a justification.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;requireMfa&#x22;,
      &#x22;description&#x22;: &#x22;Every activation needs an MFA-verified session.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;requireApproval&#x22;,
      &#x22;description&#x22;: &#x22;Every activation starts as an approval request.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;approvalLifetimeMs&#x22;,
      &#x22;description&#x22;: &#x22;How long a request waits for a decision before it lapses (five minutes to thirty days; one day by default).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

## Identities and sessions [#identities-and-sessions]

API responses never include credential material: identities are returned as `PublicIdentity` and sessions as
`SafeSession`, without password hashes or token hashes.

### PublicIdentity [#publicidentity]

A person or service account in one tenant, as the API returns it. `kind` tells
people (`user`) from machines (`service`); `owner` marks tenant owners; `attributes` holds the typed directory
attributes you declared (department, title, and so on), which policies read as `principal.{name}`; `expiresAt`
schedules automatic deactivation.

<TypeTable
  id="type-table-utils.d.ts-PublicIdentity"
  type="{
  &#x22;id&#x22;: &#x22;utils.d.ts-PublicIdentity&#x22;,
  &#x22;name&#x22;: &#x22;PublicIdentity&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;id&#x22;,
      &#x22;description&#x22;: &#x22;The record's unique id.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;tenantId&#x22;,
      &#x22;description&#x22;: &#x22;The tenant (organization or project) the record belongs to, or the call acts in.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;uniqueKey&#x22;,
      &#x22;description&#x22;: &#x22;Optional database-enforced natural key, unique within collection and tenant.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;kind&#x22;,
      &#x22;description&#x22;: &#x22;`user` (a person), `service` (a service account) or `agent` (an AI agent with a sponsor, see `agent`).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;\&#x22;agent\&#x22; | \&#x22;service\&#x22; | \&#x22;user\&#x22;&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;agent&#x22;,
      &#x22;description&#x22;: &#x22;Agents only: the agent's profile, sponsor and ceiling.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;AgentProfile | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;guest&#x22;,
      &#x22;description&#x22;: &#x22;Guests only: set while the person is a guest of this tenant (B2B guest collaboration), with their sponsor.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;GuestProfile | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;email&#x22;,
      &#x22;description&#x22;: &#x22;An email address.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;name&#x22;,
      &#x22;description&#x22;: &#x22;A human-readable name.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;description&#x22;,
      &#x22;description&#x22;: &#x22;A human-readable description.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;attributes&#x22;,
      &#x22;description&#x22;: &#x22;Typed attributes declared by `permissions.identityAttributes`, exposed to policies as principal.{name}.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;Record<string, Json> | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;Record<string, Json>&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;status&#x22;,
      &#x22;description&#x22;: &#x22;deleted identities are tombstones: no credentials, factors, bindings, or email, kept so audit records stay resolvable.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;\&#x22;active\&#x22; | \&#x22;deleted\&#x22; | \&#x22;disabled\&#x22;&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;emailVerified&#x22;,
      &#x22;description&#x22;: &#x22;Whether the email address has been verified.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;rootAdmin&#x22;,
      &#x22;description&#x22;: &#x22;Whether the identity holds platform root authority.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;owner&#x22;,
      &#x22;description&#x22;: &#x22;Whether the identity is an owner of its tenant.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;createdAt&#x22;,
      &#x22;description&#x22;: &#x22;When it was created, in milliseconds since the Unix epoch.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;passwordChangedAt&#x22;,
      &#x22;description&#x22;: &#x22;When the current password was set; drives `passwordMaxAgeDays` (identities without it use `createdAt`).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;unprovenPassword&#x22;,
      &#x22;description&#x22;: &#x22;Set by self sign-up: the password was chosen before anyone proved control of the email address. The first emailed\nsign-in removes such a password (and ends the account's sessions); verifying the address or resetting the\npassword clears the flag.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;phone&#x22;,
      &#x22;description&#x22;: &#x22;A phone number in international format.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;phoneVerified&#x22;,
      &#x22;description&#x22;: &#x22;Whether the phone number has been verified.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;expiresAt&#x22;,
      &#x22;description&#x22;: &#x22;Scheduled deactivation (epoch milliseconds) for contractors and temporary service accounts: past this time the\nidentity's credentials are refused and the retention worker disables it (`identity:expire`).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;managerId&#x22;,
      &#x22;description&#x22;: &#x22;The person's manager within the tenant: approvals may route to them, and offboarding hands reports to a successor.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;deletedAt&#x22;,
      &#x22;description&#x22;: &#x22;When it was deleted, in milliseconds since the Unix epoch.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;deletedEmail&#x22;,
      &#x22;description&#x22;: &#x22;The email address a deleted identity had, kept for audit after the address was released.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

### SafeSession [#safesession]

A signed-in session without its secret token. It records how and when the person authenticated (`method`, `mfa`),
when it expires, the device it belongs to, and, for support sessions, who is impersonating. Use it to show "where
you are signed in" lists and to decide whether to ask for step-up authentication.

<TypeTable
  id="type-table-types.d.ts-SafeSession"
  type="{
  &#x22;id&#x22;: &#x22;types.d.ts-SafeSession&#x22;,
  &#x22;name&#x22;: &#x22;SafeSession&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;id&#x22;,
      &#x22;description&#x22;: &#x22;The record's unique id.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;tenantId&#x22;,
      &#x22;description&#x22;: &#x22;The tenant (organization or project) the record belongs to, or the call acts in.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;identityId&#x22;,
      &#x22;description&#x22;: &#x22;The id of the person or service account.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;createdAt&#x22;,
      &#x22;description&#x22;: &#x22;When it was created, in milliseconds since the Unix epoch.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;expiresAt&#x22;,
      &#x22;description&#x22;: &#x22;When it ends, in milliseconds since the Unix epoch. Absent means it does not expire.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;lastSeenAt&#x22;,
      &#x22;description&#x22;: &#x22;When it was last used, in milliseconds since the Unix epoch.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;authenticatedAt&#x22;,
      &#x22;description&#x22;: &#x22;When the person last authenticated in this session, in milliseconds since the Unix epoch.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;mfa&#x22;,
      &#x22;description&#x22;: &#x22;Whether the session completed multi-factor authentication.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;kind&#x22;,
      &#x22;description&#x22;: &#x22;`user` (sign-in and impersonation sessions), `api-key` (service-account and agent keys), `role` (assumed roles,\nincluding web-identity sessions), `session-token` (temporary credentials minted from a user session or API key) or\n`delegated` (an agent acting on a person's behalf under a delegation; the identity is the person). Code that\nbranches on the kind must fail closed for kinds it does not know.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;\&#x22;api-key\&#x22; | \&#x22;delegated\&#x22; | \&#x22;role\&#x22; | \&#x22;session-token\&#x22; | \&#x22;user\&#x22;&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;agentId&#x22;,
      &#x22;description&#x22;: &#x22;Delegated sessions: the agent acting for the session's identity, and the delegation that allows it.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;delegationId&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;mfaAuthenticatedAt&#x22;,
      &#x22;description&#x22;: &#x22;When a first-hand second factor (TOTP, passkey or an MFA step-up) was last verified for this session; exposed to\npolicies as principal.mfaTime. Absent on remembered-device, impersonation, API-key, web-identity and legacy rows.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;credentialAuthorityId&#x22;,
      &#x22;description&#x22;: &#x22;The authority that issued an API key; session tokens minted from the key copy it and are bounded by its ceilings.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sessionName&#x22;,
      &#x22;description&#x22;: &#x22;Temporary credentials: a caller-chosen label (/^[\\w+=,.@-]{2,64}$/), exposed as principal.sessionName.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sourceIdentity&#x22;,
      &#x22;description&#x22;: &#x22;Role sessions: the verified or trust-permitted source identity, exposed as principal.sourceIdentity.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sessionTags&#x22;,
      &#x22;description&#x22;: &#x22;Role sessions: per-session tags admitted by the trust, exposed as principal.sessionTags.{key}.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;Record<string, string> | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;Record<string, string>&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sourcePolicy&#x22;,
      &#x22;description&#x22;: &#x22;Session tokens: the source credential's own policy (such as API-key scopes), applied as an extra boundary.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;PolicyDocument | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;format&#x22;,
      &#x22;description&#x22;: &#x22;Temporary credentials issued as IAM-signed session JWTs; the row stores the hash of the JWT like any token.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;\&#x22;jwt\&#x22; | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;\&#x22;jwt\&#x22;&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;audience&#x22;,
      &#x22;description&#x22;: &#x22;Session JWTs: the audiences the token was issued for.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string[] | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;webIdentity&#x22;,
      &#x22;description&#x22;: &#x22;Web-identity role sessions: the OIDC provider and the verified external subject behind the session.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;{ providerId: string; issuer: string; subject: string; } | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;method&#x22;,
      &#x22;description&#x22;: &#x22;The sign-in method that established a user session; exposed to policies as principal.authMethod.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;AuthMethod | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;client&#x22;,
      &#x22;description&#x22;: &#x22;Where the session was established, as captured by the HTTP layer (`http.clientInfo`); informational only.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;SessionClientInfo | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;name&#x22;,
      &#x22;description&#x22;: &#x22;API keys only: an administrator-facing label and purpose (`credentials.create`/`credentials.update`).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;description&#x22;,
      &#x22;description&#x22;: &#x22;A human-readable description.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;impersonatorId&#x22;,
      &#x22;description&#x22;: &#x22;The administrator acting through this session (`identities.impersonate`); such sessions end with the administrator's own.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;impersonatorSessionId&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;trustedDeviceId&#x22;,
      &#x22;description&#x22;: &#x22;Set when a remembered device satisfied the MFA requirement instead of a fresh second factor.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;originalIdentityId&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sourceTenantId&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;roleId&#x22;,
      &#x22;description&#x22;: &#x22;The id of the role.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;trustId&#x22;,
      &#x22;description&#x22;: &#x22;The id of the trust that permits the role assumption.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sourceSessionId&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sourceAuthorityIds&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string[] | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;policy&#x22;,
      &#x22;description&#x22;: &#x22;A policy document: `{ version: 1, statements }`.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;PolicyDocument | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;previousSignIn&#x22;,
      &#x22;description&#x22;: &#x22;User sessions from sign-in flows: the person's sign-in record as it stood when this session was issued (their\nprevious sign-in and the attempts that failed since), for a \&#x22;last sign-in\&#x22; notice. Absent on a first sign-in.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;SignInRecord | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

### Sign-in results [#sign-in-results]

`auth.signIn` and the other sign-in methods return a `SessionResult` when the person is fully signed in, or an
`MfaRequired` challenge when a second factor is still needed. The challenge tells you which factors are available
(an enrolled authenticator, an emailed code, a passkey) so your UI can offer the right one. See
[Multi-factor authentication](/docs/authentication/mfa).

<TypeTable
  id="type-table-types.d.ts-SessionResult"
  type="{
  &#x22;id&#x22;: &#x22;types.d.ts-SessionResult&#x22;,
  &#x22;name&#x22;: &#x22;SessionResult&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;token&#x22;,
      &#x22;description&#x22;: &#x22;The bearer token, returned once; only its hash is stored.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;session&#x22;,
      &#x22;description&#x22;: &#x22;The new session without its secret-derived fields (`tokenHash`, `uniqueKey`).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;SafeSession&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;SafeSession&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

<TypeTable
  id="type-table-types.d.ts-MfaRequired"
  type="{
  &#x22;id&#x22;: &#x22;types.d.ts-MfaRequired&#x22;,
  &#x22;name&#x22;: &#x22;MfaRequired&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;mfaRequired&#x22;,
      &#x22;description&#x22;: &#x22;True when a second factor is still needed before a session is issued.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;true&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;true&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;challenge&#x22;,
      &#x22;description&#x22;: &#x22;The id of a pending multi-factor challenge, passed back to the call that completes it.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;enrollmentRequired&#x22;,
      &#x22;description&#x22;: &#x22;No second factor is set up: enroll an authenticator (`beginMfa` / `confirmMfa`) or, when offered, use an emailed\ncode. False when an authenticator is enrolled or a registered passkey can satisfy the challenge.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;authenticatorEnrolled&#x22;,
      &#x22;description&#x22;: &#x22;Whether an authenticator app is enabled, so an authenticator or recovery code can satisfy the challenge.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;emailCodeAvailable&#x22;,
      &#x22;description&#x22;: &#x22;`requestMfaCode` may email a one-time code for this challenge instead of enrolling an authenticator.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;passkeyAvailable&#x22;,
      &#x22;description&#x22;: &#x22;A registered passkey may satisfy this challenge (`beginPasskeyMfa` / `finishPasskeyMfa`).&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

## Audit events [#audit-events]

An `AuditEvent` records one thing that happened in a tenant: an API call (allowed or denied), a failed sign-in, or an
access-lifecycle change such as a role activation. It is what `audit.list` returns and what
`iam.events.subscribe` handlers receive, and webhooks deliver the same fields with `action` renamed to `type`.
`action` says what happened (`iam:roles:create`, `binding:activate`), `actorId` who did it, `resourceId` what it was
done to, and `outcome` whether it was allowed. In an impersonation session,
`impersonatorId` names the administrator while `actorId` stays the member. `sequence`, `previousHash`, and `hash`
place the event in the tenant's tamper-evident audit chain. See
[Events and audit](/docs/concepts/events) for every event name.

<TypeTable
  id="type-table-index.d.ts-AuditEvent"
  type="{
  &#x22;id&#x22;: &#x22;index.d.ts-AuditEvent&#x22;,
  &#x22;name&#x22;: &#x22;AuditEvent&#x22;,
  &#x22;description&#x22;: &#x22;&#x22;,
  &#x22;entries&#x22;: [
    {
      &#x22;name&#x22;: &#x22;actorId&#x22;,
      &#x22;description&#x22;: &#x22;The id of the identity that performed the action.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;action&#x22;,
      &#x22;description&#x22;: &#x22;An action name, such as `documents:read`.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;resourceId&#x22;,
      &#x22;description&#x22;: &#x22;The id of the resource.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;timestamp&#x22;,
      &#x22;description&#x22;: &#x22;When it happened, in milliseconds since the Unix epoch.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;outcome&#x22;,
      &#x22;description&#x22;: &#x22;The result: `allow` or `deny`.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;\&#x22;allow\&#x22; | \&#x22;deny\&#x22;&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;rootOverride&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;originalActorId&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;impersonatorId&#x22;,
      &#x22;description&#x22;: &#x22;The administrator who performed the action through an impersonation session; `actorId` is the member.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;metadata&#x22;,
      &#x22;description&#x22;: &#x22;Extra structured details about the event.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;Record<string, Json> | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;Record<string, Json>&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sessionContext&#x22;,
      &#x22;description&#x22;: &#x22;The session the actor used, when the event was recorded for an authenticated principal; covered by the hash chain.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;AuditSessionContext | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;sequence&#x22;,
      &#x22;description&#x22;: &#x22;Position in the tenant's hash chain, from 1; see `verifyAuditChain`.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;number | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;previousHash&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;hash&#x22;,
      &#x22;description&#x22;: &#x22;A SHA-256 hash.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;id&#x22;,
      &#x22;description&#x22;: &#x22;The record's unique id.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;tenantId&#x22;,
      &#x22;description&#x22;: &#x22;The tenant (organization or project) the record belongs to, or the call acts in.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: true,
      &#x22;deprecated&#x22;: false
    },
    {
      &#x22;name&#x22;: &#x22;uniqueKey&#x22;,
      &#x22;description&#x22;: &#x22;Optional database-enforced natural key, unique within collection and tenant.&#x22;,
      &#x22;tags&#x22;: [],
      &#x22;type&#x22;: &#x22;string | undefined&#x22;,
      &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
      &#x22;required&#x22;: false,
      &#x22;deprecated&#x22;: false
    }
  ]
}"
/>

### Stored records [#stored-records]

The storage models, for adapter and plugin authors. Hash fields exist only here and are never returned by the API.

  #### Identity

        <TypeTable
          id="type-table-index.d.ts-Identity"
          type="{
      &#x22;id&#x22;: &#x22;index.d.ts-Identity&#x22;,
      &#x22;name&#x22;: &#x22;Identity&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;entries&#x22;: [
        {
          &#x22;name&#x22;: &#x22;kind&#x22;,
          &#x22;description&#x22;: &#x22;`user` (a person), `service` (a service account) or `agent` (an AI agent with a sponsor, see `agent`).&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;\&#x22;agent\&#x22; | \&#x22;service\&#x22; | \&#x22;user\&#x22;&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;agent&#x22;,
          &#x22;description&#x22;: &#x22;Agents only: the agent's profile, sponsor and ceiling.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;AgentProfile | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;guest&#x22;,
          &#x22;description&#x22;: &#x22;Guests only: set while the person is a guest of this tenant (B2B guest collaboration), with their sponsor.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;GuestProfile | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;email&#x22;,
          &#x22;description&#x22;: &#x22;An email address.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;name&#x22;,
          &#x22;description&#x22;: &#x22;A human-readable name.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;description&#x22;,
          &#x22;description&#x22;: &#x22;A human-readable description.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;attributes&#x22;,
          &#x22;description&#x22;: &#x22;Typed attributes declared by `permissions.identityAttributes`, exposed to policies as principal.{name}.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;Record<string, Json> | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;Record<string, Json>&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;status&#x22;,
          &#x22;description&#x22;: &#x22;deleted identities are tombstones: no credentials, factors, bindings, or email, kept so audit records stay resolvable.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;\&#x22;active\&#x22; | \&#x22;deleted\&#x22; | \&#x22;disabled\&#x22;&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;emailVerified&#x22;,
          &#x22;description&#x22;: &#x22;Whether the email address has been verified.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;boolean&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;rootAdmin&#x22;,
          &#x22;description&#x22;: &#x22;Whether the identity holds platform root authority.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;boolean&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;owner&#x22;,
          &#x22;description&#x22;: &#x22;Whether the identity is an owner of its tenant.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;boolean&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;createdAt&#x22;,
          &#x22;description&#x22;: &#x22;When it was created, in milliseconds since the Unix epoch.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;passwordHash&#x22;,
          &#x22;description&#x22;: &#x22;&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;passwordChangedAt&#x22;,
          &#x22;description&#x22;: &#x22;When the current password was set; drives `passwordMaxAgeDays` (identities without it use `createdAt`).&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;unprovenPassword&#x22;,
          &#x22;description&#x22;: &#x22;Set by self sign-up: the password was chosen before anyone proved control of the email address. The first emailed\nsign-in removes such a password (and ends the account's sessions); verifying the address or resetting the\npassword clears the flag.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;phone&#x22;,
          &#x22;description&#x22;: &#x22;A phone number in international format.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;phoneVerified&#x22;,
          &#x22;description&#x22;: &#x22;Whether the phone number has been verified.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;boolean | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;expiresAt&#x22;,
          &#x22;description&#x22;: &#x22;Scheduled deactivation (epoch milliseconds) for contractors and temporary service accounts: past this time the\nidentity's credentials are refused and the retention worker disables it (`identity:expire`).&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;managerId&#x22;,
          &#x22;description&#x22;: &#x22;The person's manager within the tenant: approvals may route to them, and offboarding hands reports to a successor.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;deletedAt&#x22;,
          &#x22;description&#x22;: &#x22;When it was deleted, in milliseconds since the Unix epoch.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;deletedEmail&#x22;,
          &#x22;description&#x22;: &#x22;The email address a deleted identity had, kept for audit after the address was released.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;id&#x22;,
          &#x22;description&#x22;: &#x22;The record's unique id.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;tenantId&#x22;,
          &#x22;description&#x22;: &#x22;The tenant (organization or project) the record belongs to, or the call acts in.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;uniqueKey&#x22;,
          &#x22;description&#x22;: &#x22;Optional database-enforced natural key, unique within collection and tenant.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        }
      ]
    }"
        />
  
  #### Session

        <TypeTable
          id="type-table-index.d.ts-Session"
          type="{
      &#x22;id&#x22;: &#x22;index.d.ts-Session&#x22;,
      &#x22;name&#x22;: &#x22;Session&#x22;,
      &#x22;description&#x22;: &#x22;&#x22;,
      &#x22;entries&#x22;: [
        {
          &#x22;name&#x22;: &#x22;identityId&#x22;,
          &#x22;description&#x22;: &#x22;The id of the person or service account.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;tokenHash&#x22;,
          &#x22;description&#x22;: &#x22;&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;createdAt&#x22;,
          &#x22;description&#x22;: &#x22;When it was created, in milliseconds since the Unix epoch.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;expiresAt&#x22;,
          &#x22;description&#x22;: &#x22;When it ends, in milliseconds since the Unix epoch. Absent means it does not expire.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;lastSeenAt&#x22;,
          &#x22;description&#x22;: &#x22;When it was last used, in milliseconds since the Unix epoch.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;authenticatedAt&#x22;,
          &#x22;description&#x22;: &#x22;When the person last authenticated in this session, in milliseconds since the Unix epoch.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;mfa&#x22;,
          &#x22;description&#x22;: &#x22;Whether the session completed multi-factor authentication.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;boolean&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;kind&#x22;,
          &#x22;description&#x22;: &#x22;`user` (sign-in and impersonation sessions), `api-key` (service-account and agent keys), `role` (assumed roles,\nincluding web-identity sessions), `session-token` (temporary credentials minted from a user session or API key) or\n`delegated` (an agent acting on a person's behalf under a delegation; the identity is the person). Code that\nbranches on the kind must fail closed for kinds it does not know.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;\&#x22;api-key\&#x22; | \&#x22;delegated\&#x22; | \&#x22;role\&#x22; | \&#x22;session-token\&#x22; | \&#x22;user\&#x22;&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;agentId&#x22;,
          &#x22;description&#x22;: &#x22;Delegated sessions: the agent acting for the session's identity, and the delegation that allows it.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;delegationId&#x22;,
          &#x22;description&#x22;: &#x22;&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;mfaAuthenticatedAt&#x22;,
          &#x22;description&#x22;: &#x22;When a first-hand second factor (TOTP, passkey or an MFA step-up) was last verified for this session; exposed to\npolicies as principal.mfaTime. Absent on remembered-device, impersonation, API-key, web-identity and legacy rows.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;number | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;number&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;credentialAuthorityId&#x22;,
          &#x22;description&#x22;: &#x22;The authority that issued an API key; session tokens minted from the key copy it and are bounded by its ceilings.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;sessionName&#x22;,
          &#x22;description&#x22;: &#x22;Temporary credentials: a caller-chosen label (/^[\\w+=,.@-]{2,64}$/), exposed as principal.sessionName.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;sourceIdentity&#x22;,
          &#x22;description&#x22;: &#x22;Role sessions: the verified or trust-permitted source identity, exposed as principal.sourceIdentity.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;sessionTags&#x22;,
          &#x22;description&#x22;: &#x22;Role sessions: per-session tags admitted by the trust, exposed as principal.sessionTags.{key}.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;Record<string, string> | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;Record<string, string>&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;sourcePolicy&#x22;,
          &#x22;description&#x22;: &#x22;Session tokens: the source credential's own policy (such as API-key scopes), applied as an extra boundary.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;PolicyDocument | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;format&#x22;,
          &#x22;description&#x22;: &#x22;Temporary credentials issued as IAM-signed session JWTs; the row stores the hash of the JWT like any token.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;\&#x22;jwt\&#x22; | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;\&#x22;jwt\&#x22;&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;audience&#x22;,
          &#x22;description&#x22;: &#x22;Session JWTs: the audiences the token was issued for.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string[] | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;webIdentity&#x22;,
          &#x22;description&#x22;: &#x22;Web-identity role sessions: the OIDC provider and the verified external subject behind the session.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;{ providerId: string; issuer: string; subject: string; } | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;method&#x22;,
          &#x22;description&#x22;: &#x22;The sign-in method that established a user session; exposed to policies as principal.authMethod.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;AuthMethod | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;union&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;client&#x22;,
          &#x22;description&#x22;: &#x22;Where the session was established, as captured by the HTTP layer (`http.clientInfo`); informational only.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;SessionClientInfo | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;name&#x22;,
          &#x22;description&#x22;: &#x22;API keys only: an administrator-facing label and purpose (`credentials.create`/`credentials.update`).&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;description&#x22;,
          &#x22;description&#x22;: &#x22;A human-readable description.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;impersonatorId&#x22;,
          &#x22;description&#x22;: &#x22;The administrator acting through this session (`identities.impersonate`); such sessions end with the administrator's own.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;impersonatorSessionId&#x22;,
          &#x22;description&#x22;: &#x22;&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;trustedDeviceId&#x22;,
          &#x22;description&#x22;: &#x22;Set when a remembered device satisfied the MFA requirement instead of a fresh second factor.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;originalIdentityId&#x22;,
          &#x22;description&#x22;: &#x22;&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;sourceTenantId&#x22;,
          &#x22;description&#x22;: &#x22;&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;roleId&#x22;,
          &#x22;description&#x22;: &#x22;The id of the role.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;trustId&#x22;,
          &#x22;description&#x22;: &#x22;The id of the trust that permits the role assumption.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;sourceSessionId&#x22;,
          &#x22;description&#x22;: &#x22;&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;sourceAuthorityIds&#x22;,
          &#x22;description&#x22;: &#x22;&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string[] | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;array&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;policy&#x22;,
          &#x22;description&#x22;: &#x22;A policy document: `{ version: 1, statements }`.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;PolicyDocument | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;previousSignIn&#x22;,
          &#x22;description&#x22;: &#x22;User sessions from sign-in flows: the person's sign-in record as it stood when this session was issued (their\nprevious sign-in and the attempts that failed since), for a \&#x22;last sign-in\&#x22; notice. Absent on a first sign-in.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;SignInRecord | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;object&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;id&#x22;,
          &#x22;description&#x22;: &#x22;The record's unique id.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;tenantId&#x22;,
          &#x22;description&#x22;: &#x22;The tenant (organization or project) the record belongs to, or the call acts in.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: true,
          &#x22;deprecated&#x22;: false
        },
        {
          &#x22;name&#x22;: &#x22;uniqueKey&#x22;,
          &#x22;description&#x22;: &#x22;Optional database-enforced natural key, unique within collection and tenant.&#x22;,
          &#x22;tags&#x22;: [],
          &#x22;type&#x22;: &#x22;string | undefined&#x22;,
          &#x22;simplifiedType&#x22;: &#x22;string&#x22;,
          &#x22;required&#x22;: false,
          &#x22;deprecated&#x22;: false
        }
      ]
    }"
        />
  