---
title: "Upload files into the global AI workspace"
method: POST
path: "/ai/workspace/files"
tags: ["AI Chat"]
---

# Upload files into the global AI workspace

`POST /ai/workspace/files`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/workspace/files`
- Auth: HTTP bearer

Writes a configured, bounded batch of safe workspace-relative files into the user's persistent global workspace without waking compute.

## Request body

- WriteApplicationWorkspaceFilesRequest
  - `files` ApplicationWorkspaceFileWrite[], required
    - `contents_b64` string, required
    - `mode` integer, nullable
    - `path` string, required: Project-relative path. Absolute paths and traversal are rejected.

## Response `200`

- WriteApplicationWorkspaceFilesResponse
  - `written` integer, required

## Other responses

- `400`
- `401`
- `403`
- `413`
- `500`

## Changes

- **2026-09-07** `504478bfd788`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/workspace/files/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
