---
title: "Upload a file"
method: POST
path: "/v1/sessions/{sessionId}/files"
tags: ["Files"]
---

# Upload a file

`POST /v1/sessions/{sessionId}/files`

Uploads a file to a session via `multipart/form-data` with a `file` field that accepts either binary data or a URL string to download from, and an optional `path` field for the file storage path.

## Path parameters

- `sessionId` string, required

## Response `201`

Default Response

- FileDetails
  - `lastModified` string, date-time, required — Timestamp when the file was created
  - `path` string, required — Path to the file in the storage system
  - `size` number, required — Size of the file in bytes

## Other responses

- `400` — An error response from the API
- `401` — An error response from the API
- `404` — An error response from the API
- `409` — An error response from the API
- `415` — An error response from the API
- `500` — An error response from the API

## Changes

- **2026-06-16** `7b73b0d57792` — 1 breaking
  - request body became required
- **2026-06-07** `4985d7bcd32f` — 6 info
  - added the non-success response with the status `401`
  - added the optional property `linkToDocs` to the response with the `400` status
  - added the optional property `linkToDocs` to the response with the `404` status
  - added the optional property `linkToDocs` to the response with the `409` status
  - …2 more
- **2026-01-08** `97dcad9b050e` — 2 breaking, 7 info
  - the request property `file` became required
  - the `file` request property contentEncoding changed from `` to `binary`
  - the `file` request property type/format was generalized from ``/`` to `string`/`binary`
  - the response property `context/items/params` became required for the status `400`
  - …5 more
- **2025-08-11** `15ffd3fc04f3` — 1 breaking, 6 info
  - removed the success response with the status `200`
  - added the non-success response with the status `400`
  - added the non-success response with the status `404`
  - added the non-success response with the status `409`
  - …3 more
- **2025-05-30** `d5a9cdf80ea2` — 1 info
  - endpoint added

[Full history](https://skmtc.dev/steel-dev/apis/steel-api/changes/v1/sessions/:sessionId/files/post.md)

---

[API](https://skmtc.dev/steel-dev/apis/steel-api.md) · [All operations](https://skmtc.dev/steel-dev/apis/steel-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/steel-dev/steel-api/revisions/2248d956188a/schema)
