Session Lifecycle

Allocate a device and create a new session

Creates a new device session. The session runs on a private device or on a public device from the shared Sauce Labs cloud, depending on which devices match your query.

post/sessions

Request

Request body

Example request

{
  "device": {
    "deviceName": "iPhone_16_real",
    "os": "ios"
  },
  "configuration": {
    "tunnel": {
      "name": "us_west_sauce_connect_tunnel",
      "owner": "some_user_name"
    },
    "sessionDuration": "PT1H"
  },
  "autoStartTest": {
    "testName": "Checkout flow — guest user",
    "build": "build-1042",
    "tags": [
      "smoke",
      "checkout"
    ]
  }
}

Response

Ok

idstring
state'PENDING' | 'CREATING' | 'ACTIVE' | 'CLOSING' | 'CLOSED' | 'ERRORED'

Example response

{
  "state": "CREATING"
}

Changes

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