Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sessions

This endpoint may be used by a client to retrieve a list of sessions for the user.

Only the sessions for the calling client are returned.

GET https://oauth.iracing.com/oauth2/sessions HTTP/1.1
Authorization: Bearer ...elided...

It has no parameters.

Response

It responds with an application/json object:

{
  "sessions": [
    {
      "session_id": "336995c9-67bd-4e5c-aa93-0d5e75c463d9",
      "client_id": "client_identifier",
      "client_name": "Client Name",
      "client_developer_name": "Client Developer Name",
      "client_developer_url": "http://localhost/",
      "client_developer_email": "root@localhost",
      "scope": "sessions",
      "scope_descriptions": ["Session management."],
      "auth_time": 1680276758,
      "last_activity": 1680276828,
      "session_expiration": 1680309158,
      "current_session": true,
      "impersonated": true,
      "impersonation_note": "support for login test; approved by cust in #123456",
      "first_ip": "192.168.23.103",
      "first_continent": "North America",
      "first_country": "United States",
      "first_subdivisions": ["Massachusetts"],
      "first_city": "Chelmsford",
      "first_user_agent_header": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
      "first_user_agent_operating_system": "Linux",
      "first_user_agent_browser": "Chrome",
      "last_ip": "192.168.23.103",
      "last_continent": "North America",
      "last_country": "United States",
      "last_subdivisions": ["Massachusetts"],
      "last_city": "Chelmsford",
      "last_user_agent_header": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
      "last_user_agent_operating_system": "Linux",
      "last_user_agent_browser": "Chrome"
    }
  ]
}

The fields are:

  • sessions

    A list of one or more session objects detailing the user's sessions.

Session Object

Each session object has the following fields:

  • session_id

    A session identifier. This value is considered opaque and its format may change without warning at our discretion.

  • client_id

    A client identifier.

  • client_name

    The name of the client as selected during client registration.

  • client_developer_name (may be null)

    The name of the client developer as captured during client registration, if any.

  • client_developer_url (may be null)

    The URL of the client developer as captured during client registration, if any.

  • client_developer_email (may be null)

    The email address of the client developer as captured during client registration, if any.

  • scope (may be null)

    One or more scopes granted to the session, if any, separated by white space. The session may not be granted any scopes, in which case this field will be null.

  • scope_descriptions (may be null)

    One or more descriptions for any scopes granted to the session, if any. The session may not be granted any scopes, in which case this field will be null.

  • auth_time

    The time at which the session was authenticated and authorized, in seconds since Thursday 1 January 1970 00:00:00 UTC.

  • last_activity

    The time of the last activity of the session, in seconds since Thursday 1 January 1970 00:00:00 UTC.

  • session_expiration

    The time at which the session will expire, in seconds since Thursday 1 January 1970 00:00:00 UTC.

  • current_session

    The boolean value true if this represents the current session.

  • impersonated

    The boolean value true if this session was created by a staff member instead of the user.

  • impersonation_note (may be null)

    A note regarding the impersonation, detailing who is impersonating the user, why, and references to the customer approval.

  • first_ip (may be null)

    The first IP address used for the session.

  • first_continent (may be null)

    The continent from which the first activity of the session originated.

  • first_country (may be null)

    The country from which the first activity of the session originated.

  • first_subdivisions (may be null)

    The subdivisions of the country from which the first activity of the session originated.

  • first_city (may be null)

    The city from which the first activity of the session originated.

  • first_user_agent_header (may be null)

    The user agent header first used for the session.

  • first_user_agent_operating_system (may be null)

    The first operating system used for the session.

  • first_user_agent_browser (may be null)

    The first browser used for the session.

  • last_ip (may be null)

    The last IP address used for the session.

  • last_continent (may be null)

    The continent from which the last activity of the session originated.

  • last_country (may be null)

    The country from which the last activity of the session originated.

  • last_subdivisions (may be null)

    The subdivisions of the country from which the last activity of the session originated.

  • last_city (may be null)

    The city from which the last activity of the session originated.

  • last_user_agent_header (may be null)

    The user agent header last used for the session.

  • last_user_agent_operating_system (may be null)

    The last operating system used for the session.

  • last_user_agent_browser (may be null)

    The last browser used for the session.