Thats entirely possible.
The bot will “own” the markers.
And chat will trigger the bot and the bot calls the API
Basically the flow you wrote is what you do.
So you answered your own question really
The only caveate is that in order to make markers on streamers x channel, you either
- use streamer x’s token
or - streamer adds your bot as an editor of the channel, and the bot uses it’s own token
or - use an editors token of the target channel
As per:
Markers can be created by the stream owner or editors. The user creating the marker is identified by a Bearer token.
on the docs