Utilizziamo i cookie per migliorare la tua esperienza sul sito
CodeWorlds
Torna alle collezioni
Guide20 min read

Insomnia - Kompletny Przewodnik po Desktop API Client

Insomnia is a professional desktop API client from Kong. REST, GraphQL, gRPC testing with API design (OpenAPI), automated testing, environment variables, and plugins. Lightweight Postman alternative.

Insomnia - complete guide to the desktop API client

Imagine clicking an application icon and being ready to send your first API request before you can even blink. That's Insomnia. While Postman has become the default choice for many developers, its growing complexity, mandatory accounts, and resource hunger have pushed many to seek alternatives. Insomnia, backed by Kong (the company behind the world's most popular API Gateway), offers a compelling answer: professional-grade API testing with startup times measured in milliseconds, not seconds.

This guide walks you through everything from basic REST testing to advanced gRPC streaming, OpenAPI design workflows, and Git-based team collaboration. Whether you're a solo developer debugging endpoints or part of a team building comprehensive API specifications, you'll discover why millions have made Insomnia their daily driver.

What is Insomnia?

Insomnia is an elegant, efficient, and fully-featured desktop API client created by Kong - the company behind Kong Gateway, the world's most popular API Gateway. Unlike the increasingly heavy Postman, Insomnia focuses on simplicity and speed while maintaining all the professional features developers need.

Insomnia offers a complete environment for working with APIs: testing REST, GraphQL, and gRPC endpoints, designing APIs with OpenAPI/Swagger, automated testing, environment management, and plugins that extend functionality. All of this in an application that starts in a fraction of a second and doesn't burden your system.

Created in 2015 by Gregory Schlinker, Insomnia quickly gained popularity among developers who valued clean aesthetics and fast performance. In 2019, the project was acquired by Kong, bringing stable funding and integration with the Kong ecosystem. Today, Insomnia has millions of users and ranks among the most popular API testing tools.

The philosophy behind Insomnia

Insomnia was born from its creator's frustration with existing tools. Gregory Schlinker wanted to build an application that:

  • Starts instantly (not like Postman requiring several seconds)
  • Has a clean, minimalist interface
  • Focuses on what matters most - testing APIs
  • Doesn't force account creation for basic functionality

This "developer-first" philosophy attracted a community that valued simplicity and efficiency. After the Kong acquisition in 2019, Insomnia gained enterprise support while preserving its minimalist character.

Why choose Insomnia?

Key advantages

  1. Lightning-fast startup - The application launches in a fraction of a second
  2. Low resource usage - About 150-200MB RAM vs 500MB+ for Postman
  3. Native OpenAPI support - Design APIs visually, auto-generate requests
  4. Request chaining - Automatically pass data between requests
  5. Plugin system - Extend functionality with your own plugins
  6. Git Sync - Synchronize projects via Git (no proprietary cloud required)
  7. Scratch Pad - Offline mode without an account, complete privacy
  8. Clean design - Minimalist interface without distractions

Insomnia vs Postman vs Hoppscotch

FeatureInsomniaPostmanHoppscotch
PlatformDesktopDesktop + WebWeb
Size~200MB~500MB~0 (web)
Startup time<1s3-5sInstant
RAM usage~150MB~500MBBrowser
REST
GraphQL
gRPC
WebSocket
OpenAPI Design✅ NativePluginImport
Git Sync✅ Built-inExternalExport
Plugins
Free tier✅ Scratch PadLimited✅ Full
Open SourcePartiallyNo
Offline mode✅ (Scratch Pad)Limited✅ (PWA)

Installation

macOS

Code
Bash
# Homebrew (recommended)
brew install --cask insomnia

# Or download from insomnia.rest

Windows

Code
Bash
# Winget
winget install Insomnia.Insomnia

# Chocolatey
choco install insomnia-rest-api-client

# Or download installer from insomnia.rest

Linux

Code
Bash
# Ubuntu/Debian
# Add repository
echo "deb [trusted=yes arch=amd64] https://download.konghq.com/insomnia-ubuntu/ default all" \
  | sudo tee /etc/apt/sources.list.d/insomnia.list

# Install
sudo apt update && sudo apt install insomnia

# Snap
sudo snap install insomnia

# Fedora
sudo dnf install insomnia

# Arch Linux (AUR)
yay -S insomnia-bin

Initial setup

Code
Bash
# After installation you can:

# 1. Use Scratch Pad (offline, no account)
# Full functionality, local data storage

# 2. Sign in (cloud sync)
# Sync across devices

# 3. Connect to Git (self-hosted sync)
# Version control and collaboration via Git

REST API testing

Basic GET request

Code
TEXT
Method: GET
URL: https://api.example.com/users

Headers:
  Accept: application/json
  Authorization: Bearer {{ _.authToken }}

# Response (200 OK)
{
  "users": [
    {"id": 1, "name": "John", "email": "john@example.com"},
    {"id": 2, "name": "Anna", "email": "anna@example.com"}
  ],
  "total": 2,
  "page": 1
}

POST request with body

Code
TEXT
Method: POST
URL: {{ _.baseUrl }}/users

Headers:
  Content-Type: application/json
  Authorization: Bearer {{ _.authToken }}

Body (JSON):
{
  "firstName": "Peter",
  "lastName": "Smith",
  "email": "peter@example.com",
  "role": "developer",
  "department": "Engineering"
}

# Response (201 Created)
{
  "id": "user_abc123",
  "firstName": "Peter",
  "lastName": "Smith",
  "email": "peter@example.com",
  "role": "developer",
  "department": "Engineering",
  "createdAt": "2025-01-25T10:30:00Z"
}

PUT/PATCH request

Code
TEXT
Method: PATCH
URL: {{ _.baseUrl }}/users/{{ _.userId }}

Headers:
  Content-Type: application/json
  Authorization: Bearer {{ _.authToken }}

Body:
{
  "role": "senior-developer",
  "department": "Platform Engineering"
}

# Response (200 OK)
{
  "id": "user_abc123",
  "firstName": "Peter",
  "lastName": "Smith",
  "role": "senior-developer",
  "department": "Platform Engineering",
  "updatedAt": "2025-01-25T11:00:00Z"
}

DELETE request

Code
TEXT
Method: DELETE
URL: {{ _.baseUrl }}/users/{{ _.userId }}

Headers:
  Authorization: Bearer {{ _.authToken }}

# Response (204 No Content)

Query parameters

Code
TEXT
Method: GET
URL: {{ _.baseUrl }}/products

Query:
  category: electronics
  minPrice: 100
  maxPrice: 1000
  inStock: true
  sort: price
  order: asc
  page: 1
  limit: 20

# Insomnia automatically builds the URL:
# https://api.example.com/products?category=electronics&minPrice=100&maxPrice=1000&inStock=true&sort=price&order=asc&page=1&limit=20

Different body types

Code
TEXT
# 1. JSON (application/json)
{
  "name": "Product",
  "price": 99.99
}

# 2. Form URL Encoded (application/x-www-form-urlencoded)
name=Product&price=99.99

# 3. Multipart Form Data (multipart/form-data)
--boundary
Content-Disposition: form-data; name="file"; filename="image.png"
Content-Type: image/png

[binary data]
--boundary
Content-Disposition: form-data; name="description"

Product image
--boundary--

# 4. XML (application/xml)
<?xml version="1.0"?>
<product>
  <name>Product</name>
  <price>99.99</price>
</product>

# 5. Plain Text (text/plain)
Raw text content

# 6. Binary (for file upload)
[File selector]

Environment variables

Creating environments

Code
JSON
// Base Environment (shared across all)
{
  "apiVersion": "v1",
  "timeout": 30000,
  "retries": 3
}
Code
JSON
// Development Environment
{
  "baseUrl": "http://localhost:3000/api",
  "authToken": "dev-token-12345",
  "debugMode": true,
  "database": "dev_db",
  "logLevel": "debug"
}
Code
JSON
// Staging Environment
{
  "baseUrl": "https://staging-api.example.com",
  "authToken": "staging-token-67890",
  "debugMode": true,
  "database": "staging_db",
  "logLevel": "info"
}
Code
JSON
// Production Environment
{
  "baseUrl": "https://api.example.com",
  "authToken": "{{ process.env.PROD_API_TOKEN }}",
  "debugMode": false,
  "database": "prod_db",
  "logLevel": "error"
}

Using variables

Code
TEXT
# In URL
URL: {{ _.baseUrl }}/{{ _.apiVersion }}/users

# In Headers
Authorization: Bearer {{ _.authToken }}
X-Debug-Mode: {{ _.debugMode }}

# In Body
{
  "config": {
    "database": "{{ _.database }}",
    "timeout": {{ _.timeout }}
  }
}

# System environment variables
{{ process.env.API_KEY }}

# Timestamp
{{ timestamp }}

# UUID
{{ uuid }}

Dynamic variables (template tags)

Code
JavaScript
// Built-in template tags in Insomnia:

{{ timestamp }}           // Unix timestamp: 1706180000
{{ timestamp:iso }}       // ISO date: 2025-01-25T10:30:00.000Z
{{ uuid }}                // UUID v4: f47ac10b-58cc-4372-a567-0e02b2c3d479
{{ base64:encode }}       // Base64 encode
{{ base64:decode }}       // Base64 decode
{{ hash:sha256 }}         // SHA256 hash
{{ now:YYYY-MM-DD }}      // Formatted date

// Response reference (for chaining)
{% response 'body', 'req_login', '$.token' %}
{% response 'header', 'req_login', 'X-Request-Id' %}
{% response 'status', 'req_login' %}

// Prompt (ask user)
{% prompt 'Enter API Key', 'api-key', false %}

// File (load from file)
{% file './data/payload.json' %}

Request chaining

Automatic token passing

Code
JavaScript
// Scenario: Login → Profile → Update

// 1. Login Request
POST {{ _.baseUrl }}/auth/login
Body: { "email": "user@example.com", "password": "secret" }
// Response: { "token": "jwt_token_here", "refreshToken": "refresh_here" }

// 2. Profile Request (uses token from Login)
GET {{ _.baseUrl }}/users/me
Headers:
  Authorization: Bearer {% response 'body', 'req_login', '$.token' %}

// 3. Update Request (uses userId from Profile)
PATCH {{ _.baseUrl }}/users/{% response 'body', 'req_profile', '$.id' %}
Headers:
  Authorization: Bearer {% response 'body', 'req_login', '$.token' %}
Body: { "name": "Updated Name" }

Chaining with JSONPath

Code
JavaScript
// Response from first request:
{
  "data": {
    "user": {
      "id": "user_123",
      "profile": {
        "settings": {
          "theme": "dark",
          "notifications": true
        }
      }
    }
  }
}

// JSONPath expressions:
{% response 'body', 'req_1', '$.data.user.id' %}
// Result: "user_123"

{% response 'body', 'req_1', '$.data.user.profile.settings.theme' %}
// Result: "dark"

{% response 'body', 'req_1', '$.data.user.profile.settings.*' %}
// Result: ["dark", true]

Environment chaining

Code
JSON
// Environment with dynamic values
{
  "authToken": "{% response 'body', 'req_login', '$.token' %}",
  "userId": "{% response 'body', 'req_login', '$.user.id' %}",
  "sessionId": "{% response 'header', 'req_login', 'X-Session-Id' %}"
}

// Now all requests use these values:
Authorization: Bearer {{ _.authToken }}
X-User-Id: {{ _.userId }}
X-Session-Id: {{ _.sessionId }}

GraphQL

Query

Code
GraphQL
# Endpoint: {{ _.baseUrl }}/graphql

query GetUsers($first: Int!, $after: String) {
  users(first: $first, after: $after) {
    edges {
      node {
        id
        name
        email
        avatar
        createdAt
      }
      cursor
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

# Variables
{
  "first": 10,
  "after": null
}

Mutation

Code
GraphQL
mutation CreateUser($input: CreateUserInput!) {
  createUser(input: $input) {
    user {
      id
      name
      email
    }
    errors {
      field
      message
    }
  }
}

# Variables
{
  "input": {
    "name": "John Smith",
    "email": "john@example.com",
    "password": "securePassword123"
  }
}

Subscription

Code
GraphQL
# Insomnia supports GraphQL subscriptions via WebSocket

subscription OnMessageReceived($channelId: ID!) {
  messageReceived(channelId: $channelId) {
    id
    content
    sender {
      name
      avatar
    }
    createdAt
  }
}

# Variables
{
  "channelId": "channel_123"
}

# Insomnia automatically establishes WebSocket connection
# and displays incoming messages

Auto-complete and schema

Code
GraphQL
# Insomnia automatically fetches schema from:
# - Introspection query
# - URL to schema file
# - Local .graphql file

# This gives you:
# - Autocomplete for fields and types
# - Real-time query validation
# - Inline documentation
# - Argument hints

gRPC testing

Configuration

Code
TEXT
# Method 1: Reflection (automatic)
Server URL: grpc.example.com:443
Use Server Reflection: Yes

# Method 2: Proto file
Server URL: grpc.example.com:443
Proto File: ./protos/service.proto

# Method 3: Proto directory
Server URL: grpc.example.com:443
Proto Directory: ./protos/

Unary call

user_service.proto
PROTOBUF
// user_service.proto
service UserService {
  rpc GetUser (GetUserRequest) returns (User);
  rpc CreateUser (CreateUserRequest) returns (User);
}

message GetUserRequest {
  string id = 1;
}

message User {
  string id = 1;
  string name = 2;
  string email = 3;
  int32 age = 4;
}
Code
JSON
// Request (Insomnia)
Service: UserService
Method: GetUser

Message:
{
  "id": "user_123"
}

// Response
{
  "id": "user_123",
  "name": "John Smith",
  "email": "john@example.com",
  "age": 30
}

Server streaming

Code
PROTOBUF
service StreamService {
  rpc StreamEvents (StreamRequest) returns (stream Event);
}

message StreamRequest {
  string channel = 1;
}

message Event {
  string id = 1;
  string type = 2;
  string data = 3;
  int64 timestamp = 4;
}
Code
JSON
// Request
{
  "channel": "notifications"
}

// Streaming responses (displayed in real-time)
{"id":"1","type":"message","data":"Hello","timestamp":1706180000}
{"id":"2","type":"notification","data":"Update","timestamp":1706180001}
{"id":"3","type":"alert","data":"Warning","timestamp":1706180002}

Bidirectional streaming

Code
PROTOBUF
service ChatService {
  rpc Chat (stream ChatMessage) returns (stream ChatMessage);
}

message ChatMessage {
  string user = 1;
  string content = 2;
  int64 timestamp = 3;
}
Code
JSON
// Send messages
{"user":"john","content":"Hello!","timestamp":1706180000}
{"user":"john","content":"Anyone there?","timestamp":1706180005}

// Receive responses
{"user":"anna","content":"Hi John!","timestamp":1706180002}
{"user":"anna","content":"Yes, I'm here","timestamp":1706180007}

API design (OpenAPI)

Creating specifications

Code
YAML
# Insomnia Design View

openapi: 3.1.0
info:
  title: My API
  version: 1.0.0
  description: |
    API for an e-commerce application.
    Handles users, products, and orders.
  contact:
    name: API Support
    email: api@example.com

servers:
  - url: https://api.example.com/v1
    description: Production
  - url: https://staging-api.example.com/v1
    description: Staging
  - url: http://localhost:3000/v1
    description: Development

paths:
  /users:
    get:
      summary: List users
      operationId: listUsers
      tags:
        - Users
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            default: 1
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
            maximum: 100
      responses:
        '200':
          description: User list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserList'

    post:
      summary: Create user
      operationId: createUser
      tags:
        - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserInput'
      responses:
        '201':
          description: User created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'

components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
          format: email
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - email

    CreateUserInput:
      type: object
      properties:
        name:
          type: string
          minLength: 2
          maxLength: 100
        email:
          type: string
          format: email
        password:
          type: string
          minLength: 8
      required:
        - name
        - email
        - password

  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

security:
  - bearerAuth: []

Generating requests from OpenAPI

Code
TEXT
# After defining the OpenAPI spec, Insomnia automatically:

1. Generates a Collection with all endpoints
2. Creates example requests
3. Sets up validation based on schemas
4. Generates documentation
5. Creates a mock server (preview)

# You can also import existing specs:
File → Import → OpenAPI/Swagger

Testing in Insomnia

Basic test scripts

Code
JavaScript
// Test script (JavaScript)
// Runs after each response

// Check status code
const response = insomnia.response;

if (response.status !== 200) {
  throw new Error(`Expected 200, got ${response.status}`);
}

// Check body
const body = JSON.parse(response.body);

if (!body.users || !Array.isArray(body.users)) {
  throw new Error('Expected users array in response');
}

if (body.users.length === 0) {
  throw new Error('Expected at least one user');
}

// Check structure
const user = body.users[0];
const requiredFields = ['id', 'name', 'email'];

for (const field of requiredFields) {
  if (!user[field]) {
    throw new Error(`Missing required field: ${field}`);
  }
}

// Check response time
if (response.responseTime > 1000) {
  throw new Error(`Response too slow: ${response.responseTime}ms`);
}

console.log('All tests passed!');

Assertions with Chai

Code
JavaScript
// Insomnia supports Chai assertions

const { expect } = require('chai');

const response = insomnia.response;
const body = JSON.parse(response.body);

// Status assertions
expect(response.status).to.equal(200);
expect(response.status).to.be.within(200, 299);

// Body assertions
expect(body).to.have.property('users');
expect(body.users).to.be.an('array');
expect(body.users).to.have.lengthOf.at.least(1);

// User structure
const user = body.users[0];
expect(user).to.include.all.keys('id', 'name', 'email');
expect(user.email).to.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);

// Headers
expect(response.headers).to.have.property('content-type');
expect(response.headers['content-type']).to.include('application/json');

// Response time
expect(response.responseTime).to.be.below(500);

Collection runner

Code
Bash
# Run all tests in a collection

# From GUI:
# 1. Open Collection
# 2. Click "Run" button
# 3. Select Environment
# 4. Click "Run Tests"

# From CLI (Inso):
npm install -g insomnia-inso

# Run tests
inso run test "My Collection" --env "Production"

# Output:
# Running tests for "My Collection"
#   ✓ GET /users (234ms)
#   ✓ POST /users (456ms)
#   ✓ GET /users/:id (123ms)
#   ✗ DELETE /users/:id (89ms)
#     Error: Expected 204, got 403
#
# Results: 3 passed, 1 failed

CI/CD integration

.github/workflows/api-tests.yml
YAML
# .github/workflows/api-tests.yml
name: API Tests

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: '0 */6 * * *'  # Every 6 hours

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install Inso CLI
        run: npm install -g insomnia-inso

      - name: Run API Tests
        run: |
          inso run test "API Tests" \
            --src insomnia.yaml \
            --env "CI Environment" \
            --reporter junit \
            --output test-results.xml
        env:
          API_BASE_URL: ${{ secrets.API_BASE_URL }}
          API_TOKEN: ${{ secrets.API_TOKEN }}

      - name: Upload Test Results
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: test-results
          path: test-results.xml

Plugins

Installing plugins

Code
Bash
# Insomnia Plugin Hub
# Preferences → Plugins → Browse Plugins

# Popular plugins:
# - insomnia-plugin-jwt - JWT decoding
# - insomnia-plugin-hash - Hashing functions
# - insomnia-plugin-file - File operations
# - insomnia-plugin-random - Random data generators
# - insomnia-plugin-base64 - Base64 encode/decode

Creating custom plugins

JSinsomnia-plugin-custom-auth/main.js
JavaScript
// insomnia-plugin-custom-auth/main.js

module.exports.templateTags = [
  {
    name: 'customAuth',
    displayName: 'Custom Auth Token',
    description: 'Generates custom authentication token',

    args: [
      {
        displayName: 'API Key',
        type: 'string',
        defaultValue: ''
      },
      {
        displayName: 'Secret',
        type: 'string',
        defaultValue: ''
      }
    ],

    async run(context, apiKey, secret) {
      const crypto = require('crypto');
      const timestamp = Date.now().toString();
      const message = `${apiKey}:${timestamp}`;

      const hmac = crypto.createHmac('sha256', secret);
      hmac.update(message);
      const signature = hmac.digest('hex');

      return `${apiKey}:${timestamp}:${signature}`;
    }
  }
];

// Usage in Insomnia:
// Authorization: {% customAuth 'my-api-key', 'my-secret' %}

Request/Response hooks

JSinsomnia-plugin-logger/main.js
JavaScript
// insomnia-plugin-logger/main.js

module.exports.requestHooks = [
  (context) => {
    const { request } = context;

    // Log request details
    console.log(`[REQUEST] ${request.method} ${request.url}`);
    console.log('[HEADERS]', JSON.stringify(request.headers, null, 2));

    // Modify request
    request.setHeader('X-Request-Id', generateUUID());
    request.setHeader('X-Timestamp', Date.now().toString());
  }
];

module.exports.responseHooks = [
  (context) => {
    const { response } = context;

    // Log response
    console.log(`[RESPONSE] ${response.status} ${response.statusText}`);
    console.log(`[TIME] ${response.elapsedTime}ms`);

    // Check for errors
    if (response.status >= 400) {
      console.error('[ERROR]', response.body);
    }
  }
];

Inso CLI

Installation

Code
Bash
# npm
npm install -g insomnia-inso

# Homebrew (macOS)
brew install inso

# Check version
inso --version

Basic commands

Code
Bash
# Export spec to file
inso export spec "My API" --output api-spec.yaml

# Lint OpenAPI spec
inso lint spec api-spec.yaml

# Run tests
inso run test "API Tests" --env "Production"

# Generate Kong configuration
inso generate config "My API" --type kong --output kong.yaml

# Script mode (from file)
inso script run my-script

Kong Gateway integration

Code
Bash
# Generate Kong configuration from OpenAPI
inso generate config "My API" \
  --type kong \
  --output kong.yaml
Code
YAML
# Generated kong.yaml
_format_version: "2.1"
services:
  - name: my-api
    url: https://api.example.com
    routes:
      - name: users-list
        paths:
          - /v1/users
        methods:
          - GET
        strip_path: false
    plugins:
      - name: rate-limiting
        config:
          minute: 100
      - name: jwt

Git Sync

Setting up Git Sync

Code
Bash
# 1. Create a new project in Insomnia
# 2. Click "Setup Git Sync"
# 3. Enter repository URL:
#    git@github.com:username/api-collection.git

# Repository structure:
api-collection/
├── .insomnia/
│   ├── ApiSpec/
│   │   └── spc_xxx.yml        # OpenAPI specs
│   ├── Environment/
│   │   ├── env_base.json      # Base environment
│   │   ├── env_dev.json       # Dev environment
│   │   └── env_prod.json      # Prod environment
│   ├── Request/
│   │   ├── req_login.json     # Login request
│   │   ├── req_users.json     # Users request
│   │   └── req_products.json  # Products request
│   ├── RequestGroup/
│   │   ├── fld_auth.json      # Auth folder
│   │   └── fld_api.json       # API folder
│   └── Workspace/
│       └── wrk_main.json      # Main workspace
└── README.md

Team workflow

Code
Bash
# Developer 1: Adding a new endpoint
# 1. Pull latest changes
git pull origin main

# 2. Create branch
git checkout -b feature/add-orders-endpoint

# 3. Edit in Insomnia (automatic sync)

# 4. Commit and push
git add .
git commit -m "Add orders endpoint"
git push origin feature/add-orders-endpoint

# 5. Create Pull Request

# Developer 2: Review and merge
# 1. Pull branch
git fetch origin
git checkout feature/add-orders-endpoint

# 2. Open in Insomnia and test

# 3. Merge after approval
git checkout main
git merge feature/add-orders-endpoint
git push origin main

# Everyone: Sync
# Insomnia automatically detects changes and synchronizes

Authentication

Basic Auth

Code
TEXT
Authorization Type: Basic Auth
Username: api_user
Password: api_secret

# Insomnia generates:
Authorization: Basic YXBpX3VzZXI6YXBpX3NlY3JldA==

Bearer Token

Code
TEXT
Authorization Type: Bearer Token
Token: {{ _.authToken }}

# Header:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

OAuth 2.0

Code
TEXT
Authorization Type: OAuth 2.0

# Grant Type: Authorization Code
Authorization URL: https://auth.example.com/authorize
Token URL: https://auth.example.com/token
Client ID: {{ _.clientId }}
Client Secret: {{ _.clientSecret }}
Redirect URL: insomnia://oauth/callback
Scope: read write profile

# Insomnia handles the flow automatically:
# 1. Opens browser for authorization
# 2. Receives callback with code
# 3. Exchanges code for token
# 4. Uses token in requests

AWS Signature

Code
TEXT
Authorization Type: AWS IAM v4

Access Key ID: {{ _.awsAccessKey }}
Secret Access Key: {{ _.awsSecretKey }}
Region: eu-central-1
Service: execute-api

# Optional:
Session Token: {{ _.awsSessionToken }}

# Insomnia automatically generates:
# - Authorization header (AWS4-HMAC-SHA256)
# - X-Amz-Date
# - X-Amz-Security-Token (if using STS)

Keyboard shortcuts

Code
Bash
# Request
Ctrl/Cmd + Enter       # Send request
Ctrl/Cmd + Shift + Enter  # Send and download response
Ctrl/Cmd + R           # Refresh/Resend

# Navigation
Ctrl/Cmd + 1-9         # Switch between requests
Ctrl/Cmd + E           # Toggle Environment selector
Ctrl/Cmd + Shift + E   # Manage Environments
Ctrl/Cmd + P           # Quick switch (fuzzy search)

# Edit
Ctrl/Cmd + D           # Duplicate request
Ctrl/Cmd + Shift + D   # Duplicate folder
Ctrl/Cmd + Delete      # Delete request
Ctrl/Cmd + N           # New request
Ctrl/Cmd + Shift + N   # New folder

# View
Ctrl/Cmd + \           # Toggle sidebar
Ctrl/Cmd + Shift + \   # Toggle response panel
Ctrl/Cmd + ,           # Preferences
F11                    # Fullscreen

# Format
Ctrl/Cmd + Shift + F   # Format JSON/XML
Tab                    # Indent
Shift + Tab            # Outdent

Pricing

Insomnia Free (Scratch Pad)

FeatureAvailability
REST/GraphQL/gRPC
WebSocket
OpenAPI Design
Environments
Plugins
Local storage
Cloud sync
Team collaboration

Insomnia Individual

FeaturePrice: $5/month
Everything in Free
Cloud sync
End-to-end encryption
Unlimited devices

Insomnia Team

FeaturePrice: $12/user/month
Everything in Individual
Team workspaces
Role-based access
Shared environments
Git Sync (built-in)

Insomnia Enterprise

FeatureCustom pricing
Everything in Team
SSO/SAML
Audit logs
Advanced security
Dedicated support
On-premise option

FAQ - frequently asked questions

Is Insomnia free?

Yes, Insomnia offers a free "Scratch Pad" plan with full functionality for local use. Data is stored only locally, without sync between devices. Paid plans add cloud sync and team features.

How do I migrate from Postman to Insomnia?

Insomnia supports importing Postman collections. Export your collection from Postman as JSON (Collection v2.1) and import it in Insomnia via File → Import. Most requests, environments, and variables will transfer automatically.

Can I use Insomnia offline?

Yes, in Scratch Pad mode Insomnia works completely offline. All data is stored locally. For paid plans with cloud sync, requests work offline and synchronization happens when connected to the internet.

How do I secure sensitive data?

  1. Scratch Pad - data stays local, full control
  2. Cloud Sync - end-to-end encryption, data encrypted before sending
  3. Git Sync - use your own private repository
  4. Environment variables - store secrets in a separate .env file

Does Insomnia support GraphQL introspection?

Yes, Insomnia automatically runs introspection queries and fetches schema from the GraphQL server. This gives you autocomplete, validation, and field documentation directly in the editor.

How do I share collections with my team without a paid plan?

Use Git Sync - it's available even in the free version. Export your project as a Git repository and share via GitHub, GitLab, or Bitbucket. Every team member can clone the repo and open it in their Insomnia.

Can I integrate Insomnia with CI/CD?

Yes, use the Inso CLI. You can run API tests, generate Kong Gateway configurations, and export OpenAPI specifications as part of your CI/CD pipeline.

Summary

Insomnia is a professional API client from Kong that combines elegant design with full functionality. With lightning-fast startup, low resource usage, and native OpenAPI support, it's the ideal choice for developers seeking an efficient alternative to Postman.

Main advantages of Insomnia:

  • Speed - starts in a fraction of a second, low RAM usage
  • Native OpenAPI - design APIs visually, generate requests automatically
  • Request chaining - automatic data passing between requests
  • Git Sync - team collaboration without vendor lock-in
  • Plugin system - extend functionality as needed
  • Scratch Pad - full functionality without an account

Whether for daily API testing, designing new endpoints, or automating tests in CI/CD, Insomnia delivers everything you need in an elegant, efficient package.