Skip to content

Connections ​

A connection is one open or finished VPN session. These endpoints list what is open now, read finished sessions, and close one open session. Times are Unix seconds and traffic is bytes.

List open connections ​

GET/api/connectionspermissionconnections.view

Returns the open sessions the account may see, with their device caps.

bash
curl -sS -H "Authorization: Bearer $OVIRA_TOKEN" "$BASE/connections"
json
[
  {
    "sessionId": 9041,
    "instanceId": 12,
    "instance": "udp1194",
    "kind": "openvpn",
    "nodeId": 0,
    "node": "this server",
    "cid": 17,
    "clientId": 119,
    "name": "ali-02",
    "realAddr": "203.0.113.9",
    "vpnIp": "10.128.0.7",
    "platform": "Android",
    "version": "3.4.1",
    "connectedAt": 1795915000,
    "up": 104857600,
    "down": 734003200,
    "rateUp": 18200.5,
    "rateDown": 121000.2,
    "maxDevices": 2
  }
]

A WireGuard session also has lastHandshake. A session with clientId: 0 came from a common name the panel does not know.

Read connection history ​

GET/api/connections/historypermissionconnections.view

Returns closed sessions, newest first.

ParameterInTypeMeaning
limitqueryintegerHow many sessions, 1-1000. Anything else means 200.
clientqueryintegerOnly this client's sessions; 0 keeps every client.
qquerystringSearch in client name and address.
kindquerystringopenvpn, ocserv or wireguard. An unknown value keeps every protocol.
nodequeryintegerOnly sessions on this node. 0 is this server; absent means every node.
bash
curl -sS -H "Authorization: Bearer $OVIRA_TOKEN" \
  "$BASE/connections/history?limit=50&kind=openvpn"
json
[
  {
    "id": 9040,
    "clientId": 119,
    "clientName": "ali-02",
    "instanceId": 12,
    "cid": 16,
    "commonName": "ali-02",
    "realAddr": "203.0.113.9",
    "vpnIp": "10.128.0.7",
    "platform": "Android",
    "clientVersion": "3.4.1",
    "connectedAt": 1795900000,
    "endedAt": 1795910000,
    "bytesUp": 20971520,
    "bytesDown": 104857600,
    "endReason": "client disconnect",
    "kind": "openvpn"
  }
]

Close one connection ​

POST/api/connections/kickpermissionconnections.kick

Closes one open session. Read instanceId and cid from the open connections list.

FieldTypeRequiredMeaning
instanceIdintegeryesInbound the connection runs on.
cidintegeryesProtocol-level connection id from LiveSession.cid.
bash
curl -sS -H "Authorization: Bearer $OVIRA_TOKEN" \
  -H "Content-Type: application/json" -X POST "$BASE/connections/kick" \
  -d '{"instanceId":12,"cid":17}'
json
{ "ok": true }

404 means the connection is already closed, or it is outside the account's reach. The client may reconnect at once if its plan still allows it; disable the client to prevent it from reconnecting. Kicking one or all sessions allows reconnection.

Proprietary software · documentation free to share