---
title: "Watch a directory for changes"
method: POST
path: "/browsers/{id_or_name}/fs/watch"
tags: ["Browser Filesystem"]
---

# Watch a directory for changes

`POST /browsers/{id_or_name}/fs/watch`

## Request

- Base URL: `https://api.onkernel.com`
- URL: `https://api.onkernel.com/browsers/{id_or_name}/fs/watch`
- Auth: HTTP bearer

## Path parameters

- `id_or_name` string, required

## Request body

- StartFsWatchRequest
  - `path` string, required: Directory to watch.
  - `recursive` boolean: Whether to watch recursively.

## Response `201`

Watch started successfully

- object
  - `watch_id` string: Unique identifier for the directory watch

## Other responses

- `400`: Bad Request – invalid input
- `403`: Forbidden – insufficient permissions or plan
- `404`: Resource not found
- `500`: Internal Server Error
- `default`: Error returned by the browser or its proxy

---

[API](https://skmtc.dev/onkernel/apis/kernel-api.md) - [All operations](https://skmtc.dev/onkernel/apis/kernel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/onkernel/apis/kernel-api/revisions/0f6cf4f58fe6?raw)
