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.

Request file format

A request file has three parts:
  1. Request line — the HTTP method and URL on the first non-comment line
  2. Headers — one header per line in Header-Name: value format
  3. Body — everything after the @body directive
Empty lines and lines starting with // are ignored. Use // comments freely to document your requests.

Request line

The first line must be the HTTP method followed by the URL, separated by a space:
METHOD https://example.com/path

Headers

Add headers on the lines immediately after the request line, before @body. Each header follows the standard Name : value format:
Accept: application/json
Content-Type: application/json
Authorization: Bearer my-token

Body

Place @body on its own line to start the body section. Everything after @body is sent as the request body. See Request body for details on supported formats.

Examples

GET request

GET https://api.example.com/users
Accept: application/json
Authorization: Bearer <api_token>

POST request with a JSON body

POST https://api.example.com/users
Content-Type: application/json
@body
{
  "name": "<username>",
  "email": "<email>"
}
Start typing json and a snippet suggestion will show up, select it and it will add an empty json to the request

Using comments

Lines that start with // are skipped when the request runs. Use them to explain the request or temporarily disable a header:
// Fetch all active users
GET https://api.example.com/users?status=active
Accept: application/json
// Authorization: Bearer <api_token>
Use the keyboard shortcut Cmd OR (Ctrl) + / to toggle a line as a comment.

Setting a base URL

Instead of repeating the full URL in every request file, you can set a baseUrl using folder settings at the folder level: see Folder Settings for details. With baseUrl configured, you can write request files using a root-relative path:
GET /users
Accept: application/json
Postchi prepends the baseUrl automatically when the URL starts with /.
You can set baseUrl to a variable like <base_url> and define it in your environment.