Skip to content
Michelle Staley edited this page Jan 18, 2023 · 4 revisions

The Rules API enables the developer to create automations, both simple and complex, that can operate on the SmartThings cloud. In a future release of the API, local execution of rules on the SmartThings hub will be supported, making rules a great choice for those looking to create fast, stable and secure automations.

Using the Rules API the developer can create automations such as:

  • Turning on all your lights when your door opens

  • Turning off all your lights at a certain time of day

  • Changing your location mode to away when all presence detection devices are not present.

Functions

Note: The list of functions can be found here.

  • list - List the rules for a location and the access token principal. The principal is the user in the case of a Personal Access Token (PAT) or the installed app in the case of a SmartApp token. The rules belonging to one principal cannot see the rules belonging to another principal. Requires the location UUID for the location. If the client is configured with a location ID this parameter can be omitted.

  • get - Get a specific rule. Requires the UUID of the rule and the UUID for the location. If the client is configured with a location ID this parameter can be omitted.

  • delete - Delete a specific rule. Requires the UUID of the rule and the UUID for the location. If the client is configured with a location ID this parameter can be omitted.

  • create - Create a new rule. Requires data for the rule definition and the UUID for the location. If the client is configured with a location ID this parameter can be omitted.

  • update - Update a rule. Requires the UUID of the rule, data for the rule definition, and the UUID for the location. If the client is configured with a location ID this parameter can be omitted.

  • execute - Execute a rule's action. Requires the UUID of the rule and the UUID for the location. If the client is configured with a location ID this parameter can be omitted.

Clone this wiki locally