endpoint
DELETE
/api/sites/{id}/files?path=app.js
Delete a file
auth: API keybase https://app.nz
Request
curl -sX DELETE "https://app.nz/api/sites/{id}/files?path=app.js" \
-H "Authorization: Bearer pk_live_..."Sites API
Host a static site straight from the control plane. Create a slug, push files (index.html + assets, text or binary), and it is published instantly at both app.nz/sites/<slug>/ and its own subdomain <slug>.app.nz. No build step, no DNS wait. The subdomain is the right home for SPAs — bundlers emit absolute /assets/… paths that only resolve from a site root — and it is served straight from Cloudflare R2 at the edge, so static traffic never touches an origin. A fresh site is seeded with a working starter (index.html, styles.css, app.js). Slugs are 2–40 chars: lowercase letters, numbers, and hyphens, and a few reserved names are blocked. Files are up to 8 MB each; binary assets (images, fonts, audio) are stored too.
Request bodies
slug*stringPOST /api/sites — public name; normalized to a valid slug.titlestringPOST /api/sites — display title (max 120 chars).path*stringPUT files — file path, e.g. index.html or css/app.css.contentstringPUT files — UTF-8 file contents (max 8 MB). Use for text files.contentBase64stringPUT files — base64 bytes for binary files (images, fonts, audio).contentTypestringPUT files — overrides the type inferred from the extension.Deploy a built site with the CLI (or raw curl)
# Easiest: push a whole build directory with the app CLI. It creates the
# site on first run, uploads every text file, and prunes anything removed.
app login --api-key pk_live_...
npm run build # e.g. Vite -> dist/
app sites deploy my-app dist --title "My app"
# Live at https://app.nz/sites/my-app/
# and https://my-app.app.nz/
# Or drive the REST API directly:
SITE=$(curl -sX POST https://app.nz/api/sites \
-H "Authorization: Bearer pk_live_..." \
-H "Content-Type: application/json" \
-d '{"slug":"my-landing","title":"My landing"}')
ID=$(echo "$SITE" | jq -r .site.id)
# Publish index.html — live at /sites/my-landing/ and my-landing.app.nz
curl -sX PUT https://app.nz/api/sites/$ID/files \
-H "Authorization: Bearer pk_live_..." \
-H "Content-Type: application/json" \
-d '{"path":"index.html","content":"<!doctype html><h1>Hi</h1>"}'