The SmartThings platform isn’t really designed for “programmatically interacting“. Most people will only use the built-in rules engine in the SmartThings app, which is very simple, or use one of several third-party options. The most popular is probably the third-party app, SharpTools, which has a really nice visual interface, but probably isn’t what you’re looking for either.
But if you want to really do your own programming, the official assumption is that you know how to write programs and you’re going to write in whatever language you want to write in and then you will subscribe to events on your SmartThings account and send requests using the regular published REST API. so those are called “endpoint Smartapps“ because they are connecting to endpoint in the SmartThings cloud.
That works OK, but it’s not really well documented, and it’s fairly fragile because it’s going through the cloud. It just hasn’t been very popular.
The main thing to understand is that we as customers are not allowed to run custom code on our own SmartThings hub, and there is no longer a free cloud service provided to customers like there was before 2023. So if you want to do your own programming, You have to also do your own hosting, either in a cloud or on your own server box. It’s not what most people are expecting if they come into SmartThings with a programming background, but it is what it is. The platform just isn’t designed to let you do your own programming within the confines of that platform.
Instead, most people with a strong programming background communicate either through MQTT (in which case it’s like any other MQTT project) or something like node red using a local server, they set up themselves.
I’m going to take a leap here and guess that you might be happiest with a node red set up. So here’s a project report from one community member on what they did. Take a look at that and see if it would be of interest.
Unleash the Power of SmartThings with Advanced Automations Using Node-Red
If you’d rather go to the MQTT route, here’s the discussion on that:
Integration Solutions using MQTT
Or you can write your own endpoint app anywhere you want to, host it yourself, and connect through the rest API.
Here’s the documentation on that, but it’s incomplete and some parts may be out of date. Like I said, it’s just not a very popular approach these days.