Variables
Variables allow you to store and reuse values across your requests, making it easy to manage dynamic data.
Variable Syntax
Use double curly braces to reference variables:
{{VARIABLE_NAME}}
Variables can be used in:
- URLs
- Headers
- Query parameters
- Request bodies
- WebSocket messages
- GraphQL queries
Types of Variables
Global Variables
Available across all environments.
- Click the Settings icon next to the environment selector
- Go to the Variables tab
- Add a new variable:
- Key:
API_URL - Value:
https://api.example.com
- Key:
Environment Variables
Specific to an environment, can override global variables.
- Go to the Environments tab
- Select or create an environment
- Add environment-specific variables
Variable Priority
When a variable exists in multiple places:
Environment variables take precedence over global variables with the same name.
Managing Variables
Adding Variables
- Open Variable Manager (Settings icon)
- Click Add Variable
- Enter:
- Key: Variable name (no spaces)
- Value: Variable value
- Description: Optional description
- Toggle Enabled to activate
Secret Variables
Mark sensitive values as secrets:
- Toggle the Secret checkbox
- Value will be masked in the UI
- Stored securely
Editing Variables
Click on any variable to edit its value. Changes are saved automatically.
Deleting Variables
Click the trash icon to remove a variable.
Usage Examples
API URL
Variable: API_URL = https://api.example.com
Usage: {{API_URL}}/users
Result: https://api.example.com/users
Authentication Token
Variable: AUTH_TOKEN = eyJhbGciOiJIUzI1NiIs...
Usage: Authorization: Bearer {{AUTH_TOKEN}}
Dynamic IDs
Variable: USER_ID = 12345
Usage: {{API_URL}}/users/{{USER_ID}}
Result: https://api.example.com/users/12345
Request Body
{
"environment": "{{ENV_NAME}}",
"apiKey": "{{API_KEY}}",
"userId": "{{USER_ID}}"
}
Variable Highlighting
In input fields, variables are highlighted:
- Green: Variable exists and is enabled
- Yellow: Variable exists but is disabled
- Red: Variable not found
Best Practices
Naming Convention
Use UPPER_SNAKE_CASE for variable names:
API_URLAUTH_TOKENDATABASE_HOST
Organization
Group related variables with prefixes:
DEV_API_URL,DEV_DATABASEPROD_API_URL,PROD_DATABASE
Secrets
Always mark sensitive values as secrets:
- API keys
- Passwords
- Tokens
Common Variables
| Variable | Example Value | Usage |
|---|---|---|
API_URL | https://api.example.com | Base URL |
AUTH_TOKEN | Bearer xxx | Authorization |
API_KEY | sk-xxx | API authentication |
ENV | development | Environment name |
USER_ID | 12345 | Test user ID |