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/filesList all files in a site with paths and sizes.
Auth:
Bearer tokenURL Parameters
| id | Site ID |
Response
200 OK
{ "data": [{ "path": "index.html", "size": 4521 }] }POST
/api/v1/sites/:id/filesCreate or update a file. Auto-commits to GitHub and publishes to CDN.
Auth:
Bearer tokenURL Parameters
| id | Site ID |
Request Body
| Field | Type | Description |
|---|---|---|
| path | string | File path (e.g., "index.html") |
| content | string | Complete file content |
Response
200 OK
{ "data": { "path": "index.html", "commit_sha": "abc1234", "published": true } }GET
/api/v1/sites/:id/files/:pathRead a file's content.
Auth:
Bearer tokenURL Parameters
| id | Site ID |
| path | File path |
Response
200 OK
{ "data": { "path": "index.html", "content": "<!DOCTYPE html>..." } }DELETE
/api/v1/sites/:id/files/:pathDelete a file from the site.
Auth:
Bearer tokenURL Parameters
| id | Site ID |
| path | File path |
Response
200 OK
{ "data": { "deleted": true } }