Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getpostchi.com/llms.txt

Use this file to discover all available pages before exploring further.

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_name>
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:
# Production
api_token=Bearer abc123
user_id=42
Then this request file:
GET /api/users/<user_id>
Authorization: <api_token>
Accept: application/json
Resolves to:
GET /api/users/42
Authorization: Bearer abc123
Accept: application/json

Variables in JSON bodies

In a JSON body, Postchi expects variables to appear as quoted string values. Wrap the placeholder in double quotes:
POST https://api.example.com/users
Content-Type: application/json
@body
{
  "name": "<username>",
  "email": "<email>",
  "role": "admin"
}
Postchi replaces "<username>" with the resolved value wrapped in quotes, keeping the JSON valid.