Skip to content

List active sessions for a user

View as Markdown
GET
/v1/identity/users/{userId}/sessions
curl --request GET \
--url https://example.com/v1/identity/users/example/sessions \
--header 'Authorization: Bearer <token>'

A tenant admin, or the person themselves. Returns the wire-safe IdentitySessionSummary shape — provider access-token + refresh-token never cross the wire, even to admins. Unknown user id returns an empty list (call GET /v1/identity/users/:userId first to distinguish “no sessions” from “no user”). A key or session limited to a project is refused, 403 permission-denied, even for its own person: their sessions reach every project.

userId
required
string
>= 1 characters

Page of sessions.

Media typeapplication/json
object
data
required
Array<object>

Wire-safe subset of a session. Excludes provider access-token / refresh-token — those never cross the wire, even to admins.

object
sessionId
required
string
userId
required
string
providerId
required
string
createdAt
required
string format: date-time
expiresAt
required
string format: date-time
scopes
required
Array<string>
revokedAt
string format: date-time
hasMore
required
boolean
nextCursor
string
Examplegenerated
{
"data": [
{
"sessionId": "example",
"userId": "example",
"providerId": "example",
"createdAt": "2026-04-15T12:00:00Z",
"expiresAt": "2026-04-15T12:00:00Z",
"scopes": [
"example"
],
"revokedAt": "2026-04-15T12:00:00Z"
}
],
"hasMore": true,
"nextCursor": "example"
}

Missing / malformed / expired / revoked bearer token.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Someone else’s sessions, and not a tenant admin; or a key or session limited to a project.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}
Retry-After
integer
>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

The database was too busy to answer in time (database-busy), or the authorization store couldn’t be reached (authz-backend-unavailable); Retry-After (whole seconds) says when to try again.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}
Retry-After
integer
>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

See also