Disconnect by Session ID API
Terminate a specific VPN session by its unique session identifier for immediate disconnection
Disconnect by Session ID API
Instantly terminate a specific VPN session using its unique identifier. Useful for security enforcement, managing unauthorized sessions, or freeing up connection slots.
Instant Disconnect
Terminate sessions immediately without delay.
Precise Targeting
Disconnect specific sessions without affecting others.
Security Control
Quickly terminate suspicious or unauthorized sessions.
Endpoint Overview
/graphqlDisconnect a specific VPN session by providing its unique session identifier. The session is terminated immediately on the VPN server.
Request Parameters
onlineSessionIdString!RequiredThe unique identifier of the active session to disconnect. Obtain this from the online sessions query.
GraphQL Mutation
mutation disconnectBySessionId($onlineSessionId: String!) {
disconnectBySessionId(onlineSessionId: $onlineSessionId)
}Variables:
{
"onlineSessionId": "sess_abc123xyz789"
}HTTP Request:
curl -X POST https://api.orbnet.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
-d '{
"query": "mutation disconnectBySessionId($onlineSessionId: String!) { disconnectBySessionId(onlineSessionId: $onlineSessionId) }",
"variables": {
"onlineSessionId": "sess_abc123xyz789"
}
}'Response
{
"data": {
"disconnectBySessionId": true
}
}{
"errors": [
{
"message": "Session not found or already disconnected",
"path": ["disconnectBySessionId"],
"extensions": {
"code": "SESSION_NOT_FOUND"
}
}
],
"data": null
}{
"errors": [
{
"message": "Admin access required to disconnect sessions",
"path": ["disconnectBySessionId"],
"extensions": {
"code": "FORBIDDEN"
}
}
],
"data": null
}Use Cases
Security Incidents
Immediately terminate sessions flagged as suspicious or compromised.
Policy Enforcement
Disconnect sessions violating usage policies or terms of service.
Resource Management
Free up connection slots by terminating idle or stuck sessions.
Support Requests
Help users resolve connection issues by terminating problematic sessions.
Best Practices
Verify Session First
Query online sessions to confirm the session ID before disconnecting.
Log Actions
Keep records of manual disconnections for audit purposes.
Notify Users
Consider notifying users when their sessions are manually terminated.
Handle Gracefully
Session may already be disconnected - handle 'not found' responses gracefully.
Related Endpoints
Immediate Effect
Session disconnection takes effect immediately. The user will be disconnected from the VPN and will need to reconnect. Consider the impact before terminating active sessions.
Monitor Active Sessions
Before disconnecting sessions, view all active connections to identify the correct session ID and understand the impact.