Environments
Environments let you define sets of variables and instantly switch between them. Use environments to manage different API base URLs, tokens, and settings for dev, staging, and production without editing your requests.
What Are Environments?
An environment is a named collection of key-value variables. For example:
Development
BASE_URL = http://localhost:3000
API_KEY = dev-key-abc123
USER_ID = 42
Production
BASE_URL = https://api.example.com
API_KEY = prod-key-xyz789
USER_ID = 42
When you send a request, Samvad replaces any {{VARIABLE}} placeholder with the value from the currently active environment.
Using Variables in Requests
Use double curly braces {{VARIABLE_NAME}} anywhere in your request:
- URL:
{{BASE_URL}}/users/{{USER_ID}} - Headers:
Authorization: Bearer {{ACCESS_TOKEN}} - Body:
{ "key": "{{API_KEY}}" } - Query params:
?token={{TOKEN}}
Creating an Environment
- Open the Environment panel (bottom of the sidebar or
Cmd+E) - Click New Environment
- Name it (e.g.,
Development,Staging,Production) - Click Save
Adding Variables
- Select the environment to edit
- Click + Add Variable
- Enter the variable Key and Value
- Toggle Enabled to include/exclude variables
- Mark as Secret to hide the value in the UI
| Field | Description |
|---|---|
| Key | Variable name (e.g., BASE_URL) |
| Value | Variable value |
| Enabled | Include this variable when active |
| Secret | Mask the value in the UI |
Switching Environments
Click the Environment selector dropdown in the top bar to switch the active environment. Changes take effect immediately — no restart required.
Workspaces and Environments
Environments are workspace-scoped. Each workspace has its own independent set of environments. When you switch workspaces, the environment list changes accordingly.
Tips
- Use Secret for tokens, passwords, and API keys so they’re not visible at a glance.
- Name environments clearly:
Dev,Staging,Prod. - Disabled variables are skipped during substitution but kept for future use.
- Variables with the same key as a disabled variable in the active env will not be substituted.