---
title: "POST /v1/projects/{projectsId}/deviceSessions/{deviceSessionsId}:cancel"
method: POST
path: "/v1/projects/{projectsId}/deviceSessions/{deviceSessionsId}:cancel"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/deviceSessions/{deviceSessionsId}:cancel

`POST /v1/projects/{projectsId}/deviceSessions/{deviceSessionsId}:cancel`

## Request

- Base URL: `https://testing.googleapis.com`
- URL: `https://testing.googleapis.com/v1/projects/{projectsId}/deviceSessions/{deviceSessionsId}:cancel`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

POST /v1/projects/{project_id}/deviceSessions/{device_session_id}:cancel Changes the DeviceSession to state FINISHED and terminates all connections. Canceled sessions are not deleted and can be retrieved or listed by the user until they expire based on the 28 day deletion policy.

## Path parameters

- `projectsId` string, required
- `deviceSessionsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Request body

- CancelDeviceSessionRequest: The request object for cancelling a Device Session.

## Response `200`

Successful response

- Empty: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

---

[API](https://skmtc.dev/google/apis/testing.md) - [All operations](https://skmtc.dev/google/apis/testing/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/testing/revisions/fe5d421501fc?raw)
