# Setting headers for entire collection/folder

**URL:** <https://community.postman.com/t/setting-headers-for-entire-collection-folder/708>\
**Category:** Help Hub\
**Tags:** scripts, headers\
**Created:** [January 18, 2018, 10:02am UTC](https://community.postman.com/t/setting-headers-for-entire-collection-folder/708 "2018-01-18T10:02:47Z")\
**Posts on this page:** 5\
**Page:** 3

<div class="post-metadata">

**Author:** ![2ark0](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/2ark0/32/7956_2.png) [@2ark0](https://community.postman.com/u/2ark0)\
**Post date:** [April 5, 2021, 3:35pm UTC](https://community.postman.com/t/setting-headers-for-entire-collection-folder/708/41 "2021-04-05T15:35:13Z")

</div>

I added the next script in the section “Pre-request Script” for the entire collection folder:

```
pm.request.headers.add({
        key: 'client_id',
        value: 'random_client_id'
    }
);
pm.request.headers.add({
        key: 'client_secret',
        value: 'random_client_secret'
    }
);
```

---

<div class="post-metadata">

**Author:** ![moulichandra1997](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@moulichandra1997](https://community.postman.com/u/moulichandra1997)\
**Post date:** [June 16, 2021, 4:08pm UTC](https://community.postman.com/t/setting-headers-for-entire-collection-folder/708/42 "2021-06-16T16:08:07Z")

</div>

Hi@lutaiphong if you don’t mind please send me a sample script of how to send jwt to the header  
thank you

---

<div class="post-metadata">

**Author:** ![ismoil](https://avatars.discourse-cdn.com/v4/letter/i/3d9bf3/32.png) [@ismoil](https://community.postman.com/u/ismoil)\
**Post date:** [September 15, 2021, 5:56am UTC](https://community.postman.com/t/setting-headers-for-entire-collection-folder/708/43 "2021-09-15T05:56:13Z")

</div>

> The headers that are dynamically generated through the pre-request script will not be shown up as a part of the code that is generated.

Hi! Could you tell me please is it possible somehow add dynamicly generated Headers to collection’s documentation. As I see now it is not included there too.

---

<div class="post-metadata">

**Author:** ![wishuwant](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@wishuwant](https://community.postman.com/u/wishuwant)\
**Post date:** [February 13, 2022, 3:53am UTC](https://community.postman.com/t/setting-headers-for-entire-collection-folder/708/44 "2022-02-13T03:53:19Z")

</div>

![Screenshot 2022-02-13 at 11.51.52 AM](https://us1.discourse-cdn.com/getpostman/original/2X/a/a5c1cad09ce70ed4ca9c469ced7161f7ef25bc36.png)

set values across the collection from collection level, see image attached.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [August 23, 2023, 3:42pm UTC](https://community.postman.com/t/setting-headers-for-entire-collection-folder/708/45 "2023-08-23T15:42:22Z")

</div>

Closed on August 23, 2023, 3:42pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.postman.com/t/setting-headers-for-entire-collection-folder/708.md?page=2)
