Create an API Collection in Insomnia

Uses: Insomnia
TL;DR

In your Insomnia workspace, click Create > API Collection, enter a name, and click Create. To add an OpenAPI spec, click the Spec tab, then write your spec or click Use example OpenAPI Spec.

Prerequisites

Download and install Insomnia.

Create an API Collection

An API Collection holds your requests, folders, environments, and an optional OpenAPI spec.

  1. In your workspace, click Create.
  2. From the Create dropdown menu, select “API Collection”.
  3. In the Name field, enter Flights Service.
  4. Click Create.

Your new API Collection opens.

v13.3+ Documents and collections are merged into a single workspace type called an API Collection, so Create > Design document is no longer in the UI. Create an API Collection instead, then add your spec to it. For more details, see API Collections.

Add an OpenAPI spec

You can design an API in the same API Collection that you use to call it.

  1. On the API Collection screen, click the Spec tab.
  2. Click Use example OpenAPI Spec to populate the spec editor with the sample Swagger Petstore specification.

To write your own spec instead, enter it directly in the spec editor. To start from a spec you already have, see Import an API specification into an API Collection.

Validate

On the Spec tab, confirm that you can see the three panes of the spec editor:

  • On the left, an overview of the specification, with sections that you can expand. Click an element to highlight it in the specification.
  • In the middle, the specification itself, along with any warnings or errors.
  • On the right, a preview of the rendered specification.

To turn the spec into requests you can send, click Generate and select “Requests”. For more information, see Generate requests from an API spec.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!