Quickstart Guide: 5 Minutes to Production
Format, Validate, and Transform JSON Data
Prerequisites
Before you begin, make sure your environment meets these requirements. The entire setup takes under two minutes.
API Key
Grab your free API key from app.jsonflow.dev/settings/keys. Free-tier keys are rate-limited to 500 requests/hour — enough for CI/CD and staging workloads.
Runtime
JSONFlow works with any HTTP client. Python ≥3.9, Node.js ≥18, or cURL ≥7.68 are the most common. The CLI tool jsonflow (v2.4.1+) is optional but recommended for local validation.
Schema Definition
Have a JSON Schema (Draft 2020-12) ready. If you don't have one yet, use jsonflow schema:infer to auto-generate a schema from a sample payload in under 10 seconds.
Validate & Transform Your First Payload
Three languages, three endpoints, one result. Pick the snippet that matches your stack and run it.
Python
Install the SDK with pip install jsonflow==2.4.1, then validate and normalize a payload in four lines:
import jsonflow
client = jsonflow.Client(api_key="jf_live_8xK2mPqR9vL4wN7tY")
result = client.validate_and_transform(
payload={"user_id": 42891, "email": "a.chen@acme.io", "role": "admin"},
schema_id="sch_user_profile_v3",
transform="flatten.nested_objects"
)
print(result.valid) # True
print(result.normalized) # {"user_id":42891,"email":"a.chen@acme.io","role":"admin"}
Node.js
Add the package via npm install @jsonflow/node@2.4.1 and use the async/await API:
import { JSONFlow } from "@jsonflow/node";
const client = new JSONFlow({ apiKey: "jf_live_8xK2mPqR9vL4wN7tY" });
const result = await client.validateAndTransform({
payload: { user_id: 42891, email: "a.chen@acme.io", role: "admin" },
schemaId: "sch_user_profile_v3",
transform: "flatten.nested_objects"
});
console.log(result.valid); // true
console.log(result.normalized); // { user_id: 42891, email: "a.chen@acme.io", role: "admin" }
cURL
No SDK needed. Hit the REST endpoint directly — ideal for scripts, Makefile targets, and GitHub Actions:
curl -s -X POST https://api.jsonflow.dev/v2/validate \
-H "Authorization: Bearer jf_live_8xK2mPqR9vL4wN7tY" \
-H "Content-Type: application/json" \
-d '{
"payload": {"user_id": 42891, "email": "a.chen@acme.io", "role": "admin"},
"schema_id": "sch_user_profile_v3",
"transform": "flatten.nested_objects"
}'
All three calls return a JSON object with valid (boolean), normalized (the cleaned payload), and errors (array, empty if valid). Average latency is 12 ms on the free tier.
Integrate Into Your CI/CD Pipeline
Hook JSONFlow into GitHub Actions, GitLab CI, or Bitbucket Pipelines. The example below gates a deployment on schema validation.
GitHub Actions
Add this step to your .github/workflows/ci.yml. It runs on every push to main and fails the build if any JSON fixture in test/fixtures/ violates the schema:
name: Validate JSON Fixtures
on: [push]
jobs:
json-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install JSONFlow CLI
run: npm install -g @jsonflow/cli@2.4.1
- name: Validate all fixtures
run: |
for f in test/fixtures/*.json; do
jsonflow validate "$f" --schema sch_user_profile_v3 \
--strict --fail-on-error
done
env:
JSONFLOW_API_KEY: ${{ secrets.JSONFLOW_API_KEY }}
GitLab CI
Drop this stage into .gitlab-ci.yml to validate payloads before Docker image builds:
stages:
- validate
- build
jsonflow-validate:
stage: validate
image: node:20-slim
script:
- npm install -g @jsonflow/cli@2.4.1
- jsonflow validate test/fixtures/ --schema sch_user_profile_v3 --strict
variables:
JSONFLOW_API_KEY: $JSONFLOW_API_KEY
Webhook Notifications
If you want asynchronous validation (e.g., for large payloads over 2 MB), configure a webhook endpoint. JSONFlow posts a validation.completed event to your URL within 200 ms:
curl -s -X POST https://api.jsonflow.dev/v2/webhooks \
-H "Authorization: Bearer jf_live_8xK2mPqR9vL4wN7tY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://ci.acme.io/hooks/jsonflow",
"events": ["validation.completed", "validation.failed"],
"secret": "whsec_a1b2c3d4e5f6g7h8"
}'
The webhook payload includes schema_id, valid, error_count, and a signatures header for HMAC-SHA256 verification. See our signature verification guide for code samples in 6 languages.
Troubleshooting
Common issues and their fixes. If your problem isn't listed here, open a thread on Discord or email support@jsonflow.dev.
401 Unauthorized
Your API key is missing, expired, or has been rotated. Check that the Authorization: Bearer jf_live_… header is attached to every request. Free-tier keys expire after 90 days of inactivity — regenerate at app.jsonflow.dev/settings/keys.
429 Rate Limit Exceeded
You've hit 500 requests/hour on the free tier. The response header X-RateLimit-Reset tells you the exact Unix timestamp when your quota refreshes. For CI/CD pipelines that run more frequently, upgrade to the Pro plan (20 k req/hr, $29/mo) or batch payloads using the /v2/batch endpoint.
Schema Not Found
The schema_id in your request doesn't match any schema in your workspace. Schema IDs are case-sensitive and include the prefix sch_. Run jsonflow schema:list to see all available IDs. If you deployed a schema to the staging environment, make sure your API key is scoped to staging, not production.
Transform Timeout (>5 s)
Large payloads (>5 MB) with deep nesting can exceed the 5-second transform window. Reduce nesting depth, split the payload into chunks, or switch to async validation via webhooks. The flatten.nested_objects transform is the most expensive — consider compact.nulls or reorder.keys as lighter alternatives.
Webhook Signature Verification Fails
Ensure you're using the exact secret string returned when you created the webhook. The HMAC is computed over the raw request body using SHA-256. A common mistake is URL-encoding the body before signing — don't do that. Use the raw bytes from the HTTP request.
CLI Fails with "ENOENT: jsonflow"
The @jsonflow/cli package wasn't found on your PATH. If you installed it globally with npm install -g, verify with which jsonflow or jsonflow --version. In Docker containers, install it in the same layer as your build step to avoid PATH issues.
Still stuck? Browse the full FAQ or join our Discord — the core team responds within 2 hours during business hours (UTC-5).