Postman CLI secret commands (postman secret)

View as Markdown

This topic covers secret-related commands for the Postman CLI.

Use the postman secret commands to manage secrets in your team’s Shared Vault from the command line. This supports secure credential management in your automation and CI workflows.

postman secret create

Creates a secret in your team’s Shared Vault. Sign in with the postman login command or pass an --api-key, and target a team and a workspace.

The command never accepts the secret value as a command-line argument, which keeps it out of your shell history and process list. It reads the value from a masked prompt when you run it in a terminal. To supply the value in automation, pipe it through standard input or pass --value-stdin.

Usage

postman secret create <key> [options]
<key>

The key for the new secret.

Options

--team-id <id>

The ID of the team whose Shared Vault the secret is created in. Defaults to your authenticated profile’s team. This must be your own team.

-w, --workspace <workspaceId>

The Postman workspace ID. If omitted, the command uses the workspace bound to your local project by postman init.

--api-key <key>

Your Postman API key. If omitted, the command uses your postman login session.

--value-stdin

Reads the secret value from standard input instead of prompting for it. Use this in automation and CI pipelines.

Examples

postman secret create MY_SECRET --team-id 451 --workspace 12345678-90ab-cdef-1234-567890abcdef
# Use a CI-injected variable so the raw secret stays out of your shell history.
printf '%s' "$MY_SECRET_VALUE" | postman secret create MY_SECRET --team-id 451 --value-stdin