@x12i/reportix-composer-api
v0.6.0
Published
HTTP API server for Reportix Composer — render Markdown and manage templates over REST.
Maintainers
Readme
@x12i/reportix-composer-api
HTTP API for Reportix Composer. Wraps @x12i/reportix-composer-core with REST endpoints for rendering,
template management, and image assets.
Install & run
npm install -g @x12i/reportix-composer-api
npx playwright install chromium # once, for PDF export
reportix-composer-apiOr without a global install:
npx @x12i/reportix-composer-apiListens on 0.0.0.0:${port} where port comes from @x12i/ports-manager zone
reportix-composer (default 6460).
Environment variables
| Variable | Purpose |
| --- | --- |
| REPORTIX_COMPOSER_API_PORT / PORT | Override API listen port (must be even, in 6460–6479) |
| REPORTIX_COMPOSER_API_KEY | If set, require Authorization: Bearer <key> on all routes except /health |
| REPORTIX_COMPOSER_TEMPLATES_DIR | Override user templates directory |
| REPORTIX_COMPOSER_ASSETS_DIR | Override image asset store directory |
| ANTHROPIC_API_KEY | Optional default for create-from-image flows |
Endpoints
| Method | Path | Description |
| --- | --- | --- |
| GET | /health | Liveness check |
| GET | /templates | List templates |
| GET | /templates/:id | Get template |
| POST | /templates/from-html | Create template from HTML + CSS JSON body |
| POST | /templates/from-image | Create template from image (multipart) |
| PATCH | /templates/:id | Update user template (name, description, layoutHtml, stylesCss, page, theme, visual, renderFirstHeading) |
| POST | /templates/:id/duplicate | Fork built-in or user template into the user store |
| POST | /templates/:id/preview | Preview unsaved patch as HTML or PDF |
| DELETE | /templates/:id | Delete user template |
| GET | /assets | List image assets |
| POST | /assets | Multipart upload (file; optional token, filename) |
| GET | /assets/:token | Asset metadata |
| GET | /assets/:token/raw | Raw image bytes |
| DELETE | /assets/:token | Delete asset |
| POST | /compose | Compose Markdown → HTML/PDF/DOCX/PPTX (set output.format) |
Render body
{
"markdown": "# Title\n\nBody",
"templateId": "clean-report",
"options": {
"frontmatterOverrides": { "title": "Override" },
"pdf": { "format": "A4" }
}
}Client
Use @x12i/reportix-composer-api-client for a typed fetch wrapper (compose, templates, duplicate, preview). Asset routes are HTTP-only for now.
