Skip to main content

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.

  1. Click the Settings icon next to the environment selector
  2. Go to the Variables tab
  3. Add a new variable:
    • Key: API_URL
    • Value: https://api.example.com

Environment Variables

Specific to an environment, can override global variables.

  1. Go to the Environments tab
  2. Select or create an environment
  3. 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

  1. Open Variable Manager (Settings icon)
  2. Click Add Variable
  3. Enter:
    • Key: Variable name (no spaces)
    • Value: Variable value
    • Description: Optional description
  4. Toggle Enabled to activate

Secret Variables

Mark sensitive values as secrets:

  1. Toggle the Secret checkbox
  2. Value will be masked in the UI
  3. 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_URL
  • AUTH_TOKEN
  • DATABASE_HOST
Organization

Group related variables with prefixes:

  • DEV_API_URL, DEV_DATABASE
  • PROD_API_URL, PROD_DATABASE
Secrets

Always mark sensitive values as secrets:

  • API keys
  • Passwords
  • Tokens

Common Variables

VariableExample ValueUsage
API_URLhttps://api.example.comBase URL
AUTH_TOKENBearer xxxAuthorization
API_KEYsk-xxxAPI authentication
ENVdevelopmentEnvironment name
USER_ID12345Test user ID