---
title: "Stage files"
method: POST
path: "/files/stage"
tags: ["files"]
---

# Stage files

`POST /files/stage`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/files/stage`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Stage uploaded content into the workspace.

## Request body

- object
  - `files` object[]: Files to write. Each needs text or base64.
    - `path` string, required
    - `text` string
    - `base64` string
  - `path` string: Single-file shortcut.
  - `text` string
  - `base64` string
  - `lastModifiedBy` string

## Response `200`

Successful response

- object
  - `ok` boolean, required
  - `staged` object[], required
    - `path` string, required
    - `size` number, required
    - `result` object, required
      - `path` string, required
      - `contentHash` string, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

[API](https://skmtc.dev/dench/apis/dench-api.md) - [All operations](https://skmtc.dev/dench/apis/dench-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dench/apis/dench-api/revisions/4a145b38f19c?raw)
