Logout Device API

End a device session and disconnect the device from VPN services

Session Termination

Logout Device API

Terminate device sessions gracefully. Ends the authenticated session and disconnects the device from VPN services while keeping it registered.

Graceful Logout

Properly terminate sessions with cleanup.

Session Security

Invalidate session tokens immediately.

Device Retained

Device stays registered for future logins.


Endpoint Overview

MUTATION/graphql

Log out a device by ending its current session. The device remains activated but can no longer connect until it logs in again.

Authentication:Bearer Token

Request Parameters

userIdInt!Required

The unique identifier of the user whose device is logging out.

deviceIdInputDeviceIdInput!Required

Object containing the device identification details.


GraphQL Mutation

mutation logoutDevice($userId: Int!, $deviceIdInput: DeviceIdInput!) {
  logoutDevice(userId: $userId, deviceIdInput: $deviceIdInput)
}

Variables:

{
  "userId": 12345,
  "deviceIdInput": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "serial": "ABC123XYZ789",
    "name": "John's iPhone 15"
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{
    "query": "mutation logoutDevice($userId: Int!, $deviceIdInput: DeviceIdInput!) { logoutDevice(userId: $userId, deviceIdInput: $deviceIdInput) }",
    "variables": {
      "userId": 12345,
      "deviceIdInput": {
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "serial": "ABC123XYZ789",
        "name": "Johns iPhone 15"
      }
    }
  }'

Response

200Device Logged Out Successfully
{
  "data": {
    "logoutDevice": true
  }
}
400No Active Session
{
  "errors": [
    {
      "message": "No active session found for this device",
      "path": ["logoutDevice"],
      "extensions": {
        "code": "SESSION_NOT_FOUND"
      }
    }
  ],
  "data": null
}

Logout vs Deactivate

Logout

Ends current session. Device remains registered and can log in again.

Deactivate

Removes device from account. Must be re-activated to use again.


Use Cases

User-Initiated

User logs out from app to end their session.

Security Logout

Force logout after password change or security concern.

Session Rotation

Logout and re-login to refresh session tokens.

Troubleshooting

Clear session state to resolve connection issues.



Keep Device Active

Logout is the preferred method when users want to temporarily stop VPN access. The device stays registered and can quickly reconnect without re-activation.

Need Complete Device Removal?

To fully remove a device from a user's account, use the Deactivate Device API instead.

Deactivate Device API