API Overview
The Frontend REST API lets you manage projects programmatically — read and write files, run git operations, manage environment variables, query the project database, upload media, configure domains, and deploy — the same operations available in the editor, over HTTP.
Base URL
Section titled “Base URL”https://www.frontend.co/api/v1All endpoints are versioned under /api/v1 and return JSON.
Authentication
Section titled “Authentication”Every request is authenticated with a team API key sent as a Bearer token:
Authorization: Bearer <your-api-key>Create a key from Team Settings → API Keys (/teams/{handle}/api-keys). Keys are team-scoped: one key grants access to every project owned by that team. There is no cookie or session auth — the API is Bearer-only.
Treat API keys like passwords. Keep them server-side and never expose them in client-side code.
curl https://www.frontend.co/api/v1/projects \ -H "Authorization: Bearer $FRONTEND_API_KEY"Project scoping
Section titled “Project scoping”Most endpoints act on a specific project and are nested under /projects/{id}. A request only succeeds if the project belongs to the key’s team; otherwise it returns 404. Use the Projects endpoint to list or search your team’s projects and obtain their ids.
Responses & errors
Section titled “Responses & errors”Successful responses return the data directly as JSON, e.g. { "projects": [...] }. Failed requests return an error envelope with an HTTP status code:
{ "error": { "code": "not_found", "message": "Project not found" } }Common status codes: 400 invalid request, 401 missing/invalid API key, 404 not found (or not owned by your team), 409 conflict (e.g. a deploy already running), 500 server error.
The official JavaScript/TypeScript client wraps every endpoint:
yarn add @frontend-ai/sdkimport { createClient } from '@frontend-ai/sdk'
const client = createClient({ apiKey: process.env.FRONTEND_API_KEY })
const projects = await client.projects.list()const files = await client.files.list(projectId)Failed requests throw FrontendAPIError with .status and .code.
Resources
Section titled “Resources”- Projects — list, search, create, delete, publish
- Files — read, write, move, delete project source files
- Media — upload and manage media library assets
- Git — commits, branches, log, merge, restore
- Environment Variables — list, set, delete env vars
- Database — run SQL against the Frontend Cloud database
- Domains — add and verify custom domains
- Deploys — build and ship to production
- AI — generate images
- MCP Server — connect an AI agent to your projects