> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wiremock.io/llms.txt
> Use this file to discover all available pages before exploring further.

# WireMock request log - view, verify and find near misses

> View the requests a mock API received, find unmatched requests and near misses, verify requests via the API and reset the request log.

Every request made to a mock API is recorded in its request log (also called the request journal), along with the
response that was served and whether a stub matched it.
You can view the request log in the WireMock Cloud web UI, or query it through the [WireMock Cloud API](https://docs.wiremock.io/api-getting-started.md).

## Viewing requests

Open your mock API and go to the Request Log page, or press `Shift + r`.
The log lists the requests the mock API received, with each one's time, method, URL, response status, the stub that
matched it and any validation result. Use the search box under **Request filters** to narrow the list, and **Refresh**
to load new requests.

![The request log in the WireMock Cloud UI, with request filters and the Reset request log button](https://mintcdn.com/wiremockinc/ivaDeUgxQqRdejpR/images/screenshots/request-log.png?fit=max\&auto=format\&n=ivaDeUgxQqRdejpR\&q=85\&s=0e6fdef56db7ef7c6decf6c4a94dfa7e)

Select a request to see its details and the response that was served.

Some features add their own events to a logged request:

* [Webhooks](https://docs.wiremock.io/webhooks.md#observing-webhooks) log the outbound webhook request and its response
* [OpenAPI validation](https://docs.wiremock.io/openAPI/openapi-validation.md) and [GraphQL validation](https://docs.wiremock.io/graphql/overview.md) log validation errors
* the [Expression matcher](https://docs.wiremock.io/request-matching/expression-matcher.md#debugging) logs template output you can use for debugging

For [GraphQL](https://docs.wiremock.io/graphql/overview.md#converting-request-logs-to-stubs) mock APIs, you can also turn a logged request into a
new stub with the `Convert to stub` button.

## Finding unmatched requests and near misses

When no stub matches a request, WireMock Cloud returns a `404` response (unless you've set up a
[default response](https://docs.wiremock.io/default-responses.md)). The response body compares the request against the closest stub - the near
miss - and marks the parts that didn't match:

```
                            Request was not matched
                            =======================

-------------------------------------------------------------------------------
| Closest stub                         | Request                              |
-------------------------------------------------------------------------------
                                       |
POST                                   | POST
/json                                  | /json
                                       |
{                                      | {                               <<<<< Body does not match
  "itemId" : 102938,                   |   "itemId" : 102938,
  "sizes" : [ "S", "M", "L" ]          |   "sizes" : [ "L", "M", "S" ]
}                                      | }
                                       |
-------------------------------------------------------------------------------
```

In the request log, an unmatched request has no matched stub. To list only unmatched requests through the API, call
[Find unmatched requests](https://docs.wiremock.io/api-reference/requests/find-unmatched-requests.md):

```bash theme={null}
curl -H 'Authorization: Token <api-key>' \
  https://api.wiremock.cloud/v1/mock-apis/<mock-api-id>/requests/unmatched
```

Each mock API's [admin API](https://docs.wiremock.io/api-getting-started.md#wiremock-admin-api) also supports WireMock's near-miss
endpoints. `GET /__admin/requests/unmatched/near-misses` returns each unmatched request with the stubs that came
closest to matching it:

```bash theme={null}
curl -H 'Authorization: Token <api-key>' \
  https://<your-subdomain>.wiremockapi.cloud/__admin/requests/unmatched/near-misses
```

See [Request matching](https://docs.wiremock.io/request-matching/matcher-types.md) for how each part of a request is matched.

## Verifying requests via the API

To check from a test that your app made the requests you expected, use the request log endpoints.
They take a request pattern in the same format as a stub's `request` section.

[Count requests by criteria](https://docs.wiremock.io/api-reference/requests/count-requests-by-criteria.md) returns how many logged requests match:

```bash theme={null}
curl -X POST -H 'Authorization: Token <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{ "method": "POST", "url": "/todo-items" }' \
  https://api.wiremock.cloud/v1/mock-apis/<mock-api-id>/requests/count
```

```json theme={null}
{ "count": 1 }
```

[Find requests by criteria](https://docs.wiremock.io/api-reference/requests/find-requests-by-criteria.md) takes the same pattern and returns the
matching requests in full. [Get all requests in journal](https://docs.wiremock.io/api-reference/requests/get-all-requests-in-journal.md) returns
every logged request.

For an example of verifying requests from Java tests, see [Automated testing with Java](https://docs.wiremock.io/samples/automated-testing-with-java.md).

## Resetting the request log

To clear a mock API's request log in the web UI, click **Reset request log** on the Request Log page.

To clear it from a test or script, for example between test runs, call
[Empty the request journal](https://docs.wiremock.io/api-reference/requests/empty-the-request-journal.md):

```bash theme={null}
curl -X POST -H 'Authorization: Token <api-key>' \
  https://api.wiremock.cloud/v1/mock-apis/<mock-api-id>/requests/reset
```

You can also remove only the requests that match a pattern with
[Remove requests by criteria](https://docs.wiremock.io/api-reference/requests/remove-requests-by-criteria.md).
AI coding agents can do the same with the `reset_request_journal` [MCP tool](https://docs.wiremock.io/ai-mcp/mcp-tools.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.