- [HTTP request](https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions/create#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions/create#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions/create#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions/create#body.request_body)
- [Response body](https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions/create#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions/create#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions/create#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions/create#try-it)

Starts an automation session with the specified configuration.

This method returns a long-running `Operation`, awaiting the completion of all jobs in the session.

### HTTP request

`POST https://devicerun.googleapis.com/v1alpha/{parent=projects/*/locations/*}/sessions`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent resource where this session will be created. Format: `projects/{project}/locations/{location}`. It takes the form `projects/{project}/locations/{location}`. |

### Query parameters

| Parameters ||
|---|---|
| `sessionId` | `string` Optional. The ID to use for the session, which will become the final component of the resource name. If not provided, the server will generate a value for this field. When provided, this value must be between 4 and 63 characters, and match the following regex: \^\[a-z\]\[a-z0-9-\]{2,61}\[a-z0-9\]$. |
| `requestId` | `string` Optional. A unique identifier for this request. This request is only idempotent if a `requestId` is provided, i.e. if a request with the same `requestId` is received, then the previous result will be returned. The server will guarantee that for at least 60 minutes after the first request. The value must be a UUID (ex. 123e4567-e89b-12d3-a456-426655440000). See github.com/google/uuid for more details. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.sessions#Session`.

### Response body

If successful, the response body contains a newly created instance of `https://docs.cloud.google.com/developer-device-platform/reference/device-run/rest/v1alpha/projects.locations.operations#Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://docs.cloud.google.com/iam/docs) permission on the `parent` resource:

- `devicerun.sessions.create`

For more information, see the [IAM documentation](https://docs.cloud.google.com/iam/docs).