Skip to content
Back

API Reference

LiveFolio REST API — use for CI/CD pipelines, custom integrations, and debugging. For AI agent workflows, use MCP instead.

When to Use the REST API

Use caseRecommended approach
AI agent publishing foliosMCP — higher-level, agent-native
CI/CD pipelineREST API — simple HTTP calls, no handshake
Custom integration (non-AI)REST API — direct JSON requests
Debugging MCP issuesREST API — curl examples for testing
Local file syncCLIlivefolio-init sync

Base URL

https://livefolio.cloud

For OSS self-hosted instances, use your own domain or tunnel URL.

Authentication

All authenticated endpoints require an API key. Generate one from Settings → API Keys in the dashboard.

Authorization: Bearer lf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

See the Authentication page for details on API keys, OAuth, and rate limits.

Endpoint Index

Core Resources

SectionEndpointsAuth
FilesGET/POST /api/files, GET/PUT/DELETE /api/files/{id}Required
UploadingPOST /api/files/{id}/upload, POST /api/files/{id}/upload-batchRequired
CommentsGET/POST/PUT/DELETE /api/files/{id}/commentsPublic (write)
ReactionsGET/POST /api/files/{id}/reactionsPublic
AnalyticsPOST /api/files/{id}/analyticsNone
SharingGET/POST /api/files/{id}/public, GET/POST /api/tunnelVaries
AI GenerationPOST /api/files/{id}/ai, POST /api/files/{id}/ai-stream, POST /api/files/ai-createRequired

Other Endpoints

EndpointDescriptionAuth
GET /api/files/{id}/briefCurated design brief from feedback pinsRequired
POST /api/files/{id}/syncCLI watcher file syncBearer token
GET /api/keysList API keysRequired
POST /api/keysGenerate new API keyRequired (Owner/Admin)
DELETE /api/keys/{id}Revoke API keyRequired (Owner/Admin)
GET /api/openapiOpenAPI 3.0 specPublic
GET /api/design-systemsList available design systemsRequired

Quick Examples

Create a Folio

curl -X POST https://livefolio.cloud/api/files \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer lf_live_xxxxxxxxxxxx" \
  -d '{
    "title": "My Folio",
    "initialHtml": "<!DOCTYPE html><html>...</html>",
    "projectMode": "document"
  }'

Add a Comment

curl -X POST https://livefolio.cloud/api/files/my-folio/comments \
  -H "Content-Type: application/json" \
  -d '{
    "text": "The header needs more contrast",
    "versionId": "v1",
    "filename": "index.html",
    "x": 50,
    "y": 5
  }'

Comments are public — no auth required.

Error Responses

All errors follow a consistent format:

{
  "error": "Human-readable description"
}

Some errors include additional fields:

{
  "error": "STORAGE_EXCEEDED",
  "message": "You have exceeded your storage limit. Upgrade your plan to continue creating folios."
}
StatusMeaning
400Bad request — invalid parameters
401Unauthorized — missing or invalid API key
402Payment required — quota or storage exceeded
403Forbidden — insufficient permissions or endpoint not available
404Not found — invalid folio ID
413Content too large — request body exceeds limit
429Rate limit exceeded
500Internal server error

Rate Limits

Authenticated endpoints include rate limit headers in responses:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1718400000

Limits vary by plan. Check your workspace plan for specific quotas.

OpenAPI Spec

A machine-readable OpenAPI 3.0 spec is available at GET /api/openapi. Use it to generate client SDKs or import into tools like Postman.