Installing an App on an Organization



Hey there,

I am developing an app with the GitHub API and I was wondering how I can differentiate who installed the app. Is there a way to determine if the generated token is from an organization install, or an actual user?



:wave: @james-stewart2,

Sorry for the delay here. I’ve moved this question over to the GitHub Apps section of the site to better assist you.


Sure is - use this endpoint and check the target_type or the type of the account.

@bswinnerton - the docs for that endpoint are wrong, if you fancy updating them The full response last time I checked was:

    "access_tokens_url": "",
    "account": {
        "avatar_url": "",
        "events_url": "{/privacy}",
        "followers_url": "",
        "following_url": "{/other_user}",
        "gists_url": "{/gist_id}",
        "gravatar_id": "",
        "html_url": "",
        "id": 1144873,
        "login": "greysteil",
        "organizations_url": "",
        "received_events_url": "",
        "repos_url": "",
        "site_admin": false,
        "starred_url": "{/owner}{/repo}",
        "subscriptions_url": "",
        "type": "User",
        "url": ""
    "app_id": 2141,
    "created_at": "2017-05-15T20:17:13.000Z",
    "events": [
    "html_url": "",
    "id": 25222,
    "integration_id": 2141,
    "permissions": {
        "contents": "write",
        "issues": "write",
        "metadata": "read",
        "pull_requests": "write",
        "statuses": "read"
    "repositories_url": "",
    "repository_selection": "selected",
    "single_file_name": null,
    "target_id": 1144873,
    "target_type": "User",
    "updated_at": "2017-05-15T20:17:13.000Z"