---
title: "Write file contents"
method: POST
path: "/v1/computer/{machine_id}/fs/write"
tags: ["computer"]
---

# Write file contents

`POST /v1/computer/{machine_id}/fs/write`

## Request

- Base URL: `https://api.cyberdesk.io`
- URL: `https://api.cyberdesk.io/v1/computer/{machine_id}/fs/write`
- Auth: HTTP bearer

Write file contents to the machine.

## Path parameters

- `machine_id` string, required

## Headers

- `Idempotency-Key` string

## Request body

- FileWriteRequest
  - `path` string, required: Target file path
  - `content` string, required: Base64 encoded file content
  - `mode` string: Write mode - 'write' or 'append'

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/cyberdesk-hq/apis/cyberdesk-cloud.md) - [All operations](https://skmtc.dev/cyberdesk-hq/apis/cyberdesk-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/cyberdesk-hq/apis/cyberdesk-cloud/revisions/5579352ae05e?raw)
