Insomnia
01 / 02

Collections, Environments & Variables

Collections, Environments & Variables

Organizational Hierarchy

Workspace (top-level, one per project/API) contains Collections/folders of requests, plus its own Environments. A Collection groups a related set of requests, mirroring how most API clients (Postman included) organize by project rather than a flat list.

Environments & Variable Templating

GET {{ base_url }}/users/{{ user_id }}
Authorization: Bearer {{ auth_token }}

# Base Environment: shared defaults (e.g. Content-Type header)
# Sub-Environments override per target:
#   Development -> base_url = http://localhost:3000
#   Production  -> base_url = https://api.example.com

Switching the active environment repoints the same request set at a different target — avoiding the risk of accidentally hitting production with dev credentials, or vice versa. {{ }} templating (Nunjucks-based) works in URLs, headers, query params, and bodies.

Auth Types & Chained Requests

Structured UI for Bearer/Basic/OAuth 2.0 auth avoids manually crafting headers — OAuth 2.0's token exchange especially benefits from this. Request chaining lets a login request's token flow automatically into subsequent requests' headers as a variable, instead of manual copy-paste.

Cookie Jars

Automatically stores and resends cookies (like a session cookie from login) across requests, mimicking real browser cookie behavior — needed for APIs using cookie-based session auth rather than a header token.

Keep your own version of these notes — editable, searchable, and organised by your stack.

Start free