Skip to main content

Delete a rule

DELETE 

/v2/endpoints/:endpoint/rules/:ruleId

Permanently deletes a specific mock rule by its unique identifier. This operation cannot be undone.

Purpose:

  • Clean up unused mock configurations
  • Programmatically manage rule lifecycle

How It Works:

  1. Rule Removal: The rule is removed from the endpoint's rule array
  2. Order Adjustment: Remaining rules maintain their relative order
  3. Priority Shift: Rules below the deleted rule move up in priority
  4. Real-time Updates: Connected dashboard clients are notified.

Limitations:

  • Operation is irreversible.
  • Deleted rules cannot be recovered unless backed up externally
  • Does not affect other endpoint settings or rules

Best Practices:

  • Backup the rule before deletion (use GET /rules/{ruleId})
  • Consider disabling the rule first to test impact before permanent deletion
  • Verify the rule ID before executing this operation
  • Review remaining rules to ensure correct execution order after deletion

Use Cases:

  • Remove temporary test rules after testing
  • Clean up rules after API contract changes
  • Delete duplicate or conflicting rules
  • Programmatic rule lifecycle management in CI/CD pipelines

Response: Returns the deleted rule ID and a success flag.

Request

Responses

Rule deleted