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

# Unbind Device

> Unbind a device from its current end user

Unbind a device from its current end user, making it available for reassignment. This is a no-op if the device is not currently bound.

## Authentication

Requires an [API key](/authentication) with `devices:write` scope.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.bota.dev/v1/devices/dev_abc123/unbind \
    -H "Authorization: Bearer sk_live_..."
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.bota.dev/v1/devices/dev_abc123/unbind', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer sk_live_...',
    },
  });

  const device = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.bota.dev/v1/devices/dev_abc123/unbind',
      headers={'Authorization': 'Bearer sk_live_...'},
  )

  device = response.json()
  ```
</RequestExample>

## Path Parameters

<ParamField path="id" type="string" required>
  The device's unique identifier (e.g., `dev_abc123`).
</ParamField>

## Response

Returns the device object with `status` set to `unbound`.

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "dev_abc123",
    "serial_number": "SN-2025-001234",
    "device_type": "bota_pin_v1",
    "firmware_version": "1.2.0",
    "status": "unbound",
    "end_user_id": null,
    "metadata": null,
    "created_at": "2025-01-15T10:30:00Z",
    "bound_at": null
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "not_found",
      "message": "Device not found"
    }
  }
  ```
</ResponseExample>

## Response Fields

| Field                 | Type            | Description                                                                              |
| --------------------- | --------------- | ---------------------------------------------------------------------------------------- |
| `id`                  | string          | Device identifier (`dev_*`)                                                              |
| `serial_number`       | string          | Physical serial number                                                                   |
| `model`               | string          | Device model (`bota_pin` or `bota_note`)                                                 |
| `firmware_version`    | string \| null  | Current firmware version                                                                 |
| `status`              | string          | `unbound` or `bound`                                                                     |
| `end_user_id`         | string \| null  | Bound end user (`eu_*`), null if unbound                                                 |
| `battery_percent`     | integer \| null | Battery level (0-100), null if no heartbeat received                                     |
| `storage_used_mb`     | integer \| null | Storage used in MB                                                                       |
| `storage_total_mb`    | integer \| null | Total storage capacity in MB                                                             |
| `signal_strength_dbm` | integer \| null | Signal strength in dBm                                                                   |
| `last_heartbeat_at`   | string \| null  | Last heartbeat timestamp (ISO 8601)                                                      |
| `recording_state`     | object \| null  | Current recording state (device\_state, pending\_recordings, flags, connection\_type\[]) |
| `metadata`            | object          | Custom key-value metadata                                                                |
| `created_at`          | string          | Creation timestamp (ISO 8601)                                                            |
| `updated_at`          | string          | Last update timestamp (ISO 8601)                                                         |

<Note>
  Unbinding a device does not affect existing recordings. Recordings remain associated with the end user who was bound at the time of recording.
</Note>
