---
title: "Add files to a folder"
method: POST
path: "/workspaces/{id}/files"
tags: ["Folders"]
---

# Add files to a folder

`POST /workspaces/{id}/files`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/workspaces/{id}/files`
- Auth: HTTP bearer

Adds up to 100 files to the folder. A file can be in several folders.
Partial success: the response sorts every requested id into `linked`,
`already_linked` or `not_found` (unknown or not owned by the caller),
so one bad id does not lose the rest.

## Path parameters

- `id` string, required

## Request body

- FolderFilesRequest
  - `file_ids` string[], required

## Response `200`

Result per file id

- FolderFilesResult: Partial success. Each requested file id lands in exactly one bucket.
  - `linked` string[], required: Files newly added to the folder.
  - `already_linked` string[], required: Files that were already in the folder.
  - `not_found` string[], required: Ids that do not exist or are not owned by the caller.

## Other responses

- `400`: Request body failed validation
- `401`: Missing or invalid API key / JWT
- `404`: Unknown folder (or not owned by the caller)

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/workspaces/:id/files/post.md)

---

[API](https://skmtc.dev/varg/apis/varg-api.md) · [All operations](https://skmtc.dev/varg/apis/varg-api/llms.txt) · [OpenAPI document](https://skmtc.dev/varg/apis/varg-api/revisions/09d49a6d852f?raw)
