Getting Started
This guide walks through the whole first-use flow: signing up, getting an API key, creating a template, and generating your first piece of synthetic JSON data.
Base URL
The production API is live at https://api.jsonfabrica.com — use this as the base URL for all requests below.
1. Sign up and get your API key
Signing up starts with a single API call, then finishes on Stripe's hosted checkout page. Your API key is issued after payment is confirmed — you'll get it by email and on the confirmation page, not in the signup response itself. You'll need:
- An email address.
- A plan tier:
starter,growth, orbusiness(largerenterpriseplans are arranged directly with sales, not via self-serve signup). There is no free tier. Onlystarterstarts with a 30-day free trial, then converts to the plan's monthly rate;growthandbusinessare billed immediately at signup, with no trial.
After this call succeeds, you'll be redirected (via the returned checkoutUrl) to Stripe's hosted checkout page to enter payment details.
curl -s -X POST https://api.jsonfabrica.com/v1/signup \
-H 'content-type: application/json' \
-d '{"email":"[email protected]","tier":"starter"}'A successful response looks like this:
{
"tenantId": "tenant_...",
"tier": "starter",
"status": "pending_payment",
"checkoutUrl": "https://checkout.stripe.com/..."
}Redirect the user's browser to checkoutUrl to complete payment on Stripe's hosted page.
Once payment completes, your API key is emailed to you and available once via GET /v1/signup/session/:sessionId (pass the session_id Stripe appends to your checkout return URL). Save it immediately — it's only ever shown once and there is no way to retrieve it again later if you lose both the email and that one-time view.
curl -s https://api.jsonfabrica.com/v1/signup/session/<sessionId>While payment is still processing:
{ "status": "pending" }Once fulfilled:
{
"status": "fulfilled",
"tenantId": "tenant_...",
"tier": "starter",
"apiKey": "sk_..."
}If your email is rejected before you ever reach Checkout (e.g. disposable email domains), you'll get a response like {"tenantId":"tenant_...","tier":"starter","status":"blocked","blockReason":"..."} with no checkoutUrl.
2. Authenticate your requests
Every API call after signup must include your API key in the Authorization header:
Authorization: Bearer sk_...You can sanity-check that your key works with:
curl -s https://api.jsonfabrica.com/v1/whoami \
-H 'Authorization: Bearer sk_...'which returns:
{ "tenantId": "tenant_...", "role": "user" }3. Understand template syntax
Templates are plain JSON documents with placeholders inside them. Placeholders call a data-generation function using angle brackets:
<functionName(arg1, arg2, ...)>For example, a minimal template that generates a random full name and an auto-incrementing user id looks like this:
{ "name": "<getRandomFullName()>", "id": "<createSeq('userId')>" }Templates also support loops and conditionals, for example:
<for(i, 1, 3)><if(getVar(i) == 1)>first<else>rest<endIf><end_for>See the Function Reference for the full list of available functions.
4. Create your first template
Create a template by sending its name and body to the API:
curl -s -X POST https://api.jsonfabrica.com/v1/templates \
-H 'Authorization: Bearer sk_...' \
-H 'content-type: application/json' \
-d '{
"name": "user-profile",
"body": "{ \"id\": \"<createSeq(\"users\")>\" }"
}'A template must contain at least one placeholder — a template made up of plain literal text only will be rejected. Every function you reference in a template must be one of the built-in supported functions.
5. Generate data
Once your template is saved, generate data from it at any time:
curl -s -X POST https://api.jsonfabrica.com/v1/templates/<templateId>/generate \
-H 'Authorization: Bearer sk_...' \
-H 'content-type: application/json' \
-d '{}'A successful response looks like this:
{
"data": { "id": 1 },
"meta": {
"seed": 12345,
"templateId": "tpl_...",
"generatedAt": "2026-08-08T00:00:00.000Z"
}
}datais your generated JSON document.meta.seedis the random seed used for this generation run — pass the same seed back in on your next call to reproduce identical output.meta.generatedAtis the timestamp of generation.
If you'd rather generate data without saving a template first, you can send the template body directly to a one-off endpoint:
curl -s -X POST https://api.jsonfabrica.com/v1/templates/generate \
-H 'Authorization: Bearer sk_...' \
-H 'content-type: application/json' \
-d '{"body":"{ \"n\": \"<getRandomNumber(1,10)>\" }"}'This still counts toward your usage, but nothing is saved to your account.
What's next
- Browse the full Function Reference to see every available function, its parameters, and example usage.
- Read about billing and plan tiers to understand how usage is measured and billed.