Skip to main content
Use this endpoint to write a file to an absolute path inside a running capsule. The request uses multipart/form-data with two fields: the destination path and the file content. For files larger than a few megabytes, use the streaming variant to avoid buffering the entire payload in memory.

Endpoint

Authentication

string
required
Your team’s API key. Pass the full wrn_... key value.

Path parameters

string
required
The ID of the capsule to write the file into. The capsule must be in the running state.

Request body

Content-Type: multipart/form-data
string
required
Absolute destination path inside the capsule filesystem, e.g. "/app/main.py". The parent directory must already exist.
binary
required
The file content to upload.

Example request

Response

Returns 204 No Content on success. No body is returned.

Streaming upload

For large files, use the streaming endpoint instead. It streams the payload directly to the capsule without buffering it in memory on the server:
The request format is identical — multipart/form-data with path and file fields. The response is also 204 No Content on success.
Use the streaming endpoint for files larger than a few MB. The standard endpoint buffers the whole file before writing; the streaming endpoint does not.

Python SDK

Error responses