curl -X PUT https://api.phanomcloud.online/bots/3fa85f64-5717-4562-b3fc-2c963f66afa6/files/content \
-H "Authorization: Bearer sess_..." \
-H "Content-Type: application/json" \
-d '{
"path": "index.js",
"content": "console.log(\"Hello World\");"
}'
await fetch("https://api.phanomcloud.online/bots/BOT_ID/files/content", {
method: "PUT",
headers: {
Authorization: "Bearer sess_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
path: "config.json",
content: JSON.stringify({ prefix: "!", debug: false }, null, 2)
})
});
{
"success": true,
"data": { "path": "index.js" },
"message": "File saved. Restart the bot to apply changes."
}
Files
Write File
Creates or overwrites a file in the bot’s directory with the given content.
PUT
/
bots
/
{id}
/
files
/
content
curl -X PUT https://api.phanomcloud.online/bots/3fa85f64-5717-4562-b3fc-2c963f66afa6/files/content \
-H "Authorization: Bearer sess_..." \
-H "Content-Type: application/json" \
-d '{
"path": "index.js",
"content": "console.log(\"Hello World\");"
}'
await fetch("https://api.phanomcloud.online/bots/BOT_ID/files/content", {
method: "PUT",
headers: {
Authorization: "Bearer sess_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
path: "config.json",
content: JSON.stringify({ prefix: "!", debug: false }, null, 2)
})
});
{
"success": true,
"data": { "path": "index.js" },
"message": "File saved. Restart the bot to apply changes."
}
Path Parameters
string
required
UUID of the bot.
Body
string
required
Relative path of the file to write. Example:
index.js or src/utils/helper.js. Max: 512 characters.string
required
Text content to write to the file. Max: 1 MB.
curl -X PUT https://api.phanomcloud.online/bots/3fa85f64-5717-4562-b3fc-2c963f66afa6/files/content \
-H "Authorization: Bearer sess_..." \
-H "Content-Type: application/json" \
-d '{
"path": "index.js",
"content": "console.log(\"Hello World\");"
}'
await fetch("https://api.phanomcloud.online/bots/BOT_ID/files/content", {
method: "PUT",
headers: {
Authorization: "Bearer sess_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
path: "config.json",
content: JSON.stringify({ prefix: "!", debug: false }, null, 2)
})
});
{
"success": true,
"data": { "path": "index.js" },
"message": "File saved. Restart the bot to apply changes."
}
⌘I

