Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, 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 lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.
Collection runs fine in Postman but fails with errors in Newman
When I run a collection in Postman, it runs successfully and all the tests are passing. But when I run it in newman with the command: newman run [collection_link]
, all tests fail with one common error, which is: [401 Unauthorized...]
I found the problem while trying to run collections using newman.
I have already tried to look through the community forum for answers, but I haven’t yet come across a helpful answer. I also found that @sankarasai18 reported a similar issue here but I couldn’t find any responses to that.
Anyone?
Yes, there’s a Bearer token, which I stored inside a collection variable. What am failing to understand is why it’s restricting me in newman, and yet it runs successfully in Postman without any issues.
Include screenshots and code snippets on how you are currently generating and setting the token. Collection variable, Environment, etc. (Redacted as appropriate).
Confirm its working ok in Postman first.
This functionality does work in Newman, so it will be related to how the token is being generated and saved.
I Found a solution it works with me… i duplicated my collection and renamed it with different name, then i deleted the old collection from postman and it works