update_mock
Update an existing mock API endpoint. Replaces all fields including rules. IMPORTANT: When updating rules, you MUST provide the full updated rules array — partial updates are not supported. Use get_mock_detail first to read the current state before modifying. This also supports adding/removing stateful simulation fields (stateLookupExpr, stateCaptureExpr, stateCaptureVariables).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Descriptive name of the mock endpoint | |
| path | Yes | HTTP resource path, e.g. /v1/users/{id} | |
| tags | No | Tags for categorization and search | |
| rules | No | Full replacement rules array for this mock. Rules are evaluated in ascending priority order. First match wins. Providing an empty array [] removes all rules and returns only the default response. | |
| method | Yes | HTTP method (GET, POST, PUT, DELETE, PATCH, etc.) | |
| mockId | Yes | Database ID of the mock endpoint to update | |
| delayMs | No | Default latency delay in milliseconds | |
| projectId | Yes | Database ID of the project | |
| webhookUrl | No | Optional outbound webhook URL to call after each request. LOCAL RELAY OPTION: If developing locally, instead of a public URL, you can use the 'simceptor://local/<path>' scheme (e.g. 'simceptor://local/api/payment/callback') to route webhook payloads through an active Local Relay WebSocket tunnel to your local server. ALWAYS call 'check_relay_status' first to verify if a relay session is active. | |
| description | No | Optional description visible in the dashboard UI | |
| soapEnabled | No | Set to true to enable SOAP / WSDL mode for this mock. Auto-detected if responseHeaders contains 'xml' or responseBody starts with '<'. | |
| wsdlContent | No | Optional raw WSDL XML content definition for SOAP service discovery (?wsdl). | |
| collectionId | No | Optional collection folder ID to move this mock to | |
| responseBody | No | Default response body (fallback when no rule matches). Supports dynamic expressions. IMPORTANT: For JSON responses, do NOT include raw newline characters (\n) in the JSON payload as it will make the JSON structure malformed. NOTE: the tool response includes a `responseBodyWarning` field if this doesn't look like valid JSON structurally. | |
| webhookMethod | No | HTTP method for the webhook. Default: POST. | |
| collectionName | No | Optional collection folder name to assign or move this mock to | |
| responseStatus | No | Default HTTP status code (fallback when no rule matches) | |
| webhookDelayMs | No | Milliseconds to wait before firing the webhook. | |
| webhookHeaders | No | JSON string of headers for the webhook request. | |
| webhookPayload | No | Webhook request body. Supports dynamic expressions. | |
| responseHeaders | No | Default response headers as JSON string | |
| stateLookupExpr | No | Expression to load session state before evaluating rules. E.g. 'request.body.user_id' | |
| stateCaptureExpr | No | Expression to determine the key for saving session state after this request. E.g. 'request.body.id' | |
| stateCaptureVariables | No | JSON object mapping variable names to expressions for saving into state. E.g. '{"balance":"request.body.amount"}'. Values not starting with request./response./body./query./header./path./state./item./random./faker. are stored as literal strings as-is. |