Skip to main content
GET
https://{tenantDomain}/api/v2
/
users
/
{user_id}
/
sessions
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Users;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Users.Sessions.ListAsync(
            userId: "user_id",
            request: new ListUserSessionsRequestParameters {
                From = "from",
                Take = 1
            }
        );
    }

}
{
  "sessions": [
    {
      "id": "<string>",
      "user_id": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "authenticated_at": "2023-11-07T05:31:56Z",
      "idle_expires_at": "2023-11-07T05:31:56Z",
      "expires_at": "2023-11-07T05:31:56Z",
      "last_interacted_at": "2023-11-07T05:31:56Z",
      "device": {
        "initial_user_agent": "<string>",
        "initial_ip": "<string>",
        "initial_asn": "<string>",
        "last_user_agent": "<string>",
        "last_ip": "<string>",
        "last_asn": "<string>"
      },
      "clients": [
        {
          "client_id": "<string>"
        }
      ],
      "authentication": {
        "methods": [
          {
            "name": "<string>",
            "timestamp": "2023-11-07T05:31:56Z",
            "type": "<string>"
          }
        ]
      },
      "cookie": {},
      "session_metadata": {}
    }
  ],
  "next": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

user_id
string
required

ID of the user to get sessions for

Query Parameters

include_totals
boolean

Return results inside an object that contains the total result count (true) or as a direct array of results (false, default).

from
string

An optional cursor from which to start the selection (exclusive).

take
integer

Number of results per page. Defaults to 50.

Required range: 1 <= x <= 100

Response

The sessions were retrieved

sessions
object[]
next
string

A cursor to be used as the "from" query parameter for the next page of results.