Skip to main content
Nango offers data validation at two levels: inside your Nango functions (when calling external APIs) and in your application code (when consuming function responses).

Validate API responses in Nango functions

Use Zod to validate data you receive from and send to external APIs. The CLI will also surface type errors during dry runs when using the --validation option.

Validate Nango function responses in your app

TypeScript types (compile-time)

Use z.infer to derive TypeScript types from your Zod schemas and export them from your function files:
Then import the types in your application code:

JSON Schema (runtime, language-agnostic)

When you run nango compile or nango deploy, Nango generates a nango.json file in the .nango folder. Each sync entry includes a json_schema property with the JSON Schema for its models:
You can extract a sync’s json_schema object and use it with any JSON Schema validator in your language of choice (e.g., ajv in TypeScript, jsonschema in Python, jsonschema in Rust, santhosh-tekuri/jsonschema in Go). For tools, convert the input and output Zod schemas directly. Zod v4 supports JSON Schema conversion natively with z.toJSONSchema():
  • Tools - validate tool inputs and outputs.
  • Sync functions - validate synced record models.
  • Unified APIs - normalize provider data behind stable schemas.
  • Testing - cover validation behavior in tests.