---
title: "Set or clear the OpenAPI spec URL used for contract testing"
method: PATCH
path: "/api/v1/endpoints/{endpoint_id}/openapi-spec"
tags: ["endpoints"]
---

# Set or clear the OpenAPI spec URL used for contract testing

`PATCH /api/v1/endpoints/{endpoint_id}/openapi-spec`

## Request

- Base URL: `https://monit.rs`
- URL: `https://monit.rs/api/v1/endpoints/{endpoint_id}/openapi-spec`
- Auth: HTTP bearer

`spec_url` is a query parameter, not a request body. Send an empty value to clear it. The URL is fetched immediately and rejected if it resolves to a private or internal address.

## Path parameters

- `endpoint_id` string, uuid, required

## Query parameters

- `spec_url` string, required

## Response `200`

Spec URL updated.

## Other responses

- `400`: Spec URL resolves to a private or internal IP address.
- `404`: Endpoint not found.
- `502`: Failed to fetch the OpenAPI spec.

---

[API](https://skmtc.dev/monit/apis/monit-rs-public-api.md) · [All operations](https://skmtc.dev/monit/apis/monit-rs-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/monit/apis/monit-rs-public-api/revisions/7e1923981112?raw)
