Skip to content
Torii docs

List user sessions

GET
/api/server/v1/users/{userId}/sessions
curl --request GET \
--url https://api.torii.so/api/server/v1/users/01931a73-8b00-7000-8000-000000000000/sessions

Returns all active (unexpired, unrevoked) sessions for the user, ordered by most recently used.

userId
required
string format: uuid

Identifier of the user whose sessions to list.

Example
01931a73-8b00-7000-8000-000000000000

All active sessions for the user.

Media type application/json
Array<object>

An active end-user session in your environment.

object
id
required

Unique identifier for this session.

string format: uuid
userId
required

Identifier of the end-user this session belongs to.

string format: uuid
environmentId
required

Identifier of the environment this session belongs to.

string format: uuid
userAgent

Raw User-Agent string captured when the session was created.

string | null
ipAddress

IP address captured when the session was created.

string | null
createdAt
required

When this session was created (ISO-8601 UTC).

string format: date-time
expiresAt
required

When this session expires (ISO-8601 UTC).

string format: date-time
lastUsedAt
required

When this session was last seen by the API (ISO-8601 UTC).

string format: date-time
activeOrganizationId

Active organization pinned to this session (org_id claim on re-mint).

string | null format: uuid
impersonatedBy

Platform user behind this session when it was established via impersonation; null for normal sign-ins.

string | null format: uuid
Example
[
{
"id": "01931a74-1234-7000-8000-000000000000",
"userId": "01931a73-8b00-7000-8000-000000000000",
"environmentId": "01931a72-0000-7000-8000-000000000000",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_6_0) AppleWebKit/537.36",
"ipAddress": "203.0.113.42",
"createdAt": "2026-05-16T09:30:00Z",
"expiresAt": "2026-05-23T09:30:00Z",
"lastUsedAt": "2026-05-16T11:42:00Z"
}
]

Missing or invalid secret key.

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"properties": {
"additionalProperty": "example"
}
}

User belongs to a different environment.

Media type application/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Example generated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"properties": {
"additionalProperty": "example"
}
}