Chat is an implementation of IRC over IRC or WS, not JSON payloads over HTTP.
How to start
Starting with Twitch beings with the docs
And you need a ClientID
To do anything you need to be able to tell Twitch who you are and/or which user you are on behalf making requests for, thats authentication, which for Twitch is oAuth
If you then want to go ChatBot. it’s “basically” IRCv3 which is documented here:
If you wanted to go Extensions then, what you describe is similar to the Color Changing Hello World Example. Extensions are documented here.