Generate a document from a JsonFabrica template
jsonfabrica_generate_from_templateGenerate a document from a persisted template using a template ID, optional parameters, and a seed for reproducible output. Isolate sequence and variable side effects with namespaces for safe testing.
Instructions
Calls POST /v1/templates/{templateId}/generate. Generates a document from a persisted, saved template referenced by templateId — use this (not jsonfabrica_generate_adhoc) when the template is meant to be reused or shared across calls/tenants; use jsonfabrica_generate_adhoc instead when you are still iterating on raw template syntax and don't want to persist anything yet. This call is metered/billed like any generation and, unless namespaced, can advance real durable sequences and mutate durable variables referenced by the template body. Set sequenceNamespace/variableNamespace to isolate those side effects between environments (e.g. test vs. production).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Deterministic PRNG seed for this generation — the same seed reproduces byte-identical random values. Optional; if omitted the server picks a random seed and returns it in the response. | |
| params | No | Key/value map supplying values for getParam("key") placeholders in the template body. Optional; omitted keys leave the corresponding getParam() calls unresolved/empty. | |
| context | No | Arbitrary auxiliary key/value data made available to the template body alongside `params`. Optional; omitted keys are simply absent during generation. | |
| templateId | Yes | ID of the persisted template to generate a document from. Required. | |
| sequenceNamespace | No | Isolates createSeq()/getSeq() durable-sequence side effects under this namespace so repeated test/debug runs don't advance real tenant sequences. Optional; omitted means the default (unnamespaced) sequence scope is used. | |
| variableNamespace | No | Isolates durable-variable side effects under this namespace, analogous to `sequenceNamespace`. Optional; omitted means the default (unnamespaced) variable scope is used. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The generated document; shape is entirely determined by the template body. | |
| meta | Yes | Generation metadata. |