API Documentation

Write File

Write content to a file in the webspace home. Creates parent directories as needed. Max 10 MB.

Required scope: webspace:manage

Headers

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

Request Body

Parameter Required Description
path Yes Absolute path inside ~/.
content Yes File content (string).
encoding No utf8 (default) or base64.

Response

{ "data": { "path": "/home/ws_0862c/public_html/index.html", "size": 256 } }

Error Responses

Status Code Description
400 MISSING_CONTENT content is missing or not a string.
413 CONTENT_TOO_LARGE Content exceeds 10 MB.

Example

curl -X PUT https://hosting.site.quest/api/v1/webspaces/69e80ac1.../sftp/write \
  -H "Authorization: Bearer sq_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "path": "/home/ws_0862c/public_html/hello.txt", "content": "Hello World!" }'

MCP

This action is also available via the webspace_write_file MCP tool.