# How to hide the sensitive information in postman

**URL:** <https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495>\
**Category:** Help Hub\
**Created:** [September 1, 2020, 10:15am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495 "2020-09-01T10:15:58Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![jency.stella19](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jency.stella19/32/16633_2.png) [@jency.stella19](https://community.postman.com/u/jency.stella19)\
**Post date:** [September 1, 2020, 10:15am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/1 "2020-09-01T10:15:58Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

I have a xml response with sensitive information. I want to hide this information from others to view in my test report. How do i achieve it?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 1, 2020, 10:30am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/2 "2020-09-01T10:30:42Z")

</div>

Hey @jency.stella19

Welcome to the community! 👋

How are you creating the test report?

---

<div class="post-metadata">

**Author:** ![jency.stella19](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jency.stella19/32/16633_2.png) [@jency.stella19](https://community.postman.com/u/jency.stella19)\
**Post date:** [September 1, 2020, 10:43am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/3 "2020-09-01T10:43:57Z")

</div>

Hi @danny-dainton using the below coomand  
newman run collection.json -r htmlextra

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 1, 2020, 10:49am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/4 "2020-09-01T10:49:16Z")

</div>

That’s a wonderful reporter… ❤

So you could use the `--reporter-htmlextra-hideResponseBody` flag on the latest version to hide the response of a particular request, in the final report.

For example:

```auto
newman run collection.json -r htmlextra --reporter-htmlextra-hideResponseBody "Auth Request"

```

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [September 1, 2020, 10:55am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/5 "2020-09-01T10:55:57Z")

</div>

@danny-dainton: Is it possible to hide/encrypt particular response tag alone, just because it has some private information?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 1, 2020, 11:10am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/6 "2020-09-01T11:10:13Z")

</div>

Not currently but it is something that I’ve taken a look at and I have an open FR for:

> <https://github.com/DannyDainton/newman-reporter-htmlextra/issues/224>
>
> Being able to specify a certain key, by a CLI flag that you give you the ability to mask it's value...

It’s easy to hide the full response because you can trigger that on a particular request but it’s super difficult when it’s an individual part of a response body.

You would need to parse all the data, which could be huge, to mask or hide a single part.

It’s even crazier because you also need to account for all the different types of responses their could be XML, JSON, plain text etc.

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [September 2, 2020, 11:05am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/7 "2020-09-02T11:05:31Z")

</div>

@danny-dainton Thank you 🙂 I tried to use the snippet you shared for the making.

//masking

```auto
let maskValue = ' *******',

    ld = require('lodash');

let masker = ld.cloneDeepWith(jsonObject, (value, key) => {

    if (ld.some(['ns2:CountryCode', 'ns2:Uci', 'ns2:LocalCustomerId'], item => ld.toLower(key) === ld.toLower(item))) {

        return maskValue;

    }

    if (ld.isObject(value)) {

        return;

    }

    return value;

})

console.log(masker); 

```

its working. same logic wen used for JSON response I can directly access the nodes by console.log(masker.fieldname);

but for the XML response any way to reach the masked node directly?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [September 2, 2020, 11:29am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/8 "2020-09-02T11:29:14Z")

</div>

That was a basic example of what I created to mask something on the `console.log()` for a JSON response - It doesn’t change the response in anyway, it’s just showing that masked value for a certain key in the response.

---

<div class="post-metadata">

**Author:** ![jency.stella19](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jency.stella19/32/16633_2.png) [@jency.stella19](https://community.postman.com/u/jency.stella19)\
**Post date:** [September 3, 2020, 2:41am UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/9 "2020-09-03T02:41:41Z")

</div>

Thanks @danny-dainton the post was quite useful

---

<div class="post-metadata">

**Author:** ![surendas](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@surendas](https://community.postman.com/u/surendas)\
**Post date:** [October 5, 2021, 1:37pm UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/10 "2021-10-05T13:37:58Z")

</div>

Hi Danny,

I am having PII (Personally Identifiable Information) in the form of base64 strings in both the request and response bodies of the Postman Collection. I have integrated Postman and TestRail. I am posting the test results into the TestRail Test Runs using the Newman command as shown here.

newman run postman-collection.json -d options.csv -r htmlextra --reporter-htmlextra-hideResponseBody --reporter-htmlextra-hideRequestBody “Auth Request” --reporters cli,testrail

However, the test results in the TestRail Test Run still contain the base64 strings with PII in it. These Test Results can be accessed by anybody in the company who has access to TestRail. Is it possible to suppress the whole of request and response bodies while the results are written into TestRail.

Regards  
Suren Das

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [October 5, 2021, 1:52pm UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/11 "2021-10-05T13:52:21Z")

</div>

There isn’t any functionality in the reporter to hide/suppress the Test Results.

In what form is this coming through? Do you use it in the Test Name?

There isn’t a bunch of data points in the Tests apart from the Test Name - You could see that PII in the output if the test failed and the assertion contains it.

Just want to get a better understanding of which part is failing for you.

---

<div class="post-metadata">

**Author:** ![lunar-module-meteo15](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lunar-module-meteo15](https://community.postman.com/u/lunar-module-meteo15)\
**Post date:** [March 30, 2023, 7:40pm UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/12 "2023-03-30T19:40:35Z")

</div>

Is there anyway to mask request query parameters? API keys, in specific cases, are passed as query parameters. So far, I can hide header info, but not query parameters. I have to parse response and replace strings.

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [April 27, 2023, 1:00pm UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/13 "2023-04-27T13:00:01Z")

</div>

You can try to store them as variables

---

<div class="post-metadata">

**Author:** ![material-engineer-11](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@material-engineer-11](https://community.postman.com/u/material-engineer-11)\
**Post date:** [January 16, 2024, 7:30pm UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/14 "2024-01-16T19:30:41Z")

</div>

Hi Danny, could you please share the method to hide the full response in a request? I have a request to get access token and would like to hide that response in the cli report

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [January 17, 2024, 12:15pm UTC](https://community.postman.com/t/how-to-hide-the-sensitive-information-in-postman/15495/15 "2024-01-17T12:15:02Z")

</div>

In terms of the htmlextra reporter, there a several flags available to do multiple things to the final report.

> **[GitHub - DannyDainton/newman-reporter-htmlextra: A HTML reporter for...](https://github.com/DannyDainton/newman-reporter-htmlextra#with-newman-cli)**
>
> A HTML reporter for Postman's Command Line Runner, Newman. Includes Non Aggregated Runs broken down by Iterations, Skipped Tests, Console Logs and the handlebars helpers module for better cust...

This would allow you to hide the response body for a specific request:

```auto
newman run collection.json -r htmlextra --reporter-htmlextra-hideResponseBody "Auth Request"

```
