OpenMetal
API referenceRuntime

Write Sandbox File

POST
/v1/sandboxes/{sandbox_id}/filesystem/write

Authorization

bearerAuth
AuthorizationBearer <token>

Use a project API key for sandbox and runtime routes, or an OpenMetal user access token for account management routes.

In: header

Path Parameters

sandbox_id*string
Match^sbx_[A-Za-z0-9]+$

Header Parameters

Idempotency-Key?string
Length1–512
X-Metal-Project-ID*string

Public project ID used to scope sandbox access.

Match^prj_[A-Za-z0-9]+$

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

path*string
Match^\/(?:[^/\0]+(?:\/[^/\0]+)*)?$Length1–4096
data_base64*string
Match^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$Length0–13981016
mode*string
Valuescreate, overwrite, appendDefaultoverwrite
create_parents*boolean
Defaultfalse

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/sandboxes/string/filesystem/write" \  -H "X-Metal-Project-ID: string" \  -H "Content-Type: application/json" \  -d '{    "path": "string",    "data_base64": "string",    "mode": "create",    "create_parents": false  }'
{  "id": "string",  "type": "runtime_operation",  "project_id": "string",  "sandbox_id": "string",  "kind": "filesystem_read",  "state": "queued",  "result": {    "kind": "filesystem_read",    "path": "string",    "data_base64": "string",    "offset_bytes": 0,    "byte_length": 0,    "eof": true  },  "error": {    "code": "string",    "message": "string",    "retryable": true,    "details": {      "property1": null,      "property2": null    }  },  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "completed_at": "2019-08-24T14:15:22Z",  "provider_capabilities": {    "provider": "blaxel",    "version": "string",    "lifecycle": {      "pause": true,      "resume": true    },    "process": {      "execute": true,      "cancel": true,      "ordered_output": true,      "max_timeout_seconds": 1,      "max_output_bytes": 1    },    "filesystem": {      "read": true,      "write": true,      "write_modes": [        "create"      ],      "create_parents": true,      "list": true,      "delete": true,      "max_read_bytes": 1,      "max_write_bytes": 1    },    "http_endpoints": {      "create": true,      "revoke": true,      "max_lease_seconds": 1    },    "computer": {      "implementation": "native",      "actions": [        "mouse_move"      ],      "screenshot": {        "formats": [          "png"        ],        "max_bytes": 1      },      "recording": {        "formats": [          "mp4"        ]      }    }  }}