files

Write a file of up to 1 MiB from the raw request body. Parent directories are made.

Atomic: readers see the old file or the new one. Larger files: POST .../uploads (the SDKs switch for you).

put/v1/sandboxes/{id}/files/content

Request

  • Base URL: https://api.withruntime.com
  • URL: https://api.withruntime.com/v1/sandboxes/{id}/files/content
  • Auth: HTTP bearer

Path parameters

idstring required

Resource identifier (UUID).

Query parameters

pathstring

Absolute path in the sandbox, e.g. /workspace/app/main.py. Any path the sandbox user may use.

modestring

Octal permissions for the file, e.g. 755 for a program. Default 644. No set-id or sticky bits.

Example:755

Headers

Idempotency-Keystring

Replaying the same key with the same request within 24 hours returns the first result and never repeats the effect. A refusal is not kept: a request refused before it ran (no_capacity, busy, a limit) runs afresh when sent again with its key. The SDKs send one automatically; the server makes one when absent and returns it in the idempotency-key response header.

Response

Success

pathstring required
sizeinteger required
sha256string required

Changes

No recorded changes to this operation across all 1 revision of this API.