---
title: "Write one file into a session's workspace"
method: PUT
path: "/v1/sessions/{sid}/files/{path}"
---

# Write one file into a session's workspace

`PUT /v1/sessions/{sid}/files/{path}`

## Request

- Base URL: `https://api.harnessrouter.ai`
- URL: `https://api.harnessrouter.ai/v1/sessions/{sid}/files/{path}`
- Auth: none declared

## Path parameters

- `sid` string, required
- `path` string, required

## Request body

- WorkspaceWrite
  - `content` string, nullable
  - `content_b64` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

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