Skip to content

Developer tools

Test the Qelka API in Insomnia

Import the Qelka OpenAPI document into an Insomnia API Collection, keep test and live keys as vault secrets, set Bearer auth once and test a request per check.

Updated 2026-11-26

This guide sets up Insomnia to explore and test the Qelka API: an API Collection generated from the OpenAPI document, test and live keys stored as encrypted secrets, Bearer auth set once for the whole collection, and a request with a test for each check. There is no Qelka plugin for Insomnia: everything comes from the public OpenAPI document at https://api.qelka.com/v1/openapi.json.

The document is OpenAPI 3.1, describes every endpoint under https://api.qelka.com/v1, and declares bearer authentication with your API key.

What you need

  • Insomnia 13.5 or later. Importing a spec into an API Collection arrived in 13.3 and the collection-level Auth tab in 13.5, according to Kong's documentation.
  • A Qelka test key and, when you are ready, a live key. A sk_test_ key returns simulated, fixed answers and never spends credits: see Test mode.
  • For the live environment, consider a restricted key with only the endpoints you test, plus account. See restricted keys.

Steps

1. Import the OpenAPI document

In your workspace, click Import, choose URL and paste:

https://api.qelka.com/v1/openapi.json

Click Scan, review the resources, then click Import. Insomnia creates an API Collection and puts the document in its Spec tab, where you can read the endpoints and their schemas.

2. Generate the requests

Open the Spec tab, click Generate and select "Requests". Insomnia adds a request for each endpoint, in folders named after the document's tags: one per product. The button appears only when the spec has no linting errors.

Test and live keys call the same base URL, https://api.qelka.com/v1. If the generated requests read it from a variable, which Insomnia's own example names base_url, set it once in the collection's base environment:

Base Environment
{
  "base_url": "https://api.qelka.com/v1"
}

3. Store the keys as secrets

Secrets need a vault key. Open Preferences at the bottom left of the sidebar, go to the General tab, scroll to Security and click Generate Vault Key. Keep the vault key safe: Insomnia does not store it, and resetting it deletes your secrets.

Then click Environments and create a global environment, for example "Qelka keys". Add a private sub-environment named "test" and, in it, a variable api_key with your sk_test_ key, its type set to Secret. Add a second private sub-environment, "live", with your live key. Secret variables are encrypted, masked on screen, not synced and not exported, and Insomnia exposes them under the vault namespace: this one is vault.api_key.

In your API Collection, select the global environment and its "test" sub-environment, so its secrets are available to the requests.

4. Set Bearer auth on the collection

Open the API Collection's Auth tab, select Bearer Token and set the token to:

{{ vault.api_key }}

Insomnia sends Authorization: Bearer followed by the key of the selected sub-environment. Set each request's authentication type to Inherit from parent. Generated requests may come with their own auth: a request's own type, even None, overrides the collection's, so switch them to inherit.

5. Send a request for each check

Open each generated request, set its body, and click Send. With a test key, the answers are fixed:

POST /email
{
  "email": "disposable@example.com",
  "mode": "fast"
}

The answer is risky with the reason disposable. mode: "fast" runs the syntax, DNS and list checks and skips the mailbox check, so it answers faster; use full to test the mailbox outcomes, such as undeliverable@example.com.

POST /phone
{
  "phone": "(415) 555-0123",
  "country": "US"
}

Phone numbers are parsed for real, even with a test key: e164 is +14155550123.

POST /ip
{
  "ip": "198.51.100.200"
}

This address is in a test range flagged as Tor, with a high risk level. Finally, send GET /account with no body: it is free, and key.mode tells you whether the selected key is test or live. Test mode lists every fixed input.

6. Add tests to the requests

Open a request, then Scripts and After-response. This script for POST /email logs API errors with the request id and checks the status:

After-response
const body = insomnia.response.json();
const requestId = insomnia.response.headers.find((header) => header.key.toLowerCase() === 'x-request-id');

if (body.error) {
  console.log(`${body.error.type}: ${body.error.message} (request ${requestId ? requestId.value : 'none'})`);
}

insomnia.test('returns no error', () => {
  insomnia.expect(body).to.not.have.property('error');
});

insomnia.test('returns a documented email status', () => {
  insomnia.expect(['deliverable', 'undeliverable', 'risky', 'unknown']).to.include(body.status);
});

For POST /phone, check ['valid', 'invalid', 'unknown'] instead. Send the request and open the Tests tab in the response pane to see the results.

To send them all, click the collection's name, choose Run Collection, select the requests in the Request Order tab and click Run. The Console tab shows each request and response.

Read the results

Endpoint status What to do in your app
POST /email deliverable Accept the address
POST /email undeliverable Reject it, and show did_you_mean when there is one
POST /email risky Disposable, catch-all or full mailbox: flag or review it
POST /email unknown Not conclusive: accept it and check again later
POST /phone valid Store e164
POST /phone invalid Ask for the number again
POST /phone unknown Send it again with country
POST /ip risk.level high Tor or VPN: add friction, such as a verification step

Each field is described in the email reference, the phone reference and the IP reference.

Handle errors and rate limits

Every error has the same body, { "error": { "type", "message", "docs" } }, and nothing is billed on errors.

HTTP status error.type In Insomnia, it usually means
401 invalid_api_key No global sub-environment selected, so vault.api_key is empty, or a revoked key
403 forbidden A restricted key calling an endpoint outside its list, or a test key on POST /bulk
400 invalid_request The body is not valid JSON, or a field is missing
422 unprocessable_input The value cannot be checked, such as a private IP address, which a test key refuses too
429 rate_limited Too many requests: wait the seconds in Retry-After

A key allows 200 requests per 10 seconds, and test keys count toward the same organization window as your live traffic. When you run the collection several times in a row, set a delay between iterations in the Collection Runner. See Errors and Rate limits.

Frequently asked questions

Where does Insomnia keep my API key?
With the setup below, in a secret variable of a private global sub-environment, encrypted with your vault key. Insomnia does not sync or export private sub-environments, and it does not store the vault key for you. If you lose the vault key and reset it, Insomnia deletes the stored secrets, so keep the API keys in your password manager too.
Why can't I set a variable's type to Secret in my collection environment?
Insomnia offers the Secret type only in private sub-environments of a global environment. In a collection environment, the closest option is a confidential variable, which hides the value on screen but stores and exports it in plain text. For an API key, the global private sub-environment is the safer place.
Can I run these requests in CI?
Inso CLI runs a collection with inso run collection, picks an environment with --env and overrides variables with --env-var. Secrets in private sub-environments stay on your machine, so a CI run needs its key passed another way. For automated checks, a code-based test such as the GitHub Actions recipe is usually simpler.

More in Developer tools

All integrations

Put this check in your product

Get an API key in under a minute. 100 free credits every month, no card required.

  • 100 free credits a month
  • No card
  • Test keys spend nothing
  • Cancel any time