Postman CLI authentication and configuration
The Postman CLI (postman) resolves credentials, regions, and local file layout the same way across most commands. This page explains those shared rules.
Credential precedence
Commands that read or write Postman cloud resources resolve a Postman API key in this order:
- An explicit flag on the command itself:
--api-key <key>on most commands, or--postman-api-key <key>onpostman collection runandpostman performance run. - The
POSTMAN_API_KEYenvironment variable. - Your signed-in
postman loginsession.
--postman-api-key on collection run and performance run is only supported in the US region. For EU region authentication, sign in with postman login --region eu instead.
Login and guest sessions
Any local-only operation — working with files already on disk, such as linting a local collection or specification — works without being signed in.
Commands that interact with the Postman cloud require credentials accepted by that command. Most accept an API key or signed-in session; some collection and monitor commands also accept a guest session:
- Signed in: run
postman loginto authenticate with your Postman account from the browser, or pass--with-api-keyto sign in non-interactively. - Guest: outside CI and
--jsonmode, runningpostman initwithout first signing in creates a temporary guest workspace unless you pass--no-cloud. Use this session only with commands that document guest support.
A guest session can’t own a cloud workspace. Commands like postman workspace create require an account — if you started as a guest, run postman signup first to claim your guest workspace and turn it into a full account.
EU region
If your organization uses Postman EU Data Residency, sign in with:
postman init doesn’t have its own --region option — it uses whatever region your existing login session or API key already resolves to.
--postman-api-key on collection run and performance run doesn’t support the EU region. Use postman login --region eu for those commands instead.
Local project layout
The Postman CLI reads and writes two kinds of files under a hidden .postman/ directory, plus a visible postman/ directory for your actual Postman elements:
These two .postman/ files are easy to conflate because they sit in the same directory and both configure CLI behavior, but they serve unrelated purposes: resources.yaml is about which cloud workspace your files sync to, and config.json is about how postman sdk generate builds an SDK.
Local and cloud mode
Most Postman CLI commands that take a collection, environment, specification, mock, or similar element accept either:
- A local path — reads or writes the element on disk. No authentication is required.
- A cloud ID — reads or writes the element in the Postman cloud. This requires a signed-in session, a guest session, or an API key (see Credential precedence above).
For example, postman collection run ./postman/collections/my-collection runs a local collection, while postman collection run 12345-abcde fetches and runs a cloud collection by ID. This same rule applies throughout the CLI reference — check each command’s own page for which argument forms it accepts.
Next steps
- Browse commands and global options.
- See Use the Postman CLI with AI agents and CI/CD for non-interactive setups.