---
title: "create HTTP expectations from an AsyncAPI spec"
method: PUT
path: "/mockserver/asyncapi/http"
tags: ["expectation"]
---

# create HTTP expectations from an AsyncAPI spec

`PUT /mockserver/asyncapi/http`

## Request

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

Generates HTTP expectations from an AsyncAPI 2.x/3.x spec (JSON/YAML, or a {spec, channelPathPrefix} wrapper) so each channel's example message can be served over plain HTTP without a live broker. One GET expectation is created per channel returning that channel's schema-aware example payload. This is distinct from PUT /mockserver/asyncapi, which loads a spec into the broker-publishing mock. Requires the mockserver-async module on the classpath (501 otherwise).

## Request body

- object: AsyncAPI spec (JSON/YAML) or a {spec, channelPathPrefix} wrapper

## Response `201`

HTTP expectations created from the AsyncAPI spec

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

## Other responses

- `400`: missing or unparseable AsyncAPI spec
- `501`: the mockserver-async module is not on the classpath

---

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