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

# Connection

> Discover, connect, and disconnect cameras

Enumerate cameras connected via USB and network, then connect in the desired mode. Priority key **must** be set to `pc-remote` after connecting before any property changes or shooting commands will be accepted.

See the auto-generated [API reference](/web-api/overview) for full request/response schemas.

## List Cameras

`GET /api/cameras` — enumerate all cameras visible via USB and network.

<CodeGroup>
  ```bash curl theme={null}
  curl http://localhost:8080/api/cameras
  ```

  ```json Response theme={null}
  {
    "success": true,
    "message": "Camera discovery completed",
    "cameras": [
      {
        "id": "D10F60149B0C",
        "model": "ILCE-9M3",
        "connectionType": "USB",
        "connected": false
      }
    ]
  }
  ```
</CodeGroup>

***

## Connect Camera

`POST /api/cameras/{cameraId}/connection` — establish a connection in the specified [mode](/sdk/typescript#connection-modes).

Body fields:

| Field          | Default  | Description                                     |
| -------------- | -------- | ----------------------------------------------- |
| `mode`         | `remote` | `remote`, `remote-transfer`, or `contents`      |
| `reconnecting` | —        | `on` or `off` — auto-reconnect on disconnection |
| `username`     | —        | For network cameras                             |
| `password`     | —        | For network cameras                             |

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST http://localhost:8080/api/cameras/D10F60149B0C/connection \
    -H "Content-Type: application/json" \
    -d '{"mode": "remote"}'
  ```

  ```json Response theme={null}
  {
    "success": true,
    "message": "Camera connected successfully in remote mode",
    "camera": {
      "connected": true,
      "model": "ILCE-9M3",
      "id": "D10F60149B0C"
    }
  }
  ```
</CodeGroup>

<Note>
  After `POST /api/cameras/{cameraId}/connection` returns success, use `GET /api/cameras/{cameraId}/connection` if you want to confirm the active mode from `data.mode`.
</Note>

***

## Connection Status

`GET /api/cameras/{cameraId}/connection` — check whether a camera is currently connected.

<CodeGroup>
  ```bash curl theme={null}
  curl http://localhost:8080/api/cameras/D10F60149B0C/connection
  ```
</CodeGroup>

***

## Disconnect Camera

`DELETE /api/cameras/{cameraId}/connection` — disconnect a camera. Clears event callbacks and waits for clean disconnection.

<CodeGroup>
  ```bash curl theme={null}
  curl -X DELETE http://localhost:8080/api/cameras/D10F60149B0C/connection
  ```
</CodeGroup>

<Note>
  For typed client calls, use the language SDK pages: [TypeScript](/sdk/typescript), [Python](/sdk/python), or [Swift](/sdk/swift).
</Note>
