Skip to content

API Overview ​

All API endpoints are prefixed with /api. The server listens on port 3000 by default.

Base URL ​

http://localhost:3000/api

Content Types ​

DirectionContent-Type
Request (JSON)application/json
Request (Binary)application/octet-stream
Response (PDF)application/pdf
Response (JSON)application/json

Authentication ​

If enabled, all requests require HTTP Basic Auth. See the Authentication guide for details.

Unprotected endpoints: POST /api/login, GET /api/health

Rate Limiting ​

Limit TypeWindowMax Requests
General60sREPORTS_RATE_LIMIT (default 100)
Compilation60s1/4 of general limit

Rate limit headers are included in responses:

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset

Standard Error Response ​

json
{
  "status": "error",
  "error": "Description of what went wrong"
}

HTTP Status Codes ​

CodeMeaning
200Success
201Created
204Deleted (no content)
400Bad request / validation error
401Unauthorized (auth required)
404Not found
413Payload too large
429Rate limited
500Internal server error

Endpoints Summary ​

MethodPathAuthDescription
POST/api/loginNoAuthenticate with user/password
POST/api/change-passwordYesChange current password
POST/api/previewYesCompile inline Typst to PDF
POST/api/reportYesCompile saved template to PDF
GET/api/templatesYesList all templates
GET/api/templates/:nameYesGet template content + metadata
PUT/POST/api/templates/:nameYesCreate or update template
DELETE/api/templates/:nameYesDelete a template
GET/api/foldersYesList template folders
POST/api/foldersYesCreate a template folder
DELETE/api/folders/:nameYesDelete a template folder
GET/api/assetsYesList all assets (?prefix=)
GET/api/assets/:nameYesGet asset file
POST/PUT/api/assets/:nameYesUpload asset
DELETE/api/assets/:nameYesDelete asset
POST/api/assets/foldersYesCreate asset folder
DELETE/api/assets/folders/:nameYesDelete asset folder
GET/api/packagesYesList installed packages
POST/api/packagesYesInstall a package
DELETE/api/packages/:name/:versionYesDelete a package
POST/api/packages/checkYesCheck content for missing packages
GET/api/healthNoHealth check
GET/api/metricsYesServer metrics

Design and Dev by David Lam