---
title: "Upload file to workspace"
method: POST
path: "/api/workspace/files/upload"
tags: ["workspace"]
---

# Upload file to workspace

`POST /api/workspace/files/upload`

Upload a file to the user's workspace.

Files are stored in session-scoped paths when session_id is provided,
so the agent's session-scoped tools can discover them automatically.

## Query parameters

- `session_id` string, nullable
- `overwrite` boolean

## Response `200`

Successful Response

- BackendApiFeaturesWorkspaceRoutesUploadFileResponse
  - `file_id` string, required
  - `name` string, required
  - `path` string, required
  - `mime_type` string, required
  - `size_bytes` integer, required

## Other responses

- `401` — Authentication required
- `422` — Validation Error

---

[API](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/versions/382041c7ecb2/schema)
