API Documentation

SFTP Change Permissions

Change Unix permissions on a file or directory on a VPS. The mode may be supplied as an octal string (e.g. "0755", "644") or as a decimal integer in the range 0-4095.

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 file or directory
mode string | number Yes Octal string ("0755", "644") or decimal int (04095)
{
  "path": "/var/www/html/script.sh",
  "mode": "0755"
}

Response

{
  "data": {
    "path": "/var/www/html/script.sh",
    "mode": "0755"
  }
}

Response Fields

Field Type Description
path string Normalized absolute path
mode string Applied permission mode as a 3- or 4-digit octal string

Errors

Status Code Description
400 INVALID_BODY Request body is not valid JSON
400 INVALID_PATH Path is not absolute
400 INVALID_MODE Mode is not an octal string or a valid decimal int (04095)
400 CHMOD_FAILED Generic chmod failure
403 CHMOD_FAILED Permission denied
404 CHMOD_FAILED Target path does not exist
404 NOT_FOUND VPS not found or not accessible
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/chmod" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path": "/var/www/html/script.sh", "mode": "0755"}'

MCP

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