How to get GitHub App installation ID for a user

Hi there,

I have recently created a GitHub App, and I’m having issues understanding how to get installation IDs for a user.

I have a Web App. I want a user to be able to click a button, and then either install the GitHub App on his GitHub organization, or pick one of his existing organizations that already have the GitHub App installed.
At the end of that flow, I want to have the installation ID, either from a new installation or from an existing one.

For a new installation, simply going to the URL handles that and gives back the installation ID.
Is there something similar for an existing installation?

1 Like

Is there a solution to this yet?
Seems like grabbing the installation id from an incoming webhook is easy, but for getting an access token for a particular repository that the app has access to is there a suggestion?
Seems like you need the installation id. Let’s say the app has hundreds of users, how do you get the installation id for a particular repository?

This endpoint can be used to fetch the installation id for a particular repo, using an authenticated header of an application.

Hey @saisankargochhayat did you manage to get this working? Running into a similar issue and would really like to avoid writing the ID to some sort of DB and associating with a separate account to the users Github.

Thanks for sharing, I was searching for this