Skip to main content
Variables are placeholders that Postchi replaces with values from your active environment when a request runs. You write them as <variable_name> and they work anywhere in the request file — URLs, headers, and body fields.

Syntax

Wrap the variable name in angle brackets:
Variable names come from the active environment section in your environments.cenv or secrets.cenv files.
If a variable is used in a request but not defined in the active environment, Postchi shows an error and does not run the request.

Where variables work

LocationExample
URL segmenthttps://api.example.com/users/<user_id>
Query parameterhttps://api.example.com/search?q=<search_term>
Header valueAuthorization: <api_token>
JSON body value"email": "<email>"
Form body valueusername=<username>

Example

If your active environment contains:
Then this request file:
Resolves to:

Variables in JSON bodies

In a JSON body, Postchi expects variables to appear as quoted string values. Wrap the placeholder in double quotes:
Postchi replaces "<username>" with the resolved value wrapped in quotes, keeping the JSON valid.