Filesystem API
Read File
Section titled "Read File"GET
/v1/sprites/{name}/fs/readRead file contents from the sprite filesystem. Returns raw file bytes.
Query Parameters
path:string
Path to the file to read
workingDir:string
Working directory for resolving relative paths
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Write File
Section titled "Write File"PUT
/v1/sprites/{name}/fs/writeWrite file contents to the sprite filesystem. Request body contains raw file bytes.
Query Parameters
path:string
Path to the file to write
workingDir:string
Working directory for resolving relative paths
mode:optionalstring
File permissions in octal (e.g., '0644')
mkdir:optionalboolean
Create parent directories if they don't exist
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid request body |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Query Parameters
path:string
Path to the directory to list
workingDir:string
Working directory for resolving relative paths
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Delete File or Directory
Section titled "Delete File or Directory"DELETE
/v1/sprites/{name}/fs/deleteDelete a file or directory.
Request Body
path:string
workingDir:string
recursive:boolean
asRoot:boolean
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid request body |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Rename File or Directory
Section titled "Rename File or Directory"POST
/v1/sprites/{name}/fs/renameRename or move a file or directory.
Request Body
source:string
dest:string
workingDir:string
asRoot:boolean
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid request body |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Copy File or Directory
Section titled "Copy File or Directory"POST
/v1/sprites/{name}/fs/copyCopy a file or directory.
Request Body
source:string
dest:string
workingDir:string
recursive:boolean
preserveAttrs:boolean
asRoot:boolean
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid request body |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Change File Mode
Section titled "Change File Mode"POST
/v1/sprites/{name}/fs/chmodChange file or directory permissions.
Request Body
path:string
workingDir:string
mode:string
recursive:boolean
asRoot:boolean
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid request body |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Change File Owner
Section titled "Change File Owner"POST
/v1/sprites/{name}/fs/chownChange file or directory ownership.
Request Body
path:string
workingDir:string
uid:any
gid:any
recursive:boolean
asRoot:boolean
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid request body |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Watch Filesystem
Section titled "Watch Filesystem"WSS
/v1/sprites/{name}/fs/watchWatch for filesystem changes via WebSocket.
Responses
Section titled “Responses”| Status | Description |
|---|---|
101 | Switching Protocols - WebSocket connection established |
400 | Bad Request - Invalid WebSocket upgrade or missing parameters |
404 | Not Found - Resource not found |
Client → Server Messages
Section titled “Client → Server Messages”WatchMessage
Section titled “WatchMessage”| Field | Type | Description |
|---|---|---|
type | string | |
paths | string[] | |
recursive | boolean | |
workingDir | string | |
path | string | |
event | string | |
timestamp | string | |
size | number | |
isDir | boolean | |
message | string |
Server → Client Messages
Section titled “Server → Client Messages”WatchMessage
Section titled “WatchMessage”| Field | Type | Description |
|---|---|---|
type | string | |
paths | string[] | |
recursive | boolean | |
workingDir | string | |
path | string | |
event | string | |
timestamp | string | |
size | number | |
isDir | boolean | |
message | string |
Request