Watch a file or directory for changes.
Starts a watch in the sandbox and answers once it is watching, so nothing changed after the answer is missed. Read its events with GET .../watches/{watchId}/events (poll with a cursor, or follow=true for a stream). Default events are create, write, remove, rename (with oldPath) and chmod; access events are opt-in. Events are batched every batchMs with repeated writes folded into one event. A new directory under a recursive watch is scanned when it appears, so files made in it before its watch took effect are reported too. At most 4 watches per sandbox; each ends after timeoutMs, or runs until stopped when timeoutMs is zero. webhook: true also sends its changes to the account's webhooks as sandbox.files.changed events, so nothing has to read it. Needs the exec scope. Wakes a paused sandbox.
Request
- Base URL: https://api.withruntime.com
- URL: https://api.withruntime.com/v1/sandboxes/{id}/files/watches
- Auth: HTTP bearer
Path parameters
Resource identifier (UUID).
Headers
Replaying the same key with the same request within 24 hours returns the first result and never repeats the effect. A refusal is not kept: a request refused before it ran (no_capacity, busy, a limit) runs afresh when sent again with its key. The SDKs send one automatically; the server makes one when absent and returns it in the idempotency-key response header.
Request body
Response
Success
Changes
No recorded changes to this operation across all 1 revision of this API.