Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
Skip to Content
API ReferenceComputeSandboxes

Write a file into a sandbox

Writes bytes to a file inside a sandbox, creating or replacing it. The parent directory must exist; repeating the same write is safe. The request body is written to path, created if missing and truncated if not. A client may retry the same bytes after a lost connection.

Required permission

Requires the sandboxes.exec permission. See Permissions for the roles and API key permissions that include it.

Command line

The orl CLI wraps this endpoint:

Guided workflow: orl sandbox file write

orl sandbox file write <sandbox-id> <path>
PUT
/v1/sandboxes/{sandboxId}/files/content

Authorization

apiKey
headerAuthorizationBearer <token>

OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).

Path Parameters

sandboxId*string

Query Parameters

path*string

An absolute path in the sandbox.

Request Body

body*fileapplication/octet-stream
Formatbinary

Response Body

The file as written

application/json
  1. response
path*string
size*integer
Formatint64
isDir?boolean
mode?integer

Permission bits.

modTime?string
Formatdate-time
Example Request
curl -X PUT 'https://api.openrelay.inc/v1/sandboxes/string/files/content?path=string' \  -H 'Content-Type: application/octet-stream' \  -d 'string'
Example Response
{  "path": "string",  "size": 0,  "isDir": true,  "mode": 0,  "modTime": "2019-08-24T14:15:22Z"}