# Setup: Insomnia

Install Insomnia on Windows or macOS, the app you use to send requests to the web APIs you build and read their answers, make a free account with a project stored on your computer, and send your first request.

Novice · Node.js · REST API · Updated November 23, 2026

By Gregor Dzierzon

## After this lesson you can

- Install Insomnia and send a saved GET request from a collection

## Key takeaways

- An API client sends a request to a web address and shows the whole answer, status code and all. Insomnia is the API client this course uses.
- Install it with winget install -e --id Insomnia.Insomnia on Windows, or brew install --cask insomnia on a Mac.
- A free account with a Local Vault project keeps every request you save on your own computer.
- A collection is a folder of saved requests. Click one and click Send to ask again, any time.
- 200 OK at the top of the answer means the server found what you asked for.

From Module 2 on, you build **web APIs**: programs that answer requests with data instead of web pages. While you build one, you need to ask it questions and see exactly what it answers, again and again, after every change.

Your web browser can ask a web address for something, but only in one way: it can *get* a page. It can't send new data, change data or delete it, and it hides most of the answer. An **API client** is an app built for this job. You choose what kind of request to send, type the address, click **Send**, and see the whole answer. This course uses the API client **Insomnia**. It's free, and it works the same way on Windows and macOS. This lesson sets it up, once, so it's ready the first time a lesson asks you to send a request.

## Install Insomnia

| | Windows | macOS |
|---|---|---|
| **Insomnia** | `winget install -e --id Insomnia.Insomnia` | `brew install --cask insomnia` |

Type the Windows command in the **Terminal** app, as in *Setup: VS Code and Node.js*, and the macOS one in the **Terminal** app if you use Homebrew. Without Homebrew, or if you'd rather click through an installer, download Insomnia from [insomnia.rest/download](https://insomnia.rest/download).

Two parts of those commands matter:

- **`-e`** (Windows) means "match the id exactly". There is an unrelated app with a similar name that keeps your computer awake, and `Insomnia.Insomnia` is the API client.
- **`--cask`** (macOS) tells Homebrew this is an app with a window, which goes in your **Applications** folder, rather than a command-line tool.

The course was checked with Insomnia 13. Any recent version works; a button may sit in a slightly different place.

## Make your free account

Open **Insomnia** from the Start menu on Windows, or from your **Applications** folder on a Mac. The first screen asks you to sign in.

| On the first screen | Choose it? | Why |
|---|---|---|
| **Create an account**, with your email address or your GitHub account | Yes | The account is free, and it lets you keep your requests in a project. |
| **Use the local Scratch Pad** | No | The course keeps your requests in a project, so you can bring in the requests that come with each exercise. |
| A paid plan, if Insomnia offers one | No | The free account has everything the course uses. |

## Make a project that stays on your computer

A **project** holds your work in Insomnia. Where it keeps that work is up to you:

| Storage | Where your requests are kept |
|---|---|
| **Local Vault** | Only on your computer |
| Cloud Sync | On Insomnia's servers, so you can see them on other computers |
| Git Sync | In a Git repository |

Choose **Local Vault**. Requests you send to your own APIs never need to leave your computer.

1. In the left sidebar, click the **+** next to **Projects**.
2. Name the project `Node.js in Depth`, choose **Local Vault**, and click **Create**.

## Make a collection and send a request

A **collection** is a folder of saved requests, like a playlist: you build each request once, then click it and send it again whenever you want.

1. In your `Node.js in Depth` project, click **Create**, then **API Collection**. Name it `First requests`.
2. Click the **+** in the collection's sidebar, choose **HTTP Request**, and name it `Glossary categories`.
3. Leave the method, on the left of the address bar, set to **GET**.
4. In the address bar, type this address, then click **Send**:

```text
https://www.ask-codey.com/api/glossary/categories
```

This is a real web API: the one that runs this site's glossary. You just asked it for its list of categories.

## Read the answer

The answer appears on the right:

- **The status code**, at the top: `200 OK`, in green. It means the server found what you asked for. Module 2 teaches the other status codes, and your own APIs will send them.
- **How long it took** and **how big it was**, next to the status code.
- **The body**, under it: the data itself, written as **JSON**, a list in square brackets of categories in curly braces. The first one starts like this:

```text
{
  "name": "General",
  "slug": "general",
```

![Insomnia with the Glossary categories request on the left and the answer on the right: 200 OK in green at the top, then the list of categories as JSON](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/7630cd1aed4b43399283d5f166d25ee3.webp)

Insomnia saves the request as you go. There's no save button to remember.

## Check your work

Close Insomnia and open it again, then follow these steps. Each should match:

| Step | What you should see |
|---|---|
| Open your `Node.js in Depth` project and your `First requests` collection | `Glossary categories` is still there |
| Click it, then click **Send** | `200 OK` again, with the list of categories |

## If something goes wrong

| What you see | What to do |
|---|---|
| `Error: Couldn't resolve host name` | The address is mistyped, or you aren't connected to the internet. Check every letter of `www.ask-codey.com`. |
| `404 Not Found` | The server is fine, but nothing lives at that address. Check the part after `.com`: `/api/glossary/categories`. |
| The project has no **Local Vault** choice | You're working in the Scratch Pad. Sign in with your account first, then make the project. |
| Your requests are gone after you reopen Insomnia | You signed in with a different account, or worked in the Scratch Pad. Sign in with the account you made the project with. |
| macOS says Insomnia can't be opened | Open **System Settings > Privacy & Security**, scroll down, and click **Open Anyway** next to Insomnia. |

## Check yourself

2 questions to try on the lesson page.

## So what

Insomnia is ready before you need it. From Module 2 on, every API you build gets its own collection, and each exercise comes with one to bring in: you send a request, read what the API answers, and send it again after every change, until it answers exactly what you want.

## Key terms

- [API Client](https://www.ask-codey.com/glossary/api-client)
- [Postman and Insomnia](https://www.ask-codey.com/glossary/postman-and-insomnia)

## Cheat sheets

- [Setup: Insomnia](https://www.ask-codey.com/cheat-sheets/node-setup-insomnia-cheat-sheet)

Source: https://www.ask-codey.com/lessons/node-setup-insomnia
