> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# The Validate block

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.

Click **Docs** to learn about JSON schemas.

## Example

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