# auth.sessions

Notification of new and removed sessions.

Type: object

##

#### AuthSessionsAddedEvent

Type: object
No Additional Properties

##

#### AuthSessionsEntry

Type: object

Event fields.

No Additional Properties

##

#### Id

Type: string

Unique identifier for the authentication session.

##

#### Current

Type: boolean

Whether this is the current active session.

##

#### Internal

Type: boolean

Whether this is an internal system session.

##

#### Origin

Type: string

Origin information for the session (IP address, hostname, etc.).

##

#### Credentials

Type: enum (of string)

Authentication method used for this session.

- `UNIX_SOCKET`: Local Unix domain socket authentication
- `LOGIN_PASSWORD`: Username and password authentication
- `LOGIN_TWOFACTOR`: Two-factor authentication login
- `LOGIN_ONETIME_PASSWORD`: One-time password authentication
- `API_KEY`: API key authentication
- `TOKEN`: Token-based authentication
- `TRUENAS_NODE`: TrueNAS cluster node authentication

##### Must be one of:

- "UNIX_SOCKET"
- "LOGIN_PASSWORD"
- "LOGIN_TWOFACTOR"
- "LOGIN_ONETIME_PASSWORD"
- "API_KEY"
- "TOKEN"
- "TRUENAS_NODE"

##

#### Credentials Data

Detailed credential information specific to the authentication method.

## Any of

#### BaseCredentialData

Type: object

#### UserCredentialData

Type: object
No Additional Properties

##

#### Username

Type: string

Username of the authenticated user.

##

#### Login Id

Type: string

Unique identifier for the login.

##

#### Login At

Type: stringFormat: date-time

Timestamp of when the user logged in.

#### APIKeyCredentialData

Type: object
No Additional Properties

##

#### Username

Type: string

Username of the authenticated user.

##

#### Login Id

Type: string

Unique identifier for the login.

##

#### Login At

Type: stringFormat: date-time

Timestamp of when the user logged in.

##

#### APIKeySessionData

Type: object

API key information used for authentication.

No Additional Properties

##

#### Id

Type: integer

Unique identifier for the API key.

##

#### Name

Type: string

Human-readable name of the API key.

#### TokenCredentialData

Type: object
No Additional Properties

##

#### TokenParentCredentialsData

Type: object

Parent credential information that generated this token.

No Additional Properties

##

#### Credentials

Type: enum (of string)

Type of credentials used to generate this token.

##### Must be one of:

- "UNIX_SOCKET"
- "LOGIN_PASSWORD"
- "LOGIN_TWOFACTOR"
- "API_KEY"
- "TOKEN"
- "TRUENAS_NODE"

##

#### Credentials Data

Credential data used to authenticate the token request.

## Any of

#### BaseCredentialData

Type: object

#### UserCredentialData

Type: object
No Additional Properties

##

#### Username

Type: string

Username of the authenticated user.

##

#### Login Id

Type: string

Unique identifier for the login.

##

#### Login At

Type: stringFormat: date-time

Timestamp of when the user logged in.

#### APIKeyCredentialData

Type: object
No Additional Properties

##

#### Username

Type: string

Username of the authenticated user.

##

#### Login Id

Type: string

Unique identifier for the login.

##

#### Login At

Type: stringFormat: date-time

Timestamp of when the user logged in.

##

Type: object

API key information used for authentication.

#### TokenCredentialData

Type: object
No Additional Properties

##

Type: object

Parent credential information that generated this token.

##

#### Login Id

Type: string

Unique identifier for the login.

##

#### Username

Username associated with the token. `null` if not user-specific.

## Any of

Type: string
Type: null

##

#### Login Id

Type: string

Unique identifier for the login.

##

#### Username

Username associated with the token. `null` if not user-specific.

## Any of

Type: string
Type: null

##

#### Created At

Type: stringFormat: date-time

Timestamp when the session was created.

##

#### Secure Transport

Type: boolean

Whether the session was established over a secure transport (HTTPS/WSS).

##

#### AuthSessionsRemovedEvent

Type: object
No Additional Properties

##

#### AuthSessionsRemovedEventFields

Type: object

Event fields.

No Additional Properties

##

#### Id

Type: string

Unique identifier for the authentication session.

Required roles: FULL_ADMIN