Update a rule (full replacement)
PUT/v2/endpoints/:endpoint/rules/:ruleId
Performs a complete replacement of an existing mock rule. All fields must be provided in the request body, as this is not a partial update.
How It Works:
- Full Replacement: The entire rule object is replaced with the new configuration
- ID Preservation: The rule ID remains unchanged (specified in the URL path)
- Position Preservation: The rule maintains its position in the execution order
- Validation: The new rule configuration is validated before replacement
Limitations:
- Cannot move the rule to a different position (use reorder endpoint)
- All validation rules apply (same as rule creation)
- Partial updates not supported (use PATCH for partial updates)
Use Cases:
- Update response templates based on external data
- Modify conditions to match new API contracts
- Change action types (e.g., mock → callout)
- Update weighted response probabilities
Response: Returns the updated rule with all fields.
Request
Responses
- 200
- 400
- 401
- 404
Rule updated
Bad Request - Payload validation failed.
Unauthenticated - API key is missing or invalid.
Not Found - The requested resource does not exist.