Data requests in Postman

View as Markdown

Postman can connect to a data source and run queries against it using a data request. Data requests use a dedicated client that lets you connect to a database or file, explore its structure, and query it directly in Postman.

About data requests

A data request connects to a data source and returns the results of a query. The data source can be a database, such as PostgreSQL or MySQL, or a local or remote file.

To connect to a source, select its type in the address bar and provide its details. For example, you might choose a local file or enter a connection string for a database. Once connected, you can browse the source’s structure, build and run queries, and view the results without leaving Postman.

Data requests are useful when you want to inspect or validate the data behind an API. For example, you can confirm that a request wrote the expected record, check the current state of your data, or explore a source’s structure.

The Postman data client

The data client loads automatically when you create a data request. It provides an interface designed for connecting to data sources and running queries, including:

  • An address bar where you select the source type and enter its connection details. You can edit each part of a connection, and Postman flags fields that are missing or incorrectly formatted.

  • A schema explorer on the Query tab that maps the source’s structure, such as its tables and columns, and refreshes as the connection changes. Use the Search schema field to find an item, then select it to add it to a query.

  • A query editor on the Query tab where you write SQL queries, with autocomplete, error highlighting, and formatting.

  • A results table on the View tab that displays your query results with sorting, searching, and pagination, along with the number of rows returned and how long the query took.

You can set credentials for a connection in the request’s Authorization tab. To learn how to create and run a data request, see Create a data request.

Data requests and datasets

Data requests and datasets both work with data sources such as databases, but they serve different purposes:

  • Use a data request to connect to a source and query it interactively, for example while you’re exploring a database or validating data during development.

  • Use a dataset to save a data source you want to reuse across your workflows, such as running data-driven collection tests, powering dynamic mock responses, or validating responses in scripts.

To learn more, see Use datasets in Postman.