---
title: "Write text file contents to Devbox filesystem."
method: POST
path: "/v1/devboxes/{id}/write_file_contents"
tags: ["Devbox", "Devbox-FileTools"]
---

# Write text file contents to Devbox filesystem.

`POST /v1/devboxes/{id}/write_file_contents`

Write UTF-8 string contents to a file at path on the Devbox. Note for large files (larger than 100MB), the upload_file endpoint must be used.

## Path parameters

- `id` string, required

## Request body

- DevboxWriteFileParameters
  - `file_path` string, required — The path to write the file to on the Devbox. Path is relative to user home directory.
  - `contents` string, required — The UTF-8 string contents to write to the file.

## Response `200`

OK

- DevboxExecutionDetailView
  - `devbox_id` string, required — Devbox id where command was executed.
  - `stdout` string, required — Standard out generated by command.
  - `stderr` string, required — Standard error generated by command.
  - `exit_status` integer, required — Exit status of command execution.
  - `shell_name` string, nullable — Shell name.

## Other responses

- `404` — Devbox not found.

---

[API](https://skmtc.net/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.net/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/runloopai/runloop-api/versions/ef553a04de89/schema)
