Create mock rule
create_mock_ruleCreate a persistent mock rule that matches HTTP requests across the capture proxy and standalone mock server, returning the saved rule with its assigned ID.
Instructions
Create a mock rule. The rule fires for matching requests through both the capture proxy and the standalone mock server, and is persisted in the engine database. Returns the created rule with its assigned id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable rule name. | |
| method | Yes | HTTP method to match. Use "*" for any method. | |
| dynamic | No | Enable response_body templating. | |
| enabled | No | Whether the rule is active. Defaults to true. | |
| delay_ms | No | Artificial response delay in milliseconds. | |
| status_code | Yes | Response status code 100–599. | |
| url_pattern | Yes | Glob, regex, or literal path matched against the request URL. | |
| response_body | No | Response body verbatim. Use templating tokens like {{faker.name}} / {{uuid}} / {{now}} when dynamic=true. | |
| response_headers | No | Map of header name → value to attach to the mocked response. |