List a user's sessions
GET /admin/users/{ref}/sessions
Lists another user’s signed-in sessions, most recently used first,
in the same shape as GET /account/sessions. Use it to see where
someone is signed in, and end a session with DELETE /admin/users/{ref}/sessions/{id}.
You need users.read. The ip field also needs users.pii.read;
without it you get the same rows without addresses. system.admin
covers both. No row is marked current, even when you list your own
sessions.
As on your own list, sessions idle for more than 30 minutes can
still appear, impersonation sessions aren’t marked, and there’s no
paging. The user isn’t looked up first, so an unknown ref returns
an empty list rather than 404.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Responses
Section titled “ Responses ”The user’s signed-in sessions.
object
One signed-in session. user_agent is the User-Agent header from
the request that started the session, and is left out when there
wasn’t one.
object
When a request last used the session. A session unused for more than 30 minutes stops working.
When the session ends no matter how it’s used. Ordinary sign-ins have no fixed end, so it’s left out; impersonation sessions end 30 minutes after they start.
The IP address the session was started from: the first entry in
X-Forwarded-For when there is one, otherwise the connection’s
address. The client can set that header, and a value that isn’t a
valid address isn’t recorded. Only GET /admin/users/{ref}/sessions
returns it, and only if you have users.pii.read as well as
users.read (system.admin also works). It’s left out otherwise,
and also when no address was recorded, so a missing ip doesn’t
tell you which.
true on the session making this request. Only GET /account/sessions sets it, and only when you call it with the
session cookie; otherwise it’s left out.
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completedResource not found
object
Human-readable error summary
Example
the request could not be completed