Add github app access to repositories via API

I would like to add access to repositories for an github app via an API. is there an API available?

check the full documentation,

https://docs.github.com/en/rest

and specifically for repositories,

https://docs.github.com/en/rest/reference/repos