Base URL & auth
Production: https://api.77thjunction.app Local dev: http://127.0.0.1:3001
Authenticated routes require Authorization: Bearer <Firebase ID token>. Obtain a token via the web app, CLI login, or Firebase Auth SDK.
GET /health
→ { ok, service, version, firestore, billing, sitesUrlMode, subdomainUrls, ... }Auth
| Method | Path | Description |
|---|---|---|
| POST | /auth/sync | Sync profile after Firebase sign-in |
| GET | /auth/me | Current user (Bearer token) |
| POST | /auth/cli/start | Start CLI browser auth session |
| GET | /auth/cli/poll?sessionId= | Poll until CLI authorized |
| POST | /auth/forgot-password | Send password reset email |
Projects
| Method | Path | Description |
|---|---|---|
| GET | /projects | List user projects |
| POST | /projects | Create { name, localPath?, category? } |
| GET | /projects/:id | Get one project |
| PATCH | /projects/:id | Update name/status |
| DELETE | /projects/:id | Delete project + deployed files |
| GET | /projects/:id/settings | Env vars + domains view |
| PATCH | /projects/:id/settings | Update slug, env, custom domain |
| POST | /projects/:id/settings/verify-domain | Check DNS for custom domain |
Deploy
| Method | Path | Description |
|---|---|---|
| POST | /projects/:id/deploy | Multipart zip upload → build → live |
| POST | /projects/:id/redeploy | Redeploy last release |
| GET | /projects/:id/deploys | Deploy history |
| GET | /projects/:id/deploys/:deployId | Single deploy + logs |
| POST | /projects/:id/diagnose-deploy | Run diagnosis on failed deploy |
| POST | /projects/:id/assist-fix | AI-assisted fix (credits) |
| POST | /projects/:id/auto-fix | Auto-fix + redeploy (credits) |
Deploy accepts application/zip. Max size and rate limits apply in production. Poll deploy history for status and build logs.
Billing
| Method | Path | Description |
|---|---|---|
| GET | /billing/catalog | Plans, packs, costs (public) |
| GET | /billing/account | User balance + subscription (auth) |
| POST | /billing/subscribe | Start PayPal subscription checkout |
| POST | /billing/buy-pack | Start one-time credit pack checkout |
| POST | /billing/paypal/webhook | PayPal events (server only) |
Serving deployed sites
- Host-based: https://{slug}.77thjunction.app → static files from data/sites/{slug}
- Path-based: GET /sites/{slug}/… → same files (backup route)
- Custom domain: Host header routes to project when DNS active
- Reserved hosts: api, www — never treated as project slugs