> ## Documentation Index
> Fetch the complete documentation index at: https://phone-harness.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reset the unlock code

> 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.



## OpenAPI

````yaml /openapi.json post /sessions/{sid}/adb/reset
openapi: 3.1.0
info:
  title: Phone Harness API
  version: '2026-09-14'
  description: >-
    Public account and disposable Android session API. Open beta. Create
    responses are asynchronous; session duration includes provisioning, while
    billing begins at readiness. This specification documents the current
    supported client contract, not internal management interfaces. All example
    IDs, links, timestamps, limits, prices and digests are illustrative, not
    live credentials, measurements, or account entitlements.
  contact:
    name: Phone Harness support
    email: support@phone-harness.com
servers:
  - url: https://api.phone-harness.com
    description: Production beta
security:
  - ApiKey: []
tags:
  - name: Sessions
  - name: Phone
  - name: ADB
  - name: Account
  - name: History
  - name: Service
paths:
  /sessions/{sid}/adb/reset:
    post:
      tags:
        - ADB
      summary: Reset the unlock code
      description: >-
        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.
      operationId: reset-adb
      parameters:
        - name: sid
          in: path
          required: true
          schema:
            type: string
          description: Session ID returned by POST /sessions.
      responses:
        '201':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdbConnection'
              example:
                enabled: true
                transport: adb
                host: live.phone-harness.com
                port: 22220
                code: ph_mfwcc5nknqaod034nwojzw0lzq
                expires_at: 1800000900
        '400':
          description: >-
            Invalid registration, or ADB is unavailable on the session provider.
            Unavailable ADB includes unsupported: true.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Bad or missing bearer credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Account access denied or rental access unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No live session visible to the caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            Session is not ready, is closing, or the requested action conflicts
            with current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Unexpected service error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AdbConnection:
      type: object
      required:
        - enabled
        - transport
        - host
        - port
        - code
        - expires_at
      additionalProperties: false
      properties:
        enabled:
          type: boolean
          const: true
        transport:
          type: string
          const: adb
        host:
          type: string
          description: DNS name of the ADB endpoint. Use the returned value.
        port:
          type: integer
          minimum: 1
          maximum: 65535
          description: >-
            TCP port dedicated to this phone while the session lives. Run adb
            connect host:port.
        code:
          type: string
          pattern: ^ph_[a-z2-7]{26}$
          description: >-
            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:
          type: number
          description: >-
            Unix timestamp in seconds when access expires. Never later than the
            session deadline; ADB access does not extend the session.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable public error.
        code:
          type: string
          description: Present only for errors with a stable code.
        state:
          type: string
        unsupported:
          type: boolean
        outcome:
          type: string
          enum:
            - unknown
            - installed
        id:
          type: string
          description: Session ID if a create receipt exists.
        request_key:
          type: string
        cleanup_complete:
          type: boolean
        balance_cents:
          type: integer
        session:
          type: string
        session_limit:
          type: integer
        active_session_count:
          type: integer
        available_session_slots:
          type: integer
      required:
        - error
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        Phone Harness account API key (pck_…). The dashboard may use a Clerk
        session JWT with the same header. Never put an account key in a URL.

````