---
title: "Write Workspace File"
method: PUT
path: "/sessions/{session_id}/workspace/files/{rel_path}"
tags: ["workspace"]
---

# Write Workspace File

`PUT /sessions/{session_id}/workspace/files/{rel_path}`

## Request

- The document declares no server URL.
- Auth: none declared

Write one workspace file from text or base64 content, capped at 25 MB.

Text is encoded as UTF-8; the limit is 25,000,000 encoded or decoded bytes.
Supplying both or neither content field, invalid base64, or a malformed relative path
returns 422; exceeding the limit returns 413. A busy Session lock returns 409.
Return the relative and mounted paths, byte count, and SHA-256 digest.

## Path parameters

- `rel_path` string, required
- `session_id` string, required

## Request body

- WorkspaceWriteRequest: File content for a workspace write, as text or base64; supply exactly one.
  - `content` string, nullable
  - `content_base64` string, nullable

## Response `200`

Successful Response

- FileWritten: Result of a workspace write, including the sandbox mounted path.
  - `path` string, required
  - `size_bytes` integer, required
  - `sha256` string, required
  - `mounted_path` string, required

## Other responses

- `409`: A Turn or workspace change holds the Session lock; retry when it completes
- `422`: Validation Error

## Changes

- **2026-10-18** `d7771053c999`: 1 info
  - added the non-success response with the status `409`
- **2026-10-15** `f94854aad429`: 5 info
  - api tag `workspace` added
  - added the required property `mounted_path` to the response with the `200` status
  - added the required property `path` to the response with the `200` status
  - added the required property `sha256` to the response with the `200` status
  - …1 more
- **2026-10-15** `49da87181f52`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/qredence/apis/fleet-rlm/changes/sessions/:session_id/workspace/files/:rel_path/put.md)

---

[API](https://skmtc.dev/qredence/apis/fleet-rlm.md) - [All operations](https://skmtc.dev/qredence/apis/fleet-rlm/llms.txt) - [OpenAPI document](https://skmtc.dev/qredence/apis/fleet-rlm/revisions/87de8fd61161?raw)
