POST /v1/agents/runtime/{runtime_id}/files/delete
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 delete
sandbox.file.write("/workspace/temp.txt", "temporary\n")
response = sandbox.file.delete("/workspace/temp.txt")
print(response.message)
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 delete
await sandbox.file.write("/workspace/temp.txt", "temporary\n");
const response = await sandbox.file.delete("/workspace/temp.txt");
console.log(response.message);
await sandbox.kill();
gravixlayer runtime files rm "$RT" /tmp/hello.txt
curl -X POST "https://api.gravixlayer.ai/v1/agents/runtime/$RT/files/delete" \
-H "Authorization: Bearer $GRAVIXLAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"path": "/tmp/hello.txt"}'
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | File or directory path |
Response
| Field | Type | Description |
|---|---|---|
message | string | Confirmation message |
path | string | Deleted path |