---
title: "POST /v1/{+parent}/deviceSessions"
method: POST
path: "/v1/{+parent}/deviceSessions"
tags: ["projects"]
---

# POST /v1/{+parent}/deviceSessions

`POST /v1/{+parent}/deviceSessions`

POST /v1/projects/{project_id}/deviceSessions

## Path parameters

- `parent` string, required

## Request body

- DeviceSession — Protobuf message describing the device message, used from several RPCs.
  - `ttl` string, google-duration — Optional. The amount of time that a device will be initially allocated for. This can eventually be extended with the UpdateDeviceSession RPC. Default: 15 minutes.
  - `stateHistories` SessionStateEvent[] — Output only. The historical state transitions of the session_state message including the current session state.
    - `sessionState` 'SESSION_STATE_UNSPECIFIED' | 'REQUESTED' | 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'FINISHED' | 'UNAVAILABLE' | 'ERROR' — Output only. The session_state tracked by this event
    - `eventTime` string, google-datetime — Output only. The time that the session_state first encountered that state.
    - `stateMessage` string — Output only. A human-readable message to explain the state.
  - `displayName` string — Output only. The title of the DeviceSession to be presented in the UI.
  - `androidDevice` AndroidDevice — A single Android device.
    - `androidModelId` string — Required. The id of the Android device to be used. Use the TestEnvironmentDiscoveryService to get supported options.
    - `androidVersionId` string — Required. The id of the Android OS version to be used. Use the TestEnvironmentDiscoveryService to get supported options.
    - `locale` string — Required. The locale the test device used for testing. Use the TestEnvironmentDiscoveryService to get supported options.
    - `orientation` string — Required. How the device is oriented during the test. Use the TestEnvironmentDiscoveryService to get supported options.
  - `inactivityTimeout` string, google-duration — Output only. The interval of time that this device must be interacted with before it transitions from ACTIVE to TIMEOUT_INACTIVITY.
  - `createTime` string, google-datetime — Output only. The time that the Session was created.
  - `activeStartTime` string, google-datetime — Output only. The timestamp that the session first became ACTIVE.
  - `state` 'SESSION_STATE_UNSPECIFIED' | 'REQUESTED' | 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'FINISHED' | 'UNAVAILABLE' | 'ERROR' — Output only. Current state of the DeviceSession.
  - `expireTime` string, google-datetime — Optional. If the device is still in use at this time, any connections will be ended and the SessionState will transition from ACTIVE to FINISHED.
  - `name` string — Optional. Name of the DeviceSession, e.g. "projects/{project_id}/deviceSessions/{session_id}"

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/testing.md) · [All operations](https://skmtc.dev/google/apis/testing/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/testing/revisions/bf330da53ac5/schema)
