---
title: "Uploads a file as it is"
method: PUT
path: "/lambdas/{privateKey}/files/{path}/content"
tags: ["Workspace"]
---

# Uploads a file as it is

`PUT /lambdas/{privateKey}/files/{path}/content`

## Request

- Base URL: `https://genhttp.dev/api/v1`
- URL: `https://genhttp.dev/api/v1/lambdas/{privateKey}/files/{path}/content`
- Auth: none declared

The body is the file. It replaces a file of the same path, and the folders it goes into are made. It is written as
it arrives and only takes the place of the old one once it is complete: an upload that is refused for want of room,
or that ends before the `Content-Length` it announced, leaves what was there as it was. The way in for anything too
large for JSON.

## Path parameters

- `privateKey` string, required
- `path` string, required

## Response `200`

The file as it was written

- WorkspaceEntry: One file of a workspace.
  - `Path` string: Its path within the workspace, with forward slashes: `logs/today.txt`
  - `Size` integer: How many bytes it holds
  - `Modified` string, date-time: When it was last written

## Other responses

- `204`: A response containing no body
- `400`: The file does not fit into the data allowance of the lambda, the upload ended early, or the path cannot be used. Nothing was written.
- `403`: The lambda is a demo, which anybody may read and nobody may change. Create a lambda of your own from it instead: `POST /lambdas` with the demo's id as `template`.
- `404`: No lambda has this editor key. A key that never existed and the key of a deleted lambda are answered alike.
- `409`: The workspace is switched off.

---

[API](https://skmtc.dev/genhttp/apis/genhttp-lambda-api.md) · [All operations](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/llms.txt) · [OpenAPI document](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/revisions/8b36699e03df?raw)
