---
title: "Attach File"
method: POST
path: "/sessions/{session_id}/attach"
tags: ["workspace"]
---

# Attach File

`POST /sessions/{session_id}/attach`

## Request

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

Store an uploaded attachment under files/ in the workspace.

Uploads stream to disk and return 413 above the smaller of max_upload_bytes
and 25,000,000 bytes. Return the workspace-relative and mounted paths using
the filename's final component. Invalid filenames return 422 and a busy
Session lock returns 409. The uploaded file is closed even on failure.

## Path parameters

- `session_id` string, required

## Request body `multipart/form-data`

- BodyAttachFileSessionsSessionIdAttachPost
  - `file` string, binary, required

## Response `200`

Successful Response

- Attached: Location of an uploaded attachment in the workspace and the sandbox.
  - `mounted_path` string, required
  - `rel_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`: 3 info
  - api tag `workspace` added
  - added the required property `mounted_path` to the response with the `200` status
  - added the required property `rel_path` to the response with the `200` status
- **2026-10-14** `a01a68d223a6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/qredence/apis/fleet-rlm/changes/sessions/:session_id/attach/post.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)
