# Multiple API Keys in Header

**URL:** <https://community.postman.com/t/multiple-api-keys-in-header/8924>\
**Category:** Help Hub\
**Created:** [November 11, 2019, 6:45pm UTC](https://community.postman.com/t/multiple-api-keys-in-header/8924 "2019-11-11T18:45:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johngalt2](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@johngalt2](https://community.postman.com/u/johngalt2)\
**Post date:** [November 11, 2019, 6:45pm UTC](https://community.postman.com/t/multiple-api-keys-in-header/8924/1 "2019-11-11T18:45:41Z")

</div>

A service that I am working with requires two values to be sent in the header.

> Making a successful request requires authentication using request headers. Valid values for the request header attributes named `x-api-key` and `x-security-key` are required to ensure secure access to your data. The content of your header might look something like the following:
> 
> ```auto
> {
> "x-api-key": "your-supplied-api-key",
> "x-security-key": "your-supplied-security-key"
> }
> 
> ```

How do I add two keys to the header for authorization? I can do it per request, but trying to do it correctly so that this will apply to all of my requests in the collection.

My end goal is to make a Custom Connector for Power Apps, MS Flow, etc.

---

<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:** [November 12, 2019, 9:16am UTC](https://community.postman.com/t/multiple-api-keys-in-header/8924/2 "2019-11-12T09:16:43Z")

</div>

Hey @johngalt2,

Welcome to the Community! 👋

You can add those at the `Collection` level in a Pre-request Script like this:

 ![52](https://us1.discourse-cdn.com/getpostman/original/3X/2/7/272fb4d4491b0170f4954dfd81b3e71085dc32f8.png)

```
pm.request.headers.add({key: "x-api-key", value: "your-supplied-api-key" })

pm.request.headers.add({key: "x-security-key", value: "your-supplied-security-key" }) 

```

Each request in your `Collection` will then use these 2 `Headers` in every call.

You _could_ even add these at the `Folder` level if you wanted to only do this for a subset of requests in the `Collection`.

---

<div class="post-metadata">

**Author:** ![joao1](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@joao1](https://community.postman.com/u/joao1)\
**Post date:** [July 20, 2021, 8:37pm UTC](https://community.postman.com/t/multiple-api-keys-in-header/8924/3 "2021-07-20T20:37:23Z")

</div>

Is there a way of doing this that will actually make the authentication headers show up on the “Code Snippet” side bar?
