# Rules Use rules to automate. In the Rebilly rules engine, an action is an operation that executes when an event occurs. Action and event conditions are defined in rules. Rulesets are collections of rules that are associated with an event. The order in which the rules are placed within a ruleset specifies the execution order. For a list of events and related actions, see [Events](https://www.rebilly.com/docs/automations/event-types/). ## Retrieve system events - [GET /events](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/geteventcollection.md): Retrieves a list of system events. ## Retrieve event information - [GET /events/{eventType}](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/getevent.md): Retrieves event information for a specified event type. ## Retrieve event rules - [GET /events/{eventType}/rules](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/geteventrulecollection.md): Retrieves rules associated with a specified event type. ## Update event rules - [PUT /events/{eventType}/rules](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/puteventrule.md): Updates rules associated with a specified event type. ## Retrieve change history of a ruleset - [GET /events/{eventType}/rules/history](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/geteventrulehistorycollection.md): Retrieves the change history of a ruleset with a specified event type. All ruleset changes are recorded in the change history. ## Retrieve change history record of a ruleset - [GET /events/{eventType}/rules/history/{version}](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/geteventrulehistory.md): Retrieves the change history record of a ruleset with a specified event type. A history record is created each time rules are changed. ## Retrieve a version of a ruleset - [GET /events/{eventType}/rules/versions/{version}](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/geteventruleversion.md): Retrieves a version of a ruleset with a specified event type. A new version is created each time you change a rule. ## Retrieve draft rulesets - [GET /events/{eventType}/rules/drafts](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/geteventrulesetdraftcollection.md): Retrieves a list of draft rulesets for a specified event type. The result are sorted by updated time in descending order. ## Create a draft ruleset - [POST /events/{eventType}/rules/drafts](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/posteventrulesetdraft.md): Creates a draft ruleset for a specified event type. ## Retrieve a draft ruleset - [GET /events/{eventType}/rules/drafts/{id}](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/geteventrulesetdraft.md): Retrieves a draft ruleset with a specified ID and event type. ## Delete a draft ruleset - [DELETE /events/{eventType}/rules/drafts/{id}](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/deleteeventrulesetdraft.md): Deletes a draft ruleset with a specified ID and event type. ## Update a draft ruleset - [PUT /events/{eventType}/rules/drafts/{id}](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/puteventrulesetdraft.md): Updates a draft ruleset for a specified event type. ## Send a test email - [POST /previews/rule-actions/send-email](https://www.rebilly.com/static/_spec/catalog/all-3.0/rules/postpreviewruleactionemailsending.md): Sends a test email.