---
title: "Upload Agent File"
method: POST
path: "/api/agents/{agent_id}/files/upload"
tags: ["files"]
---

# Upload Agent File

`POST /api/agents/{agent_id}/files/upload`

## 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/upload`
- Auth: HTTP bearer

Push a file from the user into the agent's container.

Two modes:
  - Chat attachment (no `dest_dir`): writes into the framework inbox with
    a timestamp prefix and notifies the agent via /chat.
  - File-manager upload (`dest_dir` under /data): writes into that exact
    directory keeping the original name, no chat notice.

Returns the in-container path the file landed at.

## Path parameters

- `agent_id` string, required

## Request body `multipart/form-data`

- BodyUploadAgentFileApiAgentsAgentIdFilesUploadPost
  - `file` string, binary, required
  - `message` string, nullable
  - `dest_dir` string, nullable

## 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)
