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>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
sandboxId*stringpath*stringAn absolute path in the sandbox.
body*fileapplication/octet-streambinaryThe file as written
application/json- response
path*stringsize*integerint64isDir?booleanmode?integerPermission bits.
modTime?stringdate-timecurl -X PUT 'https://api.openrelay.inc/v1/sandboxes/string/files/content?path=string' \ -H 'Content-Type: application/octet-stream' \ -d 'string'{ "path": "string", "size": 0, "isDir": true, "mode": 0, "modTime": "2019-08-24T14:15:22Z"}Read a file from a sandbox GET
Streams the bytes of a regular file at the requested path inside a sandbox. A path that is not a regular file answers 400.
Expose a port of a sandbox at a public URL POST
Allows traffic to a port in the sandbox and answers the URL that reaches it. Exposing a public port again answers the same URL. With access signed, only a URL that carries a signature the router made reaches the port, and the answer is such a URL, valid for expiresInSeconds (default 3600) and never past the sandbox's end. Exposing a signed port again answers a fresh signed URL, and the URLs answered before keep working until their expiry or until the port is unexposed. Without the organization's signed previews, access signed is refused with 400.