Skip to main content

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:

  1. Full Replacement: The entire rule object is replaced with the new configuration
  2. ID Preservation: The rule ID remains unchanged (specified in the URL path)
  3. Position Preservation: The rule maintains its position in the execution order
  4. 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

Rule updated