---
title: "validate recorded traffic against an OpenAPI specification"
method: PUT
path: "/mockserver/trafficValidate"
tags: ["troubleshooting"]
---

# validate recorded traffic against an OpenAPI specification

`PUT /mockserver/trafficValidate`

## Request

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

Validates the request/response pairs already recorded in the event log against an OpenAPI specification, and reports per-exchange which operation it matched and any request or response violations. Supply the spec as a URL, file path or inline JSON/YAML under "spec" (or its alias "specUrlOrPayload"). A spec fetched by URL is subject to the SSRF policy (forwardProxyBlockPrivateNetworks). The traffic validated comes from the recorded event log, not from the request body.

## Request body

- object
  - `spec` string: OpenAPI spec as a URL, file path or inline JSON/YAML
  - `specUrlOrPayload` string: accepted alias for "spec"

## Response `200`

validation completed (inspect allPassed and the per-request results)

- object
  - `totalRequests` integer
  - `passed` integer
  - `failed` integer
  - `allPassed` boolean
  - `results` object[]
    - `method` string
    - `path` string
    - `matchedOperation` string
    - `passed` boolean
    - `requestErrors` string[]
    - `responseErrors` string[]

## Other responses

- `400`: missing body, no recognised spec, or an error running the validation
- `403`: spec fetch blocked by SSRF policy (target is a private/loopback/metadata address)
- `503`: validation could not be scheduled (server shutting down)

---

[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)
