List login sessions

List login sessions for a user principal in an organization.

Note that a login session is what a user gets after logging into Fusion, InField, or another Cognite application. It is distinct from the concept of the "sessions" that can be used for background work like Transformations or Functions; however, each such background session is backed by a login session.

This endpoint does not work for service account principals, which do not have login sessions.

Access control

Requires the caller to be an admin of the target organization (it is not sufficient to be an admin of an ancestor organization).

Securityorg-oidc-token
Request
path Parameters
org
required
string (OrgId) [ 3 .. 64 ] characters ^([a-z][a-z0-9-]{1,62}[a-z0-9])$

ID of an organization

Example: my-org
principal
required
string (PrincipalId)

ID of a principal

Example: 5yAFQRAATb7vtWGp4gvbJD3wE7VS81CGuQ7EZT
query Parameters
cursor
string

Cursor for paging through results. In general, if a response contains a nextCursor property, it means that there may be more results, and you should pass that value as the cursor parameter in the next request.

Note that the cursor may or may not be encrypted, but either way, it is not intended to be decoded. Its internal structure is not a part of the public API, and may change without notice. You should treat it as an opaque string and not attempt to craft your own cursors.

Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo
limit
integer [ 1 .. 1000 ]

The maximum number of items to return.

Responses
200

A list of login sessions, with a cursor pointing to the next results page (if any).

400

Bad parameters: the limit is out of range or not a number, or the cursor is invalid.

403

The calling user is not an admin of the organization, or the principal id references a service account rather than a user.

404

The principal id does not exist, or does not belong to this organization.

get/api/v1/orgs/{org}/principals/{principal}/sessions
Request samples
Response samples
application/json
{
  • "items": [
    • {
      }
    ],
  • "nextCursor": {
    • "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
    }
}