POST /v1/agents/runtime/{runtime_id}/files/set-mode
Sets permission bits using a chmod-style octal string (for example "644" or "0755").
from gravixlayer import GravixLayer
client = GravixLayer() # defaults to cloud="aws", region="us-east-1"
sandbox = client.runtime.create() # defaults to template="base-small"
# Create the file first so we have something to chmod
sandbox.file.write("/workspace/file.txt", "hello\n")
sandbox.file.set_permissions("/workspace/file.txt", "644")
sandbox.kill()
import { GravixLayer } from 'gravixlayer';
const client = new GravixLayer(); // defaults to cloud="aws", region="us-east-1"
const sandbox = await client.runtime.create(); // defaults to template="base-small"
// Create the file first so we have something to chmod
await sandbox.file.write("/workspace/file.txt", "hello\n");
await sandbox.file.setPermissions("/workspace/file.txt", "644");
await sandbox.kill();
gravixlayer runtime files chmod "$RT" /workspace/script.sh 755
curl -X POST "https://api.gravixlayer.ai/v1/agents/runtime/$RT/files/set-mode" \
-H "Authorization: Bearer $GRAVIXLAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path": "/workspace/script.sh", "mode": "755"}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | File or directory path |
mode | string | Yes | Octal mode string, e.g. "644", "0755" |
Response (SetPermissionsResponse)
| Field | Type | Description |
|---|---|---|
message | string | Confirmation message |
success | boolean | Whether the operation succeeded |