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).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectId": "<projectId>",
"mockId": "<mockId>",
"name": "<name>",
"method": "<method>",
"path": "<path>"
},
"name": "update_mock"
}
}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 all dynamic expressions: {{path.<var>}}, {{query.<param>}}, {{header.<Name>}}, {{body.<jsonPath>}}, {{form.<field>}} (with ':default' fallback), {{random.uuid}} / {{random_uuid}}, {{random.number:<len>}}, {{random.alphabet:<len>}}, {{random.alphanumeric:<len>}}, {{random.date:<format>:<offset>}}, {{faker.name_id}}, {{faker.email}}, {{faker.phone_id}}, {{faker.company}}, {{faker.city}}, {{faker.address}}, {{faker.jobtitle}}, {{faker.car}}, {{faker.price:<min>:<max>}}, {{state.<field>}}, {{env.<KEY>:<default>}}, and '__repeat' array loops. IMPORTANT: For JSON responses, enclose all {{...}} placeholders in double quotes and do NOT include raw newline characters (\n) in the JSON payload. 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. |