Files

Read, write, list, and delete files in a site. Changes are committed to GitHub and auto-published to CDN.

GET/api/v1/sites/:id/files

List all files in a site with paths and sizes.

Auth: Bearer token

URL Parameters

idSite ID

Response

200 OK
{ "data": [{ "path": "index.html", "size": 4521 }] }
POST/api/v1/sites/:id/files

Create or update a file. Auto-commits to GitHub and publishes to CDN.

Auth: Bearer token

URL Parameters

idSite ID

Request Body

FieldTypeDescription
pathstringFile path (e.g., "index.html")
contentstringComplete file content

Response

200 OK
{ "data": { "path": "index.html", "commit_sha": "abc1234", "published": true } }
GET/api/v1/sites/:id/files/:path

Read a file's content.

Auth: Bearer token

URL Parameters

idSite ID
pathFile path

Response

200 OK
{ "data": { "path": "index.html", "content": "<!DOCTYPE html>..." } }
DELETE/api/v1/sites/:id/files/:path

Delete a file from the site.

Auth: Bearer token

URL Parameters

idSite ID
pathFile path

Response

200 OK
{ "data": { "deleted": true } }