add_mock_rule
Add a routing rule to a mock endpoint by setting method, path, status code, body, and headers. Rules are matched by priority; deploy to publish.
Instructions
Append a routing rule to a mock endpoint. Rules are matched in priority order; the first match wins. After adding rules, call deploy_mock to publish them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpointId | Yes | The mock endpoint ID (from list_mock_endpoints / create_mock_endpoint) | |
| method | Yes | HTTP method to match. Use "*" to match any method. | |
| path | Yes | Path to match (e.g. "/users", "/api/v1/*"). Use "*" to match any path. | |
| statusCode | Yes | HTTP status code to return (100–599) | |
| body | No | Response body (string; for JSON, pass a serialized JSON string) | |
| headers | No | Response headers as a flat object (e.g. {"Content-Type": "application/json"}) | |
| priority | No | Higher priority rules are evaluated first (default 0) |