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 that work in the session and resources created in the Postman Cloud may not be available unless you sign up. 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.
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
A temporary workspace belongs to the temporary session, not to any Postman account. This means you can’t access it even when signed in to your account. To get your work into that account, the postman login command copies your project’s files from your machine into a new personal workspace. Pass --no-migrate-guest-workspace to sign in without copying files.
If you don’t have a Postman account yet, use postman signup to create one and make the temporary workspace yours.
The command copies the work of one project, and only what’s saved on disk:
- When you run it in a project that’s bound to your temporary workspace and has local work under
postman/, it copies that project. - When you run it outside a project, it copies the most recently used project folder from a temporary session that still has work. This works only when the Postman desktop app is installed on the same machine, because the command reads the folder locations the app records. Any other folders are listed but not copied.
Anything you changed in the Postman Cloud but never saved to disk isn’t carried over. If your account can already open the workspace the project is bound to, nothing is copied.
The sign-in finishes before the copy starts, so a failed copy still leaves you signed in. The copy runs as a postman workspace push, so every local element is created again with a new ID. If the push fails, the project stays bound to the new workspace and a .postman/guest-migration-backup.json file is left behind. Run postman workspace push again to finish the copy.
If the copy fails before the push, the project stays bound to the temporary workspace and no backup is left behind. Run postman login --migrate-guest-workspace to try again.
Usage
Options
Authenticate the user with the given API key.
Specify that your instance of Postman is hosted in the EU region. Accepts eu.
Forces the copy when the temporary session that created the workspace is already gone, such as after a failed copy or after you ran postman logout. Run it in the project bound to that workspace. While you’re still working in a temporary session, the copy happens by default and you don’t need this option.
Skips copying your temporary session’s work into the account you sign in to.
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.
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.