---
title: "Write Agent File"
method: PUT
path: "/api/agents/{agent_id}/files/write"
tags: ["files"]
---

# Write Agent File

`PUT /api/agents/{agent_id}/files/write`

## Request

- Base URL: `https://api.maritime.sh` (the document declares no server; this is the origin it was published from)
- URL: `https://api.maritime.sh/api/agents/{agent_id}/files/write`
- Auth: HTTP bearer

Write text content to a file inside the agent container (workspace editor).

Scoped to the agent's persistent volume, on whole path segments (so
`/datafoo` is rejected for a /data-rooted agent).

## Path parameters

- `agent_id` string, required

## Request body

- object

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

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