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.

An environment is a named section of variables inside a .cenv file. When you select an active environment, Postchi substitutes its variables into every request you run. Switch environments from the toolbar to instantly point your requests at a different server, token, or configuration.

The .cenv format

Environment files use the .cenv format: named sections marked with a # comment, each containing key=value pairs.
# Production
base_url=https://api.example.com
api_token=prod-token-here

# Development
base_url=https://dev.api.example.com
api_token=dev-token-here
Each # Section Name header starts a new environment. You can define as many environments as you need in a single file.

Variables and secrets

Your project contains two environment files:

environments.cenv

Non-sensitive variables like base URLs, and user IDs. Safe to commit to version control.

secrets.cenv

Sensitive values like API tokens, passwords, and private keys. Keep this out of version control.
All environments are defined in the environments file, secrets can only add variables to the environments defined there, they cannot define their own environments

Using variables in requests

Reference variables in your request files using <variable_name> placeholders. Postchi replaces them with values from the active environment section at run time.
GET /users
Authorization: bearer(<api_token>)
Use Folder Settings to define a base url and define the request using a relative path.
Variables work in URLs, headers, and request bodies. See Variables for the full placeholder syntax.

Switching environments

Select the active environment from the dropdown in the toolbar or you can switch by pressing Cmd (or Ctrl on Windows/Linux) plus a number from 1 to 9.