Global url for Environment Json

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.

Hi, I am trying to run my collections via command line using newman. I got the public url for my collection. But I don’t know how to get the global url for the environment json. Can someone help me with that.

Thanks,
Bhuvana

@venkataramanb:

Hi Bhuvana,

Welcome to community :clap:

Based on your question, I understand that you have saved your URL as global variable, and need to pass that file in your newman command?

If so, please download the global file and pass that as input to your command (-g globalenvtfile.json). Else you are looking something for global variable, please refer the below post:

Still having issues? Please share us more details.

Just one thing, when you are about to post your queries, kindly drop in under two categories:

Hey @venkataramanb, welcome!

You can do this by using the postman API. Documentation for getting an API Key

After you get your API key, you can pass the following command to newman:

newman run https://api.getpostman.com/collections/<collectionId>?apikey=<apiKey> --environment https://api.getpostman.com/environments/<environmentId>?apikey=<apiKey>

Just replace the angle brackets with the values for your collection, environment, and api key.