API Documentation

SFTP Create Directory

Create a directory on a VPS. By default, parent directories are created as needed (mkdir -p behavior); set recursive: false to require that the parent already exists.

Required scope: vps:manage

Path Parameters

Parameter Type Description
id string The VPS ID

Headers

Header Required Value
Authorization Yes Bearer YOUR_API_KEY
Content-Type Yes application/json

Request Body

Field Type Required Description
path string Yes Absolute path of the directory to create
recursive boolean No Create parent directories as needed (default: true)
{
  "path": "/var/www/uploads/2026"
}

Response

{
  "data": {
    "path": "/var/www/uploads/2026",
    "created": true,
    "recursive": true
  }
}

Response Fields

Field Type Description
path string Normalized absolute path that was created
created boolean Always true on success
recursive boolean Whether parent directories were created automatically

Errors

Status Code Description
400 INVALID_BODY Request body is not valid JSON
400 INVALID_PATH Path is not absolute
400 MKDIR_FAILED Generic mkdir failure
403 MKDIR_FAILED Permission denied
404 MKDIR_FAILED Parent directory does not exist (non-recursive only)
404 NOT_FOUND VPS not found or not accessible
409 MKDIR_FAILED Directory already exists (non-recursive only)
502 SSH_AUTH SSH authentication failed
502 SSH_CONN Could not connect to VPS
504 SSH_TIMEOUT SSH command timed out

Example

curl -X POST "https://site.quest/api/v1/vps/699cdea2ab57a244bb5273fd/sftp/mkdir" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path": "/var/www/uploads/2026"}'

MCP

This endpoint is not yet wrapped as an MCP tool. Use the REST endpoint above directly.