Skip to main content
All file endpoints operate within the pod’s filesystem. Paths must be absolute and within /home/instapod, /var/www, or /tmp.

List Files

GET /api/pods/{name}/files?path=/home/instapod/app
Query ParamTypeDefaultDescription
pathstringPod’s app rootDirectory to list
Response: 200 OK
{
  "path": "/home/instapod/app",
  "files": [
    {
      "name": "index.js",
      "permissions": "-rw-r--r--",
      "size": "1234",
      "is_dir": false
    },
    {
      "name": "node_modules",
      "permissions": "drwxr-xr-x",
      "size": "4096",
      "is_dir": true
    }
  ]
}
Returns an empty files array if the directory doesn’t exist.

Read a File

GET /api/pods/{name}/files/content?path=/home/instapod/app/index.js
Query ParamTypeRequiredDescription
pathstringYesAbsolute file path
Response: 200 OK
{
  "path": "/home/instapod/app/index.js",
  "content": "const express = require('express');\n..."
}

Write a File

PUT /api/pods/{name}/files/content
Request Body:
{
  "path": "/home/instapod/app/index.js",
  "content": "const express = require('express');\n..."
}
Response: 200 OK
{
  "status": "saved",
  "path": "/home/instapod/app/index.js"
}
Parent directories are created automatically if they don’t exist.

Upload a File

POST /api/pods/{name}/files/upload
Request: multipart/form-data
FieldTypeRequiredDescription
fileFileYesFile to upload (max 32 MB)
pathstringNoTarget directory (default: app root)
Response: 200 OK
{
  "status": "uploaded",
  "path": "/home/instapod/app/style.css"
}

Download a File

GET /api/pods/{name}/files/download?path=/home/instapod/app/data.json
Returns the raw file contents as binary with Content-Disposition: attachment.

Delete a File

DELETE /api/pods/{name}/files?path=/home/instapod/app/old-file.js
Response: 200 OK
{
  "status": "deleted",
  "path": "/home/instapod/app/old-file.js"
}
Works on both files and directories (recursive delete).

Rename / Move

POST /api/pods/{name}/files/rename
Request Body:
{
  "old_path": "/home/instapod/app/old-name.js",
  "new_path": "/home/instapod/app/new-name.js"
}
Response: 200 OK
{
  "status": "renamed",
  "old_path": "/home/instapod/app/old-name.js",
  "new_path": "/home/instapod/app/new-name.js"
}

Copy

POST /api/pods/{name}/files/copy
Request Body:
{
  "source_path": "/home/instapod/app/config.js",
  "dest_path": "/home/instapod/app/config.backup.js"
}
Response: 200 OK
{
  "status": "copied",
  "source_path": "/home/instapod/app/config.js",
  "dest_path": "/home/instapod/app/config.backup.js"
}
Works recursively for directories.

Create Folder

POST /api/pods/{name}/folders
Request Body:
{
  "path": "/home/instapod/app/src/components"
}
Response: 200 OK
{
  "status": "created",
  "path": "/home/instapod/app/src/components"
}
Creates the full directory tree (equivalent to mkdir -p).

Path Validation

All paths must be:
  • Absolute (start with /)
  • Within allowed directories: /home/instapod, /var/www, or /tmp
  • Free of traversal (no .. segments)
Invalid paths return 400 Bad Request.