Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
AFAIK, i am not aware we have an API for this. Being said that, you can consider file an user voice, so that Teams Product team can consider implementing it or upvote an existing item, incase if it exists. Here's the link !!