# How to save example with auth headers?

**URL:** <https://community.postman.com/t/how-to-save-example-with-auth-headers/61620>\
**Category:** Help Hub\
**Tags:** authentication\
**Created:** [May 29, 2024, 3:59pm UTC](https://community.postman.com/t/how-to-save-example-with-auth-headers/61620 "2024-05-29T15:59:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![c80609a](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/c80609a/32/28789_2.png) [@c80609a](https://community.postman.com/u/c80609a)\
**Post date:** [May 29, 2024, 3:59pm UTC](https://community.postman.com/t/how-to-save-example-with-auth-headers/61620/1 "2024-05-29T15:59:24Z")

</div>

My request uses bearer token for authorization.

Especially for the postman documentation, I created a perpetual token and saved it in variables.

I run the request, get the response, click the “save as example” button, enter a name for the example and click save button.

Then I click “view documentation” link, click “generate documentation” and in a separate tab I see the result - the generated documentation along with example queries.

**The problem**

The problem is that the code samples in all languages ​​are missing authorization tokens in all examples.

**Expected result**

CURL for example:

```auto
curl --location --request GET 'https://foo.bar/api/v1/users' \
-H "Authorization: Bearer xxx" \
--data '{
    "per_page": 1,
    "ccode": "US"
}'

```

**Actual result** :

```auto
curl --location --request GET 'https://foo.bar/api/v1/users' \
--data '{
    "per_page": 1,
    "ccode": "US"
}'

```

---

<div class="post-metadata">

**Author:** ![gbadebo-bello](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gbadebo-bello/32/12175_2.png) [@gbadebo-bello](https://community.postman.com/u/gbadebo-bello)\
**Post date:** [May 30, 2024, 9:38am UTC](https://community.postman.com/t/how-to-save-example-with-auth-headers/61620/2 "2024-05-30T09:38:30Z")

</div>

Hi @c80609a. Welcome to the Postman Community.

I have raised this internally with the team to get some clarity on what could be going wrong here.

---

<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:** [June 29, 2024, 9:38am UTC](https://community.postman.com/t/how-to-save-example-with-auth-headers/61620/3 "2024-06-29T09:38:37Z")

</div>

Closed on June 29, 2024, 9:38am UTC

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