---
title: "import expectations from a HAR or Postman collection, or re-import recorded traffic"
method: PUT
path: "/mockserver/import"
tags: ["import"]
---

# import expectations from a HAR or Postman collection, or re-import recorded traffic

`PUT /mockserver/import`

## Request

- Base URL: `http://localhost:1080`
- URL: `http://localhost:1080/mockserver/import`
- Auth: none declared

Converts an HTTP Archive (HAR) export or a Postman collection into MockServer expectations and adds them. The format is auto-detected from the document structure or can be forced with the format query parameter.

With format=recording this instead re-imports a persisted NDJSON archive of recorded request/response pairs (one per line) back into the event log, so they become retrievable like in-memory recordings. That mode creates log entries rather than expectations.

## Query parameters

- `format` 'har' | 'postman' | 'recording'
- `source` 'disk'
- `redactSensitiveData` boolean
- `additionalRedactedHeaders` string
- `additionalRedactedBodyFields` string
- `consolidate` boolean
- `parameterize` boolean

## Request body

- object: a HAR export or Postman collection JSON document

## Response `201`

expectations created from the imported document

- Expectation[]: list of upserted expectations (unresolved $ref)

## Other responses

- `400`: missing body, unsupported format, or unable to auto-detect the import format

---

[API](https://skmtc.dev/mock-server/apis/mockserver-api.md) · [All operations](https://skmtc.dev/mock-server/apis/mockserver-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mock-server/apis/mockserver-api/revisions/9239b693996e?raw)
