Telegram has a Bot API that does exactly what you seek.
They have samples for all the possible programming languages, so it's totally not a problem.
Going through your requirements:
offers an api to integrate in my development environment
offers a web application to use within a browser
it should be easy for me to add new users to my messaging ...
Chatwoot is an open-source customer support solution written in Ruby (better than PHP) that helps companies engage their customers on their website, Facebook page, Twitter, Whatsapp, SMS, email, etc. It is an open-source alternative to Intercom, Drift, Freshchat, etc.