API Documentation

SFTP Rename or Move

Rename or move a file or directory on a VPS. The destination must not already exist; the operation will not overwrite existing files.

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
from string Yes Absolute source path
to string Yes Absolute destination path
{
  "from": "/var/www/old-name.html",
  "to":   "/var/www/new-name.html"
}

Response

{
  "data": {
    "from": "/var/www/old-name.html",
    "to":   "/var/www/new-name.html",
    "renamed": true
  }
}

Response Fields

Field Type Description
from string Normalized source path
to string Normalized destination path
renamed boolean Always true on success

Errors

Status Code Description
400 INVALID_BODY Request body is not valid JSON
400 INVALID_FROM from is not an absolute path
400 INVALID_TO to is not an absolute path
400 RENAME_FAILED Generic rename failure
403 RENAME_FAILED Permission denied
404 NOT_FOUND VPS not found, not accessible, or source path does not exist
409 RENAME_FAILED Destination already exists
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/rename" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from": "/var/www/old.html", "to": "/var/www/new.html"}'

MCP

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