# Rules API broken?

**URL:** <https://community.smartthings.com/t/rules-api-broken/282447>\
**Category:** Rules API\
**Created:** [May 27, 2024, 1:38pm UTC](https://community.smartthings.com/t/rules-api-broken/282447 "2024-05-27T13:38:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![PWBarrett](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@PWBarrett](https://community.smartthings.com/u/PWBarrett)\
**Post date:** [May 27, 2024, 1:38pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/1 "2024-05-27T13:38:54Z")

</div>

What worked for me a few weeks ago now returns a 403 forbidden error.  
All l want to do is execute a pre-existing rule. But even a GET to list my rules returns this error. I can still see them on the web. The devices API still works.

Has this API been changed or removed? If changed, is there new documentation somewhere?

---

<div class="post-metadata">

**Author:** ![orangebucket](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/orangebucket/32/81590_2.png) [@orangebucket](https://community.smartthings.com/u/orangebucket)\
**Post date:** [May 27, 2024, 2:49pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/2 "2024-05-27T14:49:17Z")

</div>

> [@PWBarrett](#):
>
> What worked for me a few weeks ago now returns a 403 forbidden error.  
> All l want to do is execute a pre-existing rule. But even a GET to list my rules returns this error. I can still see them on the web. The devices API still works.
> 
> Has this API been changed or removed? If changed, is there new documentation somewhere?

Usually I am all over the API but that hasn’t been the case for the last couple of weeks. I was aware that the ability to enable and disable Rules had returned to the public API but I hadn’t noticed other changes.

I am just looking now and I can immediately see that something has definitely changed. For a long time now it was the case that the CLI, when using the default authentication flow, would only show Rules it created itself. Now it shows all the other Rules created by user tokens in the Location. Similarly using the API with a PAT now shows the Rules created using the CLI’s token.

This is actually a reversion to the behaviour it always used to have.

I’ve not seen any permissions errors yet.

---

<div class="post-metadata">

**Author:** ![PWBarrett](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@PWBarrett](https://community.smartthings.com/u/PWBarrett)\
**Post date:** [May 27, 2024, 3:24pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/3 "2024-05-27T15:24:03Z")

</div>

I’ve always used a PAT. I tried generating a new one with all access, and get the same result - works with devices, 403 with rules. I’ve never tried CLI access - I’ll go try that and see if that sheds any light on things.

---

<div class="post-metadata">

**Author:** ![nayelyz](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nayelyz](https://community.smartthings.com/u/nayelyz)\
**Post date:** [May 27, 2024, 4:22pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/4 "2024-05-27T16:22:37Z")

</div>

Hi, @PWBarrett  
Can you share more details about the request you’re trying to execute? For example, the URL.  
About executing the pre-existing Rule, I’d like to see it’s config, could you provide support access to your account and share the name of the Rule with me so I can check it out, please?

1. Confirm the email account registered in the forum is the same one you use for SmartThings. If not, please share it with me over DM
2. Enable support access to your account:

> 1. Go to the SmartThings Web ([my.smartthings.com](https://my.smartthings.com/))
> 2. Log in to your Samsung Account
> 3. Select Menu (⋮) and choose Settings
> 4. Toggle on Account Data Access
> 5. Select the time period and confirm - In this step, please select “Until turned off”, once the team finishes, we’ll let you know so you can disable it again.

---

<div class="post-metadata">

**Author:** ![PWBarrett](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@PWBarrett](https://community.smartthings.com/u/PWBarrett)\
**Post date:** [May 27, 2024, 6:13pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/5 "2024-05-27T18:13:09Z")

</div>

I’ve enabled support access on my account.

Here is one of the rules that previously worked from Postman (plus PAT authorization):  
POST [https://api.smartthings.com/v1/rules/execute/fec885d4-8d2b-4394-8329-83db7e580b21?locationId=d30fdc24-9c54-4249-8e85-80bd5e2ec835](https://api.smartthings.com/v1/rules/execute/fec885d4-8d2b-4394-8329-83db7e580b21?locationId=d30fdc24-9c54-4249-8e85-80bd5e2ec835)

When I try GET [https://api.smartthings.com/v1/rules?locationId=d30fdc24-9c54-4249-8e85-80bd5e2ec835](https://api.smartthings.com/v1/rules?locationId=d30fdc24-9c54-4249-8e85-80bd5e2ec835)  
I get OK but an empty list.

---

<div class="post-metadata">

**Author:** ![nayelyz](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nayelyz](https://community.smartthings.com/u/nayelyz)\
**Post date:** [May 27, 2024, 6:29pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/6 "2024-05-27T18:29:19Z")

</div>

> [@PWBarrett](#):
>
> I’ve enabled support access on my account.

Thanks for the reply, @PWBarrett . I tried the email registered here in the forum and I got an error saying we don’t have access. Could you check if you enabled it correctly or if the email here is the same as in your ST app, please?

---

<div class="post-metadata">

**Author:** ![bthrock](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bthrock/32/64619_2.png) [@bthrock](https://community.smartthings.com/u/bthrock)\
**Post date:** [May 27, 2024, 7:32pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/7 "2024-05-27T19:32:26Z")

</div>

> [@orangebucket](#):
>
> For a long time now it was the case that the CLI, when using the default authentication flow, would only show Rules it created itself. Now it shows all the other Rules created by user tokens in the Location

Nice! This is a good reversion and very useful.

FWIW, I am not having any issues with a GET request for a list of my rules.

---

<div class="post-metadata">

**Author:** ![nayelyz](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nayelyz](https://community.smartthings.com/u/nayelyz)\
**Post date:** [May 27, 2024, 7:34pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/8 "2024-05-27T19:34:47Z")

</div>

Hi, @PWBarrett  
I also see the empty response from the Rules API endpoint but it’s because you haven’t created any Rule using the API directly. The ones in your account are Routines (Rules created in the app), I’m checking with the engineering team if those can be reached using the public API, once I get more details, I’ll let you know.

---

<div class="post-metadata">

**Author:** ![nayelyz](https://avatars.discourse-cdn.com/v4/letter/n/59ef9b/32.png) [@nayelyz](https://community.smartthings.com/u/nayelyz)\
**Post date:** [May 29, 2024, 10:44pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/9 "2024-05-29T22:44:05Z")

</div>

Hi, @PWBarrett

The engineering team mentioned that the previous ability to execute Routines using the public API was a bug, which they fixed. So this is why you saw it working before, but now this is the expected behavior, only Rules created using the [public API](https://developer.smartthings.com/docs/api/public/#tag/Rules/operation/createRule) (`https://api.smartthings.com/v1/rules`) can be executed with the `rules/execute` endpoint.

---

<div class="post-metadata">

**Author:** ![PWBarrett](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@PWBarrett](https://community.smartthings.com/u/PWBarrett)\
**Post date:** [May 30, 2024, 2:49am UTC](https://community.smartthings.com/t/rules-api-broken/282447/10 "2024-05-30T02:49:37Z")

</div>

Ok, I can go create a rule on the web, get its json, paste it into a web transaction to create a duplicate API version, and repeat this every time I need to tweak it. Very tedious, and puzzling why this distinction exists.  
Are “routines” vs. rules documented anywhere? Because I never saw anything about that.

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [May 30, 2024, 4:41am UTC](https://community.smartthings.com/t/rules-api-broken/282447/11 "2024-05-30T04:41:29Z")

</div>

Routines are created using “create a routine” within the SmartThings app.

“Rules” were originally called “recipes,” although that terminology never really seem to catch on.

There’s a good technical discussion of the available documentation and the differences between the two in the following thread:

[Rules vs Routines](https://community.smartthings.com/t/rules-vs-routines/256638/)

---

<div class="post-metadata">

**Author:** ![rjaycc](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/rjaycc/32/203437_2.png) [@rjaycc](https://community.smartthings.com/u/rjaycc)\
**Post date:** [September 24, 2024, 2:37pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/12 "2024-09-24T14:37:00Z")

</div>

**Rules shows 403 Forbidden Error**

Same problem encountered today when accessing the rules endpoint using my PAT token:

[https://api.smartthings.com/v1/rules](https://api.smartthings.com/v1/rules)

Despite  
✔ Having a valid token  
✔ Having enough permissions (I checked all the checkboxes on permissions regarding rules)

and it works on:  
[https://api.smartthings.com/v1/devices](https://api.smartthings.com/v1/devices)

Is the Rules endpoint broken?

---

<div class="post-metadata">

**Author:** ![orangebucket](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/orangebucket/32/81590_2.png) [@orangebucket](https://community.smartthings.com/u/orangebucket)\
**Post date:** [September 24, 2024, 3:01pm UTC](https://community.smartthings.com/t/rules-api-broken/282447/13 "2024-09-24T15:01:08Z")

</div>

> [@rjaycc](#):
>
> Same problem encountered today when accessing the rules endpoint using my PAT token:
> 
> [https://api.smartthings.com/v1/rules](https://api.smartthings.com/v1/rules)

Yes, that would indeed return a 403. Listing rules requires a _locationId_ filter. So add the query string `?locationId=<locationId>` where `<locationId>` is the UUID of the SmartThings Location you are interested in (`https://api.smartthings.com/locations`).
