Update a rule (partial)
PATCH/v2/endpoints/:endpoint/rules/:ruleId
Performs a partial update of an existing mock rule. Only the fields provided in the request body are modified; all other fields remain unchanged.
Purpose:
- Update specific rule fields without affecting others
- Toggle rule enabled/disabled status
- Modify individual conditions or actions
- Update rule descriptions
How It Works:
- Partial Update: Only specified fields are updated
- Field Merging: Provided fields overwrite existing values; omitted fields remain unchanged
- ID Preservation: The rule ID cannot be changed
- Position Preservation: The rule maintains its position in the execution order
- Validation: Updated fields are validated before applying changes
Supported Partial Updates:
enabled: Toggle rule on/off without changing conditions or actionsdescription: Update the human-readable labelmethod: Change the HTTP method filterconditions: Replace the entire conditions arrayaction: Replace the entire action object
Important Notes:
- Complex fields like
conditionsandactionare replaced entirely (not merged) - To update a single condition, you must provide the complete
conditionsarray - To update action properties, you must provide the complete
actionobject - Partial updates within nested objects are not supported
Common Use Cases:
Example 1: Toggle Rule Status
{
"enabled": false
}
Disables the rule without modifying conditions or actions.
Example 2: Update Description
{
"description": "Updated rule description"
}
Changes only the rule's label.
Example 3: Change HTTP Method
{
"method": "POST"
}
Updates the method filter while preserving conditions and actions.
Limitations:
- Cannot move the rule to a different position
- Nested object merging not supported (entire objects must be replaced)
- All validation rules apply to updated fields
Response: Returns the complete updated rule with all fields (including unchanged ones).
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.