Online Sessions API

Retrieve all currently active VPN sessions for a specific user in real-time

Devices

Online Sessions API

Monitor active VPN sessions in real-time. Track currently connected sessions with detailed connection information for any user.

Live Sessions

Real-time active connections.

Connection Status

Monitor session health.

Location Data

Server and IP information.


Endpoint Overview

QUERY/graphql

Retrieve all currently active VPN sessions for a specific user, including connection details and server information.

Authentication:Bearer Token
Required scopes:adminreseller

Request Parameters

userIdInt!Required

The unique identifier of the user to retrieve online sessions for.


GraphQL Query

query getOnlineSessions($userId: Int!) {
  getOnlineSessions(userId: $userId) {
    id
    sessionId
    nasIpAddress
    nasPortId
    nasPortType
    startTime
    connectInfoStart
    callingStationId
    framedIpAddress
  }
}

Variables:

{
  "userId": 12345
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "query": "query getOnlineSessions($userId: Int!) { getOnlineSessions(userId: $userId) { id sessionId nasIpAddress startTime framedIpAddress connectInfoStart } }",
    "variables": {
      "userId": 12345
    }
  }'

Response

200Sessions Retrieved Successfully
{
  "data": {
    "getOnlineSessions": [
      {
        "id": "active_001",
        "sessionId": "sess_live_abc123",
        "nasIpAddress": "192.168.1.100",
        "nasPortId": "1001",
        "nasPortType": "Virtual",
        "startTime": "2024-01-15T10:30:00Z",
        "connectInfoStart": "WireGuard",
        "callingStationId": "AA:BB:CC:DD:EE:FF",
        "framedIpAddress": "10.0.0.50"
      },
      {
        "id": "active_002",
        "sessionId": "sess_live_def456",
        "nasIpAddress": "192.168.1.101",
        "nasPortId": "1002",
        "nasPortType": "Virtual",
        "startTime": "2024-01-15T12:00:00Z",
        "connectInfoStart": "OpenConnect",
        "callingStationId": "11:22:33:44:55:66",
        "framedIpAddress": "10.0.0.51"
      }
    ]
  }
}
200No Active Sessions
{
  "data": {
    "getOnlineSessions": []
  }
}

Response Fields

idID!

Unique identifier for the active session.

sessionIdString!

RADIUS session identifier.

nasIpAddressString!

IP address of the VPN server handling the connection.

nasPortIdString

Port identifier on the Network Access Server.

nasPortTypeString

Type of connection (typically "Virtual" for VPN).

startTimeDateTime!

Timestamp when the session started.

connectInfoStartString

VPN protocol being used (WireGuard, OpenConnect, etc.).

callingStationIdString

MAC address or device identifier.

framedIpAddressString

VPN IP address assigned to this session.


Use Cases

User Support

Verify if a user is currently connected.

Session Management

Identify sessions for disconnection.

Concurrent Limits

Check device count against limits.

Real-time Monitoring

Build live connection dashboards.



Live Data

Online sessions are queried in real-time from the RADIUS server. Results reflect the current connection state at the moment of the query.

Force Disconnect

Need to terminate a session? Disconnect users by session ID.

Disconnect Session