---
title: "register, remove or clear service-scoped HTTP chaos"
method: PUT
path: "/mockserver/serviceChaos"
tags: ["chaos"]
---

# register, remove or clear service-scoped HTTP chaos

`PUT /mockserver/serviceChaos`

## Request

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

Registers an HTTP chaos / fault-injection profile for a downstream host, removes a host's profile, or clears all service-scoped chaos. Supply a 'host' with a 'chaos' object to register, 'host' with 'remove':true (or no 'chaos') to remove a single host, or 'clear':true to clear all.

## Request body

- ServiceChaosRequest: service-scoped HTTP chaos registration, removal or clear instruction
  - `host` string: downstream host the chaos profile applies to (mutually exclusive with clear)
  - `chaos` object: HTTP chaos profile (fault types, probabilities, error status, etc.); omit (or set remove:true) to remove the host's profile
  - `remove` boolean: when true, removes the named host's chaos profile
  - `clear` boolean: when true, clears all service-scoped chaos (mutually exclusive with host)
  - `ttlMillis` integer: optional time-to-live in milliseconds after which the registration auto-reverts

## Response `200`

chaos registered, removed, patched or cleared

- object

## Other responses

- `400`: invalid request body or invalid chaos profile

---

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