Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion app/_landing_pages/insomnia/collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,23 @@ rows:
a: Yes, you can use the [`inso run collection`](/inso-cli/reference/run_collection/) command in Inso CLI to run a collection automatically.
- q: Can I set authentication headers at the collection level so I do not repeat them on every request?
a: |
No. As a workaround, group the relevant requests in a **folder** and then set authentication at the folder level for that group to avoid duplicating headers on each request.
No. As a workaround, group the relevant requests in a **folder** and then set authentication at the folder level for that group to avoid duplicating headers on each request.
- q: How do I export collection run results as JSON?
a: |
Use the Inso CLI to export collection run results. Metadata export does not include bodies or headers:

```sh
inso run collection "My Collection" --env "Base Environment" --output results.json
```

To export full request and response data, set a mode with `--includeFullData` and accept the security warning:

```sh
inso run collection "My Collection" \
--env "Base Environment" \
--includeFullData=redact \
--acceptRisk \
--output results.json
```

For details on supported modes, redaction, and truncation rules, go to the [export collection run results reference](/insomnia/export-collection-run-results/).
197 changes: 197 additions & 0 deletions app/insomnia/export-collection-run-results.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
---
title: Export collection run results to JSON
content_type: reference
layout: reference
description: Learn how the Inso CLI exports Insomnia collection run results as JSON, including metadata-only mode, full-data export, redaction, truncation, and JSON structure.

products:
- insomnia

tools:
- inso-cli

related_resources:
- text: Collections
url: /insomnia/collections/
- text: Inso CLI overview
url: /inso-cli/
- text: Inso CLI configuration
url: /inso-cli/configuration/
---

The Inso CLI exports JSON reports for Insomnia collection runs. JSON output follows a Postman-style structure and supports metadata-only and full-data export modes. Redaction and truncation ensure that sensitive information is protected.

Run the following command to export:

```
inso run collection <collection name> --env <environment> --output <file>
```

## Export modes

The Inso CLI supports two export modes.

{% table %}
columns:
- title: Mode
key: mode
- title: Description
key: description
rows:
- mode: Metadata only
description: "Exports identifiers, timings, status codes, and test results. Does not include headers, bodies, authentication fields, or environment data."
- mode: Full data
description: "Exports complete request and response information. Requires an includeFullData mode and an explicit acceptance flag for security."
{% endtable %}

### Metadata-only export

Metadata reports include:

- request identifiers
- timestamps
- response status codes
- execution timings
- test results

Example:

```
inso run collection "My Collection" \
--env "Base Environment" \
--output results.json
```

### Full data export

Full export includes:

- request headers
- authentication fields
- query parameters and request bodies
- response headers
- response bodies
- execution timings
- environment data (redacted or plaintext depending on mode)

To prevent accidental exposure of secure credentials, full export requires:

1. A data-exposure mode
2. Explicit risk acceptance

## Supported includeFullData values

{% table %}
columns:
- title: Value
key: value
- title: Behaviour
key: behaviour
rows:
- value: redact
behaviour: "Exports all fields but replaces sensitive values with `<Redacted by Insomnia>`."
- value: plaintext
behaviour: "Exports every field exactly as stored. Sensitive information is not redacted."
{% endtable %}

### Example: redact mode

```
inso run collection "My Collection" \
--env "Base Environment" \
--includeFullData=redact \
--acceptRisk \
--output results.json
```

### Example: plaintext mode

```
inso run collection "My Collection" \
--env "Base Environment" \
--includeFullData=plaintext \
--acceptRisk \
--output results.json
```

## Risk warning

If a full-data mode is set without `--acceptRisk`, Inso interrupts the operation and displays:

```
SECURITY WARNING
The output file may contain sensitive data like API tokens. Exposing this file is a security risk.
To continue, run again with --acceptRisk.
```

## Redaction behaviour

When using `includeFullData=redact`, Insomnia preserves keys but replaces sensitive values with:

```
<Redacted by Insomnia>
```

Sensitive fields include:

- cookies
- authorization headers
- bearer tokens
- API keys
- CSRF and XSRF tokens
- refresh tokens
- proxy authorization values

Redaction applies to request fields, response fields, and environment variables.

## Truncation rules

To prevent oversized output, Inso truncates large fields.

- Default limit: **4 KB**
- Applies to request and response bodies
- Truncated fields remain valid JSON and indicate truncation

Override the limit with `--maxDataSize` (bytes):

```
inso run collection "My Collection" \
--env "Base Environment" \
--includeFullData=redact \
--acceptRisk \
--maxDataSize 16384 \
--output results.json
```

## JSON structure

Exported run results follow this structure:

```
{
"timings": {},
"stats": {},
"collection": {},
"environment": {},
"executions": [
{
"request": {},
"response": {},
"tests": []
}
],
"proxy": {},
"error": null
}
```

## Validate exported results

Confirm the generated results file contains:

1. A `collection` object with metadata
2. An `environment` section (redacted or plaintext)
3. A populated `executions` array
4. Redacted values marked as `<Redacted by Insomnia>`
5. Truncated fields where expected
6. Full request and response data only when includeFullData is set
Loading