---
title: "export active expectations as a Pact contract"
method: PUT
path: "/mockserver/pact"
tags: ["pact"]
---

# export active expectations as a Pact contract

`PUT /mockserver/pact`

## Request

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

Exports the current active expectations as a Pact consumer-driven contract (JSON). The optional 'consumer' and 'provider' query parameters set the contract's consumer and provider names.

## Query parameters

- `consumer` string
- `provider` string

## Response `200`

Pact contract exported

- object: Pact consumer-driven contract document

## Other responses

- `400`: failed to export the Pact contract

---

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