---
title: "Reset the unlock code"
method: POST
path: "/sessions/{sid}/adb/reset"
tags: ["ADB"]
---

# Reset the unlock code

`POST /sessions/{sid}/adb/reset`

## Request

- Base URL: `https://api.phone-harness.com`
- URL: `https://api.phone-harness.com/sessions/{sid}/adb/reset`
- Auth: HTTP bearer

Mint a new unlock code for this session and close every existing ADB connection. Use it when the code has been shared too widely. The endpoint's host and port stay the same. Takes no body. Watch tokens cannot reset.

## Path parameters

- `sid` string, required

## Response `201`

Success.

- AdbConnection
  - `enabled` true, required
  - `transport` 'adb', required
  - `host` string, required: DNS name of the ADB endpoint. Use the returned value.
  - `port` integer, required: TCP port dedicated to this phone while the session lives. Run adb connect host:port.
  - `code` string, required: The unlock code. After connecting, run adb shell unlock <code>. Anyone who has host, port and code can drive the phone until the session ends or the code is reset.
  - `expires_at` number, required: Unix timestamp in seconds when access expires. Never later than the session deadline; ADB access does not extend the session.

## Other responses

- `400`: Invalid registration, or ADB is unavailable on the session provider. Unavailable ADB includes unsupported: true.
- `401`: Bad or missing bearer credential.
- `403`: Account access denied or rental access unavailable.
- `404`: No live session visible to the caller.
- `409`: Session is not ready, is closing, or the requested action conflicts with current state.
- `500`: Unexpected service error.

---

[API](https://skmtc.dev/phone-harness/apis/phone-harness-api.md) - [All operations](https://skmtc.dev/phone-harness/apis/phone-harness-api/llms.txt) - [OpenAPI document](https://skmtc.dev/phone-harness/apis/phone-harness-api/revisions/5af8941102e5?raw)
