# Collection Bearer Authentication Works in Postman but not Newman webhook

**URL:** <https://community.postman.com/t/collection-bearer-authentication-works-in-postman-but-not-newman-webhook/34594>\
**Category:** Help Hub\
**Tags:** newman-project, authentication, json\
**Created:** [April 19, 2022, 9:54pm UTC](https://community.postman.com/t/collection-bearer-authentication-works-in-postman-but-not-newman-webhook/34594 "2022-04-19T21:54:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmjonesjr](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rmjonesjr](https://community.postman.com/u/rmjonesjr)\
**Post date:** [April 19, 2022, 9:54pm UTC](https://community.postman.com/t/collection-bearer-authentication-works-in-postman-but-not-newman-webhook/34594/1 "2022-04-19T21:54:15Z")

</div>

> **Archived topic — this may be out of date.**  
> Newman has been replaced by the **[Postman CLI](https://learning.postman.com/docs/postman-cli/postman-cli-overview/)**, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

_My question_: When I use Postman to run individual requests in a collection, they successfully authenticate using the same Bearer token stored in a global variable.

When I use my SaaS app to trigger the collection from a Newman webhook, I get a 401 response on the individual calls.

Any suggestions of where I might start looking?

_Details_: I created a Newman webhook URL ([api.getpostman.com/webhooks?workspace](http://api.getpostman.com/webhooks?workspace)) for my SaaS app to trigger a collection.

- The first call parses the payload and assigns variables for later use.  
\*The second call in the collection generates a Bearer token from the app and stores it as a global variable.  
\*The third call uses the globally stored Bearer token to POST an update to the record from the original payload.  
\*The fourth call uses the globally stored Bearer token to GET additional record information about the record from the original payload.

_How I found the problem_: Running the collection from Postman works as expected but running the collection by calling the Newman webhook URL returns a 401 response on the third and fourth calls.

_I’ve already tried_: I am logging the Bearer token and it displays in Postman console. In the Monitor console, the value shows blank.

Is there some nuance with Newman webhook and collections that I missed?

---

<div class="post-metadata">

**Author:** ![w4dd325](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/w4dd325/32/12436_2.png) [@w4dd325](https://community.postman.com/u/w4dd325)\
**Post date:** [April 20, 2022, 3:23pm UTC](https://community.postman.com/t/collection-bearer-authentication-works-in-postman-but-not-newman-webhook/34594/2 "2022-04-20T15:23:54Z")

</div>

Hi @rmjonesjr

Are you specifying the global variable file when running Newman (using the -g option)?

Run options can be found here;

> **[GitHub - postmanlabs/newman: Newman is a command-line collection runner for...](https://github.com/postmanlabs/newman/#newman-run-collection-file-source-options)**
>
> Newman is a command-line collection runner for Postman - GitHub - postmanlabs/newman: Newman is a command-line collection runner for Postman

---

<div class="post-metadata">

**Author:** ![rmjonesjr](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rmjonesjr](https://community.postman.com/u/rmjonesjr)\
**Post date:** [April 20, 2022, 4:16pm UTC](https://community.postman.com/t/collection-bearer-authentication-works-in-postman-but-not-newman-webhook/34594/3 "2022-04-20T16:16:45Z")

</div>

Sorry for the confusion…I am not running the collection from Newman CL.

I created a webhook URL that calls the postman API via [newman-api.getposman.com/run](http://newman-api.getposman.com/run). My app triggers this webhook and passes a payload back to the collection.

The first request in the collection, POST [https://postman-echo.com/post](https://postman-echo.com/post), parses the payload correctly.

Is it possible to trigger the webhook URL from Newman CL to better represent the call from the app?
