Add request blocks to your notebook

You can add API requests and reference their responses elsewhere in your notebook to create an interactive experience. For example, you can add an input block for your API consumer's email address and use a request block to send them a welcome message.

Add a request block

To add a request block, do the following:

  1. Open your notebook or create a new one.
  2. Place your cursor where you want to add the request block. Then, type a forward slash ("/"). Postman displays a block menu.
  3. Choose Request icon Request Block.
  4. Search for your public request or paste its URL or UUID. Then, select it. Postman displays the request, any variables you or your API consumers may need to define, a way for you or your API consumer to define the request body, and a button to send the request.
  5. Name your request block.
  6. If necessary, define the variables. These may include query and path parameter values, or other values defined in the request.
  7. (Optional) Define an override. This overrides the request's body.
  8. Click Run icon Send.

Postman sends the request and returns the response.

Reference your request block

You can reference your request block by name. For example, if you name your request block "getUser", you can reference its response in another request block with the syntax {{getUser}}. Or you can reference it in a code runner block with the syntax $getUser.

Furthermore, you can use dot notation to reference data within a response. For example, in another request block, you can reference the user's first email with the syntax {{getUser.emails.0}}. Or in a code runner block, you can reference the same value with the syntax $getUser.emails[0].

To reference your request block, do the following:

  1. Open your notebook or create a new one.

  2. Get your request block's name.

  3. Reference your request block:

    • To reference your request block in an input or another request block, use the syntax {{requestBlockName}} or {{requestBlockName.path.to.data}}.
    • To reference your request block in a code runner block, use the syntax $requestBlockName or $requestBlockName.path.to.data.

Send requests in sequence

If you can use the data from one response in the request of another, you can send those requests in sequence. For example, you can get a user's email from a response and use it to send a different request.

To send requests in sequence, do the following:

  1. Open your notebook or create a new one.
  2. In the first request block, click Run icon Send.
  3. In the second request block, reference the first request block with the syntax {{requestBlockName.path.to.data}}. Then, click Run icon Send.

Postman uses the first request's response to send the second request. You can add more requests to the sequence.

Last modified: 2025/07/28