Some basic questions regarding the API

Hi, I wanted to look into controlling the touchbar from a web extension (in firefox / chrome), by using a websockets bridge that the extensions connects to, which then calls the Btt API (either with the url scheme or by sending requests to the webserver) - however after reading through the docs and also taking a look at the btt.js wrapper I still have some basic questions regarding how to use the API, hopefully someone can help:

So I understand how to create a touchbar button / widget using the api by calling add_new_trigger, however that trigger gets added to 'All Apps', which is almost never what I would want (adding a global button), I would like to create an activation group using the api and then add triggers to it, or at least add triggers to an existing activation group, is there a way to do this using the API?

I'm also having some general trouble understanding how one would properly manage these touchbar triggers programmatically, so e.g. if I want to display all browser tabs on the touchbar as buttons to allow switching, I would have to create a trigger for each tab and then keep track of all the trigger uuids in my program in in order to update the button state or remove a button if it's no longer relevant? But then if my program doesn't properly clean up and remove all the buttons for some reason wouldn't they just stay around and have to be manually removed? Is there some way to assign all buttons to a 'parent' or something like that and then delete that parent in order to ensure a clean reset?

Any help would be appreciated :sunny:

Okay actually now I'm just trying to update existing touchbar widgets and I can't get it working, for instance I have this button

[
  {
    "BTTTouchBarButtonName" : "Dev Tools",
    "BTTTriggerType" : 629,
    "BTTTriggerTypeDescription" : "Touch Bar button",
    "BTTTriggerClass" : "BTTTriggerTypeTouchBar",
    "BTTPredefinedActionType" : -1,
    "BTTPredefinedActionName" : "No Action",
    "BTTLayoutIndependentActionChar" : "i",
    "BTTAutoAdaptActionToKeyboardLayout" : true,
    "BTTShortcutToSend" : "58,55,34",
    "BTTEnabled2" : 1,
    "BTTRepeatDelay" : 0,
    "BTTUUID" : "AC1775BF-3237-4D6A-8CF7-A7CE3EA2D259",
    "BTTNotesInsteadOfDescription" : 0,
    "BTTEnabled" : 1,
    "BTTModifierMode" : 0,
    "BTTOrder" : 2,
    "BTTDisplayOrder" : 0,
    "BTTMergeIntoTouchBarGroups" : 0,
    "BTTIconData" : "(removed this to make post shorter)",
    "BTTTriggerConfig" : {
      "BTTTouchBarButtonColor" : "75.323769, 75.323769, 75.323769, 255.000000",
      "BTTTouchBarItemIconWidth" : 22,
      "BTTTouchBarButtonTextAlignment" : 0,
      "BTTTouchBarButtonFontSize" : 15,
      "BTTTouchBarAlternateBackgroundColor" : "75.323769, 75.323769, 75.323769, 255.000000",
      "BTTTouchBarItemPlacement" : 2,
      "BTTTouchBarAlwaysShowButton" : false,
      "BTTTBWidgetWidth" : 400,
      "BTTTouchBarIconTextOffset" : 5,
      "BTTTouchBarButtonWidth" : 70,
      "BTTTouchBarOnlyShowIcon" : true,
      "BTTTouchBarFreeSpaceAfterButton" : 5,
      "BTTTouchBarButtonName" : "Dev Tools",
      "BTTTouchBarItemIconHeight" : 22,
      "BTTTouchBarItemPadding" : 0,
      "BTTTouchBarButtonUseFixedWidth" : 1
    }
  }
]

Now I'm trying to use the webserver to update it like this
http://127.0.0.1:64472/update_touch_bar_widget/?shared_secret=lnuGbV17DamXn0UqGZLe4NAyiLnsn2Xydh3c3U7uSjf69YkFLTHFu52CEfSQ5Fc8&uuid=AC1775BF-3237-4D6A-8CF7-A7CE3EA2D259&text=test&background_color=200,200,100,255

Or also like this
http://127.0.0.1:64472/update_trigger/?uuid=AC1775BF-3237-4D6A-8CF7-A7CE3EA2D259&json={\"BTTTouchBarButtonName\":\"Test\",\"BTTTriggerConfig\":{\"BTTTouchBarButtonColor\":\"0.0, 0.0, 0.0, 255.000000\"}}&shared_secret=lnuGbV17DamXn0UqGZLe4NAyiLnsn2Xydh3c3U7uSjf69YkFLTHFu52CEfSQ5Fc8

Just trying to change the background color or text (i know text is hidden) to see any kind of change, the requests succeed with status code 200, they are logged ~/Library/Application Support/BetterTouchTool/Logs as 1598660748.708155|web|request| but the touchbar button does't change at all and there is no change visible in the Btt app either :frowning:
Any idea why this could be the case?