***

title: The Validate block
approved: 2025-07-23T00:00:00.000Z
topictype: reference
slug: docs/postman-flows/reference/blocks/validate
max-toc-depth: 2
ux: v12
-------

The **Validate** block is a logical gate that checks incoming JSON data against a schema and routes the data based on the result. If the JSON data conforms to the schema, it's routed through the **Pass** output port. If the JSON doesn't conform to the schema, it's routed through the **Fail** output port. You can create your own schema in the **Validate** block or generate one automatically based on existing JSON data.

## Input

**Data** - Connect this input port to any block that sends JSON data. The **Validate** block checks the data it receives against a JSON schema.

## Outputs

**Pass** - Sends the received JSON data if it conforms to the schema.

**Fail** - Sends the received JSON data if it doesn't conform to the schema.

## Setup

To create a JSON schema, click **Generate from example** and paste valid JSON data into the text box, then click **Generate schema**. Alternatively, click **Define custom schema** to manually enter a JSON schema.

Connect the **Data** input port to the output port of a block that sends JSON data. The **Validate** block checks the incoming data against its schema.

<Info class="iconless-callout">
  Click **Docs** to learn about JSON schemas.
</Info>

## Example

To see the **Validate** block in an example flow, check out [Flow Snippets: Validate](https://www.postman.com/postman/flows-snippets/flow/684072fe6540d800405f47c0).
