Session Lifecycle

Get details of a specific device session

Returns full session metadata including device info (name, OS, version), session state (PENDING, ACTIVE, CLOSING, CLOSED), WebSocket URLs for I/O and companion channels, and the live view URL. Use the session state to determine if the device is ready for interaction. The response includes links to related resources like the device descriptor.

get/sessions/{sessionId}

Request

Path parameters

sessionIdstring required

The id of the device session

Response

OK

idstring

Unique id of device session

state'PENDING' | 'CREATING' | 'ACTIVE' | 'CLOSING' | 'CLOSED' | 'ERRORED'
expiresAtstring date-time

UTC timestamp when the active session expires and will be forcefully closed. Set via sessionDuration at creation. Mutually exclusive with retainUntil. Sessions longer than 6 hours may be closed before this time. When closed, transitions to terminal state and retainUntil is set.

retainUntilstring date-time

UTC timestamp until which closed/errored sessions are retained before deletion. Mutually exclusive with expiresAt. Typically 5 minutes after closure or error.

Example response

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "state": "CREATING",
  "expiresAt": "2025-06-06T10:00:00Z",
  "device": {
    "descriptor": "iPhone_13_real",
    "deviceName": "iPhone 13 real private",
    "os": "ANDROID",
    "osVersion": "15.0"
  },
  "appium": {
    "url": "https://api.us-west-1.saucelabs.com/rdc/v2/sessions/2fe09ae3-5d01-4712-bfc0-1d873d20e554/appium/wd/hub",
    "version": "stable"
  },
  "links": {
    "ioWebsocketUrl": "wss://api.us-west-1.saucelabs.com/rdc/v2/socket/alternativeIo/123e4567-e89b-12d3-a456-426614174000",
    "eventsWebsocketUrl": "wss://api.us-west-1.saucelabs.com/rdc/v2/socket/companion/123e4567-e89b-12d3-a456-426614174000",
    "liveViewUrl": "https://app.saucelabs.com/live/mobile/dataCenters/US/devices/Samsung_Galaxy_S8_real2/shared/123e4567-e89b-12d3-a456-426614174000",
    "adbUrl": "https://api.us-west-1.saucelabs.com/v1/rdc/vusb/forward",
    "usbmuxdUrl": "https://api.us-west-1.saucelabs.com/v1/rdc/vusb/usbmuxd",
    "vusbUrl": "https://api.us-west-1.saucelabs.com/v1/rdc/vusb/forward",
    "deviceDescriptorUrl": "https://api.us-west-1.saucelabs.com/rdc/v2/devices/iPhone_13_real",
    "self": "https://api.us-west-1.saucelabs.com/rdc/v2/sessions/123e4567-e89b-12d3-a456-426614174000"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.