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

# Desktop Recordings

> Record, list, download, and delete desktop session videos.

## Start and stop

<CodeGroup>
  ```python Python SDK theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  recording = machine.desktop.start_recording(name="demo")
  machine.desktop.move(500, 500)
  machine.desktop.click(500, 500)
  finished = machine.desktop.stop_recording(recording.id)
  print(finished.status, finished.file_size_bytes)
  ```

  ```bash CLI theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  nullspace machine desktop recording start mch_123 --name demo
  nullspace machine desktop move mch_123 500 500
  nullspace machine desktop click mch_123 500 500
  nullspace machine desktop recording stop mch_123 rec_456
  ```

  ```bash HTTP API theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  curl -X POST "${NULLSPACE_API_URL}/v1/machines/mch_123/desktop/recording/start" \
    -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
    -H "Content-Type: application/json" -d '{"name": "demo"}'

  curl -X POST "${NULLSPACE_API_URL}/v1/machines/mch_123/desktop/recording/stop" \
    -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
    -H "Content-Type: application/json" -d '{"recording_id": "rec_456"}'
  ```
</CodeGroup>

## List and inspect

<CodeGroup>
  ```python Python SDK theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  for item in machine.desktop.list_recordings():
      print(item.id, item.status, item.file_size_bytes)

  info = machine.desktop.get_recording(recording.id)
  print(info.file_path)
  ```

  ```bash CLI theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  nullspace machine desktop recording list mch_123
  nullspace machine desktop recording get mch_123 rec_456
  ```

  ```bash HTTP API theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  curl "${NULLSPACE_API_URL}/v1/machines/mch_123/desktop/recording" \
    -H "Authorization: Bearer ${NULLSPACE_API_KEY}"

  curl "${NULLSPACE_API_URL}/v1/machines/mch_123/desktop/recording/rec_456" \
    -H "Authorization: Bearer ${NULLSPACE_API_KEY}"
  ```
</CodeGroup>

## Download and delete

<CodeGroup>
  ```python Python SDK theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  content = machine.desktop.download_recording(recording.id)
  machine.desktop.download_recording(recording.id, local_path="./recording.mp4")
  machine.desktop.delete_recording(recording.id)
  ```

  ```bash CLI theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  nullspace machine desktop recording download mch_123 rec_456 -o ./recording.mp4
  nullspace machine desktop recording delete mch_123 rec_456
  ```

  ```bash HTTP API theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  curl "${NULLSPACE_API_URL}/v1/machines/mch_123/desktop/recording/rec_456/download" \
    -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
    -o ./recording.mp4

  curl -X DELETE "${NULLSPACE_API_URL}/v1/machines/mch_123/desktop/recording/rec_456" \
    -H "Authorization: Bearer ${NULLSPACE_API_KEY}"
  ```
</CodeGroup>

## Related

* [Desktop automation](./automation)
* [Managed viewer](./viewer)
* [API Reference](../api-reference)
