Think of environments like profiles on Netflix. Same app, same interface. But when you switch profiles, the content changes. In Postman, when you switch environments, the variable values change. Your requests stay exactly the same.
Every real project has at least three servers. Dev — where developers break things. Staging — where QA tests things. Production — where users live. Your API tests need to run against all three. Same tests. Different servers. That is what environments give you.
Click the "Environments" tab in the left sidebar (or the eye icon in top-right)
Click the "+" button to create a new environment
Name it "Development" — always use clear, descriptive names
Add variable "baseUrl" with Initial Value "https://www.testerrank.com/api"
Add variable "authToken" — leave it blank for now (we will fill it via scripts)
Click Save. Repeat for "Staging" and "Production" with their respective URLs
Select the active environment from the dropdown in the top-right corner
| Variable | Development | Staging | Production |
|---|---|---|---|
| baseUrl | https://www.testerrank.com/api | https://staging.myapp.com/api | https://api.myapp.com |
| authToken | (set by login script) | (set by login script) | (set by login script) |
| dbName | myapp_dev | myapp_staging | myapp_prod |
| timeout | 5000 | 10000 | 15000 |
| adminEmail | dev@test.com | qa@myapp.com | admin@myapp.com |
{
"name": "Development",
"values": [
{
"key": "baseUrl",
"value": "https://www.testerrank.com/api",
"type": "default",
"enabled": true
},
{
"key": "authToken",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "timeout",
"value": "5000",
"type": "default",
"enabled": true
}
]
}This trips up beginners. Every variable has TWO values. Initial Value is synced to Postman cloud — your team sees it. Current Value is local to your machine — only you see it. When you type a token into Current Value, it stays on your laptop. When you type it into Initial Value, it goes to the cloud and everyone on your team can see it.
NEVER put real passwords, API keys, or tokens in Initial Value. They sync to Postman cloud. Use Current Value for sensitive data. Better yet, set secret variables using the "secret" type — Postman masks them in the UI.
When sharing environments with your team, set Initial Values to placeholder text like "your-token-here" so teammates know what to fill in. They will set their own Current Values locally.
Q: What is the difference between Initial Value and Current Value in Postman environments?
A: Initial Value is synced to Postman servers and shared with team members — it should never contain sensitive data like passwords or tokens. Current Value is stored locally on your machine and never synced. In practice, you put non-sensitive defaults (like base URLs) in Initial Value and put secrets (like auth tokens) only in Current Value. When exporting environments, only Initial Values are included by default.
Key Point: Environments let you run the same collection against dev, staging, and production by switching a dropdown. Never put secrets in Initial Value.