Postman CLI authentication commands
You can use the Postman CLI to sign in and out of Postman with the login and logout commands, and to create an account with signup. Use whoami to check which identity the Postman CLI is using.
The Postman CLI works signed in to an account, in a temporary session, or signed out, and each command accepts its own set of credentials. To learn more, see Login and temporary sessions.
While you’re working in a temporary session, most CLI commands end with a reminder: work in the session, its context, and resources created in the workspace are lost when the session expires. Sign up or sign in to keep them. This reminder is skipped for the whoami, status, login, signup, logout, and init commands, for machine-readable output (--json or piped), under --silent, and when you set POSTMAN_CLI_SKIP_GUEST_NOTICE=1.
If you’re using the Postman CLI from a network with outbound restrictions, you must allowlist specific domains to connect to Postman.
postman login
The login command prompts you to securely sign in and authenticate from the browser.
If you purchased a Postman EU Data Residency plan, the login command also requires the --region option. Use this option with the argument eu to specify that your instance of Postman is hosted in the EU region.
You can also use the --with-api-key option to authenticate using your Postman API key. This method is recommended when using the Postman CLI from your CI/CD pipeline, but you can also use this method from your local machine.
If you’re already signed in and there’s no terminal to ask in, such as in an AI agent, CI, or piped output, the command replaces the stored login without asking, as --with-api-key does.
The browser sign-in needs a browser on the same machine. Without a terminal, and where no browser could reach the CLI (CI, an SSH session, or a container), the command exits right away instead of waiting. Use --with-api-key or the POSTMAN_API_KEY environment variable there.
When the Postman CLI runs inside an AI coding agent, it gives that agent its own session, minted from your browser sign-in or temporary session and stored locally beside it. Requests from the agent use that session instead of yours, so its activity is attributed to the agent, not to you. The CLI detects the agent from its environment. To name the agent explicitly, set POSTMAN_AGENT=<name>, using letters, digits, -, and _, up to 64 characters. A Postman API key that you pass with POSTMAN_API_KEY or --api-key, or that you signed in with, is never replaced by an agent session. The agent’s name is sent alongside it instead.
You remain signed in until you use the logout command or your Postman credentials or API key expire.
Keep your work when you sign in
If you worked in a temporary session on your machine first, for example by running postman init, the login command asks, once you’ve signed in, whether to move that work into the team you signed in to:
- Move it moves the session’s workspace, and everything in it, into that team. IDs stay the same, and the session’s user becomes your agent there (
<your name>'s agent). - Not now (the default) leaves the work where it is. You’re asked again the next time you sign in.
- Discard it forgets the temporary session. The work isn’t moved.
Without a terminal to ask in, such as in an AI agent, CI, or piped output, nothing moves unless you pass --claim. Pass --no-claim to sign in without being asked and without moving anything.
The move runs on Postman’s side. The command waits up to two minutes and prints how it went. If the move is still running after that, the command says it will finish in the background.
If the work can’t be moved, you’re still signed in, and the command says why. For example, Postman won’t move work into an Enterprise team. Sign in to a non-Enterprise team to keep the work.
This applies to logins in the US region, whether you sign in from the browser or with --with-api-key. In the EU region, the command signs you in as usual, without asking about or moving your temporary session’s work. If you don’t have a Postman account yet, use postman signup to create one and keep the temporary workspace under it instead.
Usage
Options
Authenticate the user with the given API key.
Specify that your instance of Postman is hosted in the EU region. Accepts eu.
Moves your temporary session’s work into the team you sign in to, without asking. Needed to move it when there’s no terminal to ask in, such as in an agent, CI, or a pipe.
Doesn’t move your temporary session’s work into the team you sign in to, and doesn’t ask.
Shows detailed error information for the authentication attempt.
Examples
postman signup
Signs up for a new Postman account. If you’re working in a temporary session, it also claims your temporary workspace under that account.
If you’re working in a temporary session and have files under postman/ other than installed skills, the postman signup command first pushes them to your temporary workspace. This way, the workspace you keep isn’t empty. The push uses postman workspace push. If the push fails, the command warns that your local work isn’t pushed yet and continues. Pass --no-push to skip the push. In that case, the command warns you if your temporary session has local work that was never pushed.
Sign-up happens in a browser. On an interactive terminal, the command opens the sign-up URL for you, waits, and signs this CLI in automatically once you finish. A single command takes you from a temporary session to signed in. When output is piped, or you pass --json, the command prints the URL instead of opening a browser and still waits to sign you in.
The command waits for sign-up only when the browser can redirect back to the CLI on localhost. In environments where it can’t, such as an SSH session, a container, CI, or a configured Postman authentication service, the command prints the URL and exits without waiting. In those cases, finish by running postman login.
Usage
Options
Starts a temporary session instead of signing up. No account or browser is needed, so it works anywhere. Your work is saved to a temporary workspace that you can keep by running postman signup later.
Skips pushing your local work to your temporary workspace before you sign up. By default, the command first pushes work saved under postman/, other than installed skills, so the workspace you keep isn’t empty.
Prints the sign-up details as JSON for machine-readable output. When the command pushed your local work, the JSON includes a push field with the counts of created, updated, deleted, failed, and blocked items. The JSON includes "unpushedWork": true when the push failed, or when you pass --no-push and your local work was never pushed.
Examples
postman logout
The logout command signs you out of Postman and deletes the stored API key. It also deletes every agent session stored alongside yours, whether you run it from a terminal or from inside an AI coding agent. This removes the agent sessions from your machine only. Unlike your own session, they aren’t individually invalidated on the server.
Working in a temporary session stores credentials on your machine, so logout deletes those too and ends the session. Your local files stay on your machine, but the temporary workspace and anything pushed to it become unreachable. To copy the local files into an account afterward, see postman login.
Usage
Examples
postman whoami
This command shows the Postman account or session the CLI is using. Use it to verify your session in automated and local workflows. For example, confirm which account a CI job is authenticated as, or check whether you’re operating in a temporary session. If neither an account nor a temporary session is active, the command reports that and points you to postman signup or postman login.
Usage
Options
Prints the current identity as JSON for machine-readable output.