JsonFabrica

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. **Request-path validation.** The gateway validates and normalizes every proxied `/v1/*` request path before forwarding it. Requests with malformed or out-of-scope paths are rejected with `400 VALIDATION_ERROR`. Dots *inside* a path segment (e.g. `person.firstName`) are fully supported.

Base URL

Base URL

The production API is live at https://api.jsonfabrica.com — use this as the base URL for all requests. (The OpenAPI spec below also lists http://localhost:4000 as a secondary server, for anyone running their own gateway per the repo's self-hosting instructions — if that's you, replace the base URL with your deployment's gateway URL instead.)

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" }
  }
}
FieldTypeDescription
error.errorobject—

Standard error codes

CodeMeaning
UNAUTHORIZEDMissing, malformed, or invalid API key.
FORBIDDENAuthenticated, but the caller lacks the required role (e.g. non-admin calling an Admin route).
NOT_FOUNDThe requested resource (template, sequence, batch, ...) does not exist.
VALIDATION_ERRORThe 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