API Reference
Public entry point for the JsonFabrica JSON-generation platform. All `/v1/*` routes require an API key sent as `Authorization: Bearer <api-key>`. The gateway resolves the key to a tenant/role via svc-auth and forwards the request to the appropriate internal microservice, injecting trusted `X-Tenant-Id`/`X-Role` headers downstream (callers never set those themselves). `/health` is unauthenticated.
Base URL
Base URL
The spec's local/development base URL is http://localhost:4000. A hosted production API endpoint is not yet publicly available — check back once it's announced, or run the gateway yourself per the repo's self-hosting instructions and replace the base URL with your deployment's gateway URL.
Authentication
All /v1/* routes require an API key sent as an Authorization header, except the public Billing signup/webhook routes noted on their own page:
Authorization: Bearer <api-key>The gateway resolves the key to a tenant/role via the internal auth service and forwards the request to the appropriate microservice, injecting trusted X-Tenant-Id / X-Role headers downstream — callers never set those headers themselves. GET /health is unauthenticated.
Error envelope
Every error response — across every endpoint — uses the same shape:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "\"name\" is required",
"details": { "field": "name" }
}
}| Field | Type | Description |
|---|---|---|
| error.error | object | — |
Standard error codes
| Code | Meaning |
|---|---|
| UNAUTHORIZED | Missing, malformed, or invalid API key. |
| FORBIDDEN | Authenticated, but the caller lacks the required role (e.g. non-admin calling an Admin route). |
| NOT_FOUND | The requested resource (template, sequence, batch, ...) does not exist. |
| VALIDATION_ERROR | The request body is missing a required field or fails basic validation. |
Individual endpoints also use more specific codes for their own failure modes (e.g. NO_PLACEHOLDERS, UNKNOWN_FUNCTION, GENERATION_FAILED on Templates) — see each endpoint group's page.
Endpoint groups
Health
Liveness check (no auth)
1 endpoint
Auth
Caller identity introspection
1 endpoint
Templates
Template CRUD and document generation
7 endpoints
Sequences
Per-tenant monotonic sequence generators
6 endpoints
Variables
Per-tenant named variables usable inside templates. Deprecated: these routes are no longer proxied publicly in production (gateway no longer sets VARIABLES_SERVICE_URL) — use inline `varName` params or `setVar`/`getVar` in templates instead. svc-variables still runs internally to back `getVar`'s durable global fallback.
4 endpoints
Batches
Bulk/related document generation jobs
2 endpoints
Usage
Tenant usage/billing counters
1 endpoint
Billing
Public, unauthenticated billing endpoints: self-serve signup (proxied to svc-auth, which itself calls svc-billing internally to create the Stripe customer/subscription) and the Stripe webhook ingestion passthrough. svc-billing's other routes are internal-only (see `api-docs/openapi-internal-services.yaml`).
2 endpoints
Schemas appendix
Full field tables for every named schema referenced across the endpoint groups above (TemplateDto, SequenceDto, BatchSpec, ...).