Devices API

Retrieve all registered devices for a specific user with connection status and details

Devices

Devices API

Access the complete list of devices registered to a user. View device types, app versions, connection status, and server location history.

Device Info

OS and app details.

Connection Status

Live connection state.

Server History

Last connected location.


Endpoint Overview

QUERY/graphql

Retrieve all devices associated with a specific user, including connection status, app version, and server location information.

Authentication:Bearer Token
Required scopes:adminreselleruser

Request Parameters

userIdInt!Required

The unique identifier of the user to retrieve devices for.


GraphQL Query

query getDevices($userId: Int!) {
  getDevices(userId: $userId) {
    deviceAppType
    deviceOsType
    appVersion
    lastConnectionStartTime
    lastConnectionStopTime
    isConnected
    lastSessionId
    isDeactivated
    lastConnectedServerId
    lastConnectedServerCountry
    lastConnectedServerCity
  }
}

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 getDevices($userId: Int!) { getDevices(userId: $userId) { deviceAppType deviceOsType appVersion isConnected lastConnectedServerCountry lastConnectedServerCity } }",
    "variables": {
      "userId": 12345
    }
  }'

Response

200Devices Retrieved Successfully
{
  "data": {
    "getDevices": [
      {
        "deviceAppType": "iOS",
        "deviceOsType": "iOS 17.2",
        "appVersion": "3.2.1",
        "lastConnectionStartTime": "2024-01-15T10:30:00Z",
        "lastConnectionStopTime": null,
        "isConnected": true,
        "lastSessionId": "sess_abc123",
        "isDeactivated": false,
        "lastConnectedServerId": "srv_001",
        "lastConnectedServerCountry": "Netherlands",
        "lastConnectedServerCity": "Amsterdam"
      },
      {
        "deviceAppType": "Android",
        "deviceOsType": "Android 14",
        "appVersion": "3.2.0",
        "lastConnectionStartTime": "2024-01-14T08:00:00Z",
        "lastConnectionStopTime": "2024-01-14T18:30:00Z",
        "isConnected": false,
        "lastSessionId": "sess_def456",
        "isDeactivated": false,
        "lastConnectedServerId": "srv_002",
        "lastConnectedServerCountry": "Germany",
        "lastConnectedServerCity": "Frankfurt"
      },
      {
        "deviceAppType": "macOS",
        "deviceOsType": "macOS 14.2",
        "appVersion": "3.1.5",
        "lastConnectionStartTime": "2024-01-10T12:00:00Z",
        "lastConnectionStopTime": "2024-01-10T14:00:00Z",
        "isConnected": false,
        "lastSessionId": "sess_ghi789",
        "isDeactivated": true,
        "lastConnectedServerId": "srv_003",
        "lastConnectedServerCountry": "United States",
        "lastConnectedServerCity": "New York"
      }
    ]
  }
}
404User Not Found
{
  "errors": [
    {
      "message": "User not found",
      "path": ["getDevices"],
      "extensions": {
        "code": "USER_NOT_FOUND"
      }
    }
  ],
  "data": null
}

Response Fields

deviceAppTypeString!

Platform type (iOS, Android, macOS, Windows, Linux).

deviceOsTypeString!

Operating system version.

appVersionString!

Version of the VPN application installed.

isConnectedBoolean!

Whether the device is currently connected to VPN.

isDeactivatedBoolean!

Whether the device has been deactivated by admin.

lastConnectionStartTimeDateTime

Timestamp of the most recent connection start.

lastConnectionStopTimeDateTime

Timestamp when the last connection ended (null if still connected).

lastSessionIdString

Session ID of the most recent connection.

lastConnectedServerIdString

ID of the last server connected to.

lastConnectedServerCountryString

Country of the last connected server.

lastConnectedServerCityString

City of the last connected server.


Device Platforms

iOS

iPhone and iPad devices.

Android

Android phones and tablets.

macOS

Mac computers.

Windows & Linux

Desktop platforms.



Device Limits

Users have concurrent device limits based on their subscription plan. Use this endpoint to monitor device usage and manage deactivations when limits are exceeded.

Lookup by Email

Don't have the user ID? Search devices by email address instead.

Devices by Email