The execd filesystem API provides complete file and directory management inside a running sandbox. Endpoints cover reading file metadata, deleting files and directories, changing permissions and ownership, moving and renaming, glob-based search, batch content replacement, multipart upload, and binary download with HTTP range request support. All requests are served by theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/opensandbox-group/OpenSandbox/llms.txt
Use this file to discover all available pages before exploring further.
execd daemon at http://localhost:44772 and require the X-EXECD-ACCESS-TOKEN header.
GET /files/info
Retrieves detailed metadata for one or more files, including permissions, owner, group, size, and modification time. Returns a map of file paths toFileInfo objects.
Auth: X-EXECD-ACCESS-TOKEN header required.
Query Parameters
File path(s) to retrieve metadata for. Can be specified multiple times for batch lookup.
Response — 200 OK
A JSON object mapping each requested path to itsFileInfo:
Example
DELETE /files
Deletes one or more files from the sandbox. This endpoint removes files only — useDELETE /directories for recursive directory removal.
Auth: X-EXECD-ACCESS-TOKEN header required.
Query Parameters
File path(s) to delete. Can be specified multiple times.
Example
POST /files/permissions
Changes permissions (mode), owner, and group for one or more files. Accepts a JSON object mapping file paths to permission settings. Auth:X-EXECD-ACCESS-TOKEN header required.
Request Body
A JSON object where each key is an absolute file path and each value is aPermission object:
Permission mode in octal format (e.g.
644, 755).Owner username.
Group name.
Example
POST /files/mv
Renames or moves one or more files. The target directory must already exist. Accepts an array of{src, dest} pairs.
Auth: X-EXECD-ACCESS-TOKEN header required.
Request Body
An array of rename/move items:Source file path.
Destination file path.
Example
GET /files/search
Searches for files matching a glob pattern within a specified root directory and its subdirectories. Returns an array ofFileInfo objects for matching files.
Auth: X-EXECD-ACCESS-TOKEN header required.
Query Parameters
Root directory path to search in.
Glob pattern to match files. Supports
**, *.txt, etc. Default: ** (all files).Response — 200 OK
An array ofFileInfo objects for all files matching the pattern.
Example
POST /files/replace
Performs batch text replacement across one or more files. Replaces all occurrences ofold with new in each specified file (equivalent to strings.ReplaceAll). File permissions are preserved. Use the optional verbose query parameter to receive per-file replacement counts in the response body.
Auth: X-EXECD-ACCESS-TOKEN header required.
Query Parameters
When
true, the response body includes per-file replacement counts. Default: false (empty response body).Request Body
A JSON object mapping absolute file paths to replacement specs:String to find and replace (must not be empty).
Replacement string.
Response — 200 OK (verbose)
Whenverbose=true, returns an object mapping paths to replacement results:
Number of occurrences replaced.
0 means the search string was not found.Example
POST /files/upload
Uploads one or more files to specified paths inside the sandbox usingmultipart/form-data. Each file upload consists of two consecutive multipart parts: a JSON metadata part followed by the binary file part.
Auth: X-EXECD-ACCESS-TOKEN header required.
Form Fields
JSON-encoded
FileMetadata object specifying the target path and optional permissions.The file content to upload (
application/octet-stream).Example
GET /files/download
Downloads a file from the sandbox. Supports full binary download, HTTP range requests for partial content retrieval, and line-based text reads viaoffset/limit query parameters.
Auth: X-EXECD-ACCESS-TOKEN header required.
Query Parameters
Absolute or relative path of the file to download.
Starting line number (1-based) for line-based reading. Mutually exclusive with the
Range header. Returns text/plain content when used.Number of lines to return when using line-based reading. Mutually exclusive with the
Range header.Request Headers
Standard HTTP
Range header for partial byte-range requests. Example: bytes=0-1023. Mutually exclusive with offset/limit.Response
- 200 OK — Full file content (
application/octet-stream) or line-based text (text/plainwhenoffset/limitare used). - 206 Partial Content — Partial file bytes when
Rangeheader is provided. IncludesContent-RangeandContent-Lengthheaders. - 416 Range Not Satisfiable — The requested byte range cannot be fulfilled.
Example
GET /directories/list
Lists entries under a directory with optional depth control. By default, only immediate children are returned (depth=1). Symbolic links are reported with type=symlink and are never traversed. Entries are returned in lexical order.
Auth: X-EXECD-ACCESS-TOKEN header required.
Query Parameters
Directory path to list. Must not resolve to a symbolic link.
Maximum depth of descendants to include.
1 returns immediate children only. Default: 1.Example
POST /directories
Creates one or more directories with specified permissions. Parent directories are created as needed (mkdir -p semantics). Accepts a JSON object mapping directory paths to permission objects.
Auth: X-EXECD-ACCESS-TOKEN header required.
Example
DELETE /directories
Recursively deletes one or more directories and all their contents. Equivalent torm -rf.
Auth: X-EXECD-ACCESS-TOKEN header required.
Query Parameters
Directory path(s) to delete. Can be specified multiple times.
Example
GET /metrics
Returns a point-in-time snapshot of system resource utilization for the sandbox, including CPU count, CPU usage percentage, total memory, used memory, and a timestamp. Auth:X-EXECD-ACCESS-TOKEN header required.
Response — 200 OK
Number of CPU cores available.
CPU usage as a percentage (0–100).
Total available memory in MiB.
Currently used memory in MiB.
Unix milliseconds when the metrics snapshot was collected.
Example
GET /metrics/watch
Streams system resource metrics in real-time using Server-Sent Events (SSE). The server emits aMetrics snapshot approximately once per second. The connection stays open until the client disconnects.
Auth: X-EXECD-ACCESS-TOKEN header required.
Response — 200 OK (text/event-stream)
Each SSE event carries a Metrics object with the same fields as GET /metrics: cpu_count, cpu_used_pct, mem_total_mib, mem_used_mib, and timestamp.