Skip to Content
SeyloDocs

Write a file

POST
/api/v1/files.write

Creates or replaces a file with the given content (up to 1 MiB). Existing files keep their mode.

Needs files.write on the service (a grant on its project covers it). Available to MCP clients and the assistant.

Authorization

cookieseylo_session<token>

Request Body

application/json
  1. body
serviceId*string

Panel-issued id.

Match^[a-z0-9]{16}$
volume*string
Length1 <= length <= 64
nodeId?string

Panel-issued id.

Match^[a-z0-9]{16}$
path*string

Relative to the volume root; "" or "." is the root.

Lengthlength <= 4096
content*string
Lengthlength <= 2097152
encoding?|
Default"utf8"
createParents?boolean
Defaultfalse

Response Body

Success.

application/json
  1. response
nodeId*string

Panel-issued id.

Match^[a-z0-9]{16}$
info*
Example Request
curl -X POST 'https://example.com/api/v1/files.write' \  -H 'Content-Type: application/json' \  -d '{  "serviceId": "string",  "volume": "string",  "path": "string",  "content": "string"}'
Example Response
{  "nodeId": "string",  "info": {    "name": "string",    "path": "string",    "isDir": true,    "size": 0,    "mode": 0,    "modifiedAt": "2019-08-24T14:15:22Z",    "symlinkTarget": "string",    "uid": 0,    "gid": 0  }}