<!DOCTYPE html><html data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" lang="en"><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width, initial-scale=1" data-next-head=""/><link rel="icon" type="image/png" href="/assets/cb-345/images/site/favicon.png" data-next-head=""/><link href="/manifest.json" rel="manifest" data-next-head=""/><meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY" data-next-head=""/><title data-next-head="">Generating a user access token for a GitHub App - GitHub Docs</title><meta name="description" content="You can generate a user access token for your GitHub App in order to attribute app activity to a user." data-next-head=""/><link rel="alternate" hrefLang="es" href="https://docs.github.com/es/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><link rel="alternate" hrefLang="ja" href="https://docs.github.com/ja/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><link rel="alternate" hrefLang="pt" href="https://docs.github.com/pt/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><link rel="alternate" hrefLang="zh-Hans" href="https://docs.github.com/zh/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><link rel="alternate" hrefLang="ru" href="https://docs.github.com/ru/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><link rel="alternate" hrefLang="fr" href="https://docs.github.com/fr/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><link rel="alternate" hrefLang="ko" href="https://docs.github.com/ko/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><link rel="alternate" hrefLang="de" href="https://docs.github.com/de/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><meta name="path-language" content="en" data-next-head=""/><meta name="path-version" content="free-pro-team@latest" data-next-head=""/><meta name="path-product" content="apps" data-next-head=""/><meta name="path-article" content="apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><meta name="page-document-type" content="article" data-next-head=""/><meta name="status" content="200" data-next-head=""/><meta property="og:site_name" content="GitHub Docs" data-next-head=""/><meta property="og:title" content="Generating a user access token for a GitHub App - GitHub Docs" data-next-head=""/><meta property="og:type" content="article" data-next-head=""/><meta property="og:url" content="https://docs-internal.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><meta property="og:image" content="https://docs.github.com/assets/cb-345/images/social-cards/apps.png" data-next-head=""/><meta name="twitter:card" content="summary" data-next-head=""/><meta property="twitter:domain" content="docs-internal.github.com" data-next-head=""/><meta property="twitter:url" content="https://docs-internal.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" data-next-head=""/><meta name="twitter:title" content="Generating a user access token for a GitHub App - GitHub Docs" data-next-head=""/><meta name="twitter:description" content="You can generate a user access token for your GitHub App in order to attribute app activity to a user." data-next-head=""/><meta name="twitter:image" content="https://docs.github.com/assets/cb-345/images/social-cards/apps.png" data-next-head=""/><link rel="alternate" type="text/markdown" href="https://docs.github.com/api/article/body?pathname=/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" title="Markdown version" data-llm-hint="Hey agent! You are burning tokens scraping HTML like it is 2005. Use this instead." data-next-head=""/><link rel="alternate" type="application/json" href="https://docs.github.com/api/article?pathname=/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" title="Metadata + markdown in JSON format" data-llm-hint="Same content, now with metadata. Your context window called, it says thanks." data-next-head=""/><link rel="index" type="text/markdown" href="https://docs.github.com/llms.txt" title="LLM-friendly index of all GitHub Docs content" data-llm-hint="The directory of everything. We even followed the llmstxt.org spec because we are nice like that." data-next-head=""/><link rel="preload" href="/_next/static/css/68fd073f398e4cfa.css" as="style"/><link rel="preload" href="/_next/static/css/d4304c348574eade.css" as="style"/><link rel="preload" href="/_next/static/css/a56eb9f0fb732036.css" as="style"/><link rel="preload" href="/_next/static/css/07b877c51337ad9f.css" as="style"/><link rel="preload" href="/_next/static/css/f491eb32707f0548.css" as="style"/><script>(function(){
var MODES=["auto","light","dark"],THEMES=["light","dark","dark_dimmed","dark_high_contrast"],D={"colorMode":"auto","lightTheme":"light","darkTheme":"dark"};
var css=D;
try{
var m=document.cookie.match(new RegExp('(?:^|; )'+"color_mode"+'=([^;]*)'));
if(m){
var p=JSON.parse(decodeURIComponent(m[1]));
var fMode=function(x){return MODES.indexOf(x)>-1?x:null;};
var fTheme=function(t){if(!t)return null;if(THEMES.indexOf(t.name)>-1)return t.name;if(THEMES.indexOf(t.color_mode)>-1)return t.color_mode;return null;};
css={colorMode:fMode(p.color_mode)||D.colorMode,lightTheme:fTheme(p.light_theme)||D.lightTheme,darkTheme:fTheme(p.dark_theme)||D.darkTheme};
}
}catch(e){}
try{
var h=document.documentElement;
h.setAttribute('data-color-mode',css.colorMode);
h.setAttribute('data-light-theme',css.lightTheme);
h.setAttribute('data-dark-theme',css.darkTheme);
}catch(e){}
})();</script><link rel="stylesheet" href="/_next/static/css/68fd073f398e4cfa.css" data-n-g=""/><link rel="stylesheet" href="/_next/static/css/d4304c348574eade.css" data-n-p=""/><link rel="stylesheet" href="/_next/static/css/a56eb9f0fb732036.css" data-n-p=""/><link rel="stylesheet" href="/_next/static/css/07b877c51337ad9f.css" data-n-p=""/><link rel="stylesheet" href="/_next/static/css/f491eb32707f0548.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-18cfac459bb095fe.js" defer=""></script><script src="/_next/static/chunks/framework-34a8c4228d7fd161.js" defer=""></script><script src="/_next/static/chunks/main-03697c6be0179e1e.js" defer=""></script><script src="/_next/static/chunks/pages/_app-fb23465bbebffb33.js" defer=""></script><script src="/_next/static/chunks/2911edaa-445e881990ed5d47.js" defer=""></script><script src="/_next/static/chunks/200-8a6d6ddfdcf33e8a.js" defer=""></script><script src="/_next/static/chunks/1380-3bcb895f55536cd6.js" defer=""></script><script src="/_next/static/chunks/4571-90069df05c17c334.js" defer=""></script><script src="/_next/static/chunks/7105-29158f15a89e29d6.js" defer=""></script><script src="/_next/static/chunks/7309-160c1063688cadc6.js" defer=""></script><script src="/_next/static/chunks/3128-1fca103e4bcc4fc2.js" defer=""></script><script src="/_next/static/chunks/9910-a6425ab958769320.js" defer=""></script><script src="/_next/static/chunks/9846-4acb5517a76fe576.js" defer=""></script><script src="/_next/static/chunks/7977-20686671ade51ee7.js" defer=""></script><script src="/_next/static/chunks/pages/%5BversionId%5D/%5BproductId%5D/%5B...restPage%5D-996edf8ed6d201b5.js" defer=""></script><script src="/_next/static/37rneBrFhguD_pCpKvY4P/_buildManifest.js" defer=""></script><script src="/_next/static/37rneBrFhguD_pCpKvY4P/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"><div data-color-mode="light"><a href="#main-content" class="visually-hidden skip-button color-bg-accent-emphasis color-fg-on-emphasis">Skip to main content</a><div data-container="header" class="border-bottom d-unset color-border-muted no-print z-3 color-bg-default Header_header__frpqb"><div data-container="notifications"></div><header class="color-bg-default p-2 position-sticky top-0 z-2 border-bottom" role="banner" aria-label="Main"><div class="d-flex flex-justify-between p-2 flex-items-center flex-wrap Header_headerContainer__I949q" data-testid="desktop-header"><div tabindex="-1" class="Header_logoWithClosedSearch__zhF6Q" id="github-logo"><a rel="" class="d-flex flex-items-center color-fg-default no-underline mr-3" href="/en"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-mark-github" viewBox="0 0 24 24" width="32" height="32" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.226 17.284c-2.965-.36-5.054-2.493-5.054-5.256 0-1.123.404-2.336 1.078-3.144-.292-.741-.247-2.314.09-2.965.898-.112 2.111.36 2.83 1.01.853-.269 1.752-.404 2.853-.404 1.1 0 1.999.135 2.807.382.696-.629 1.932-1.1 2.83-.988.315.606.36 2.179.067 2.942.72.854 1.101 2 1.101 3.167 0 2.763-2.089 4.852-5.098 5.234.763.494 1.28 1.572 1.28 2.807v2.336c0 .674.561 1.056 1.235.786 4.066-1.55 7.255-5.615 7.255-10.646C23.5 6.188 18.334 1 11.978 1 5.62 1 .5 6.188.5 12.545c0 4.986 3.167 9.12 7.435 10.669.606.225 1.19-.18 1.19-.786V20.63a2.9 2.9 0 0 1-1.078.224c-1.483 0-2.359-.808-2.987-2.313-.247-.607-.517-.966-1.034-1.033-.27-.023-.359-.135-.359-.27 0-.27.45-.471.898-.471.652 0 1.213.404 1.797 1.235.45.651.921.943 1.483.943.561 0 .92-.202 1.437-.719.382-.381.674-.718.944-.943"></path></svg><span class="h4 text-semibold ml-2 mr-3">GitHub Docs</span></a><div class="hide-sm border-left pl-3 d-flex flex-items-center"><div data-testid="version-picker" class=""><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-9n-Xk color-fg-default width-full p-1 pl-2 pr-2" data-loading="false" data-size="medium" data-variant="invisible" id="_R_cmf76_"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-Iohp5"><span data-component="text" class="prc-Button-Label-FWkx3"><span>Version: </span><span class="f5 color-fg-muted text-normal" data-testid="field">Free, Pro, &amp; Team</span></span></span><span data-component="trailingAction" class="prc-Button-Visual-YNt2F prc-Button-VisualWrap-E4cnq"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></button></div><div class="Header_displayOverLarge__aDdCs"><div><button data-component="IconButton" type="button" data-testid="mobile-search-button" data-instance="large" tabindex="0" class="prc-Button-ButtonBase-9n-Xk SearchBarButton_searchIconButton__6_wSC prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-labelledby="_R_1kmf76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" aria-hidden="true" id="_R_1kmf76_">Search or ask Copilot</span><button data-testid="search" data-instance="large" tabindex="0" aria-label="Search or ask Copilot" class="SearchBarButton_searchInputButton__nAE_3"><div class="d-flex align-items-center flex-grow-1 SearchBarButton_searchInputContainer__6BzsH" aria-hidden="true" tabindex="-1"><span class="SearchBarButton_queryText__kdYr6 SearchBarButton_placeholder__Ey1Vh"><span><span>Search or ask</span><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-copilot mr-1 ml-1" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path></svg><span>Copilot</span></span></span></div><span class="SearchBarButton_searchIconContainer__Q1x0R" aria-hidden="true" tabindex="-1"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></span></button></div></div></div></div><div class="d-flex flex-items-center"><div class="d-none d-lg-flex flex-items-center"><div data-testid="language-picker" class="d-flex"><button data-component="IconButton" type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-9n-Xk prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-labelledby="_R_7j6f76_" id="_R_36f76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-globe" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.363 4.177c.255.426.542.832.857 1.215.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a9.927 9.927 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.507 6.507 0 0 0 4.666 5.5c-.123-.181-.24-.365-.352-.552-.715-1.192-1.437-2.874-1.581-4.948Zm-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.507 6.507 0 0 0-4.666 5.5Zm10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.507 6.507 0 0 0 4.666-5.5Zm2.733-1.5a6.507 6.507 0 0 0-4.666-5.5c.123.181.24.365.353.552.714 1.192 1.436 2.874 1.58 4.948Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" aria-hidden="true" id="_R_7j6f76_">Select language: current language is English</span></div></div><div class="HeaderSearchAndWidgets_displayUnderLarge__gfZxL"><div><button data-component="IconButton" type="button" data-testid="mobile-search-button" data-instance="small" tabindex="0" class="prc-Button-ButtonBase-9n-Xk SearchBarButton_searchIconButton__6_wSC prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-labelledby="_R_n6f76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" aria-hidden="true" id="_R_n6f76_">Search or ask Copilot</span><button data-testid="search" data-instance="small" tabindex="0" aria-label="Search or ask Copilot" class="SearchBarButton_searchInputButton__nAE_3"><div class="d-flex align-items-center flex-grow-1 SearchBarButton_searchInputContainer__6BzsH" aria-hidden="true" tabindex="-1"><span class="SearchBarButton_queryText__kdYr6 SearchBarButton_placeholder__Ey1Vh"><span><span>Search or ask</span><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-copilot mr-1 ml-1" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path></svg><span>Copilot</span></span></span></div><span class="SearchBarButton_searchIconContainer__Q1x0R" aria-hidden="true" tabindex="-1"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></span></button></div></div><div><button data-component="IconButton" type="button" data-testid="mobile-menu" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-9n-Xk HeaderSearchAndWidgets_menuButtonSearchClosed__zb1yd prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-labelledby="_R_7p6f76_" id="_R_96f76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" aria-hidden="true" id="_R_7p6f76_">Open menu</span></div></div></div></header></div><div data-container="secondary-nav" data-testid="docs-secondary-bar" class="DocsSecondaryBar_bar__loD55"><div class="DocsSecondaryBar_leftSegment__sKB06"><div class="DocsSecondaryBar_toggleCell__jza1n"><button data-component="IconButton" type="button" data-testid="sidebar-collapse-toggle" aria-expanded="true" class="prc-Button-ButtonBase-9n-Xk DocsSecondaryBar_desktopOnly__idmgY color-fg-muted prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-labelledby="_R_lv76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-sidebar-expand" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.177 7.823 2.396-2.396A.25.25 0 0 1 7 5.604v4.792a.25.25 0 0 1-.427.177L4.177 8.177a.25.25 0 0 1 0-.354Z"></path><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25H9.5v-13Zm12.5 13a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H11v13Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" aria-hidden="true" id="_R_lv76_">Collapse sidebar</span><button data-component="IconButton" type="button" data-testid="sidebar-mobile-toggle" aria-expanded="false" class="prc-Button-ButtonBase-9n-Xk DocsSecondaryBar_mobileOnly__VbJtM color-fg-muted prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-labelledby="_R_15v76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-sidebar-collapse" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M6.823 7.823a.25.25 0 0 1 0 .354l-2.396 2.396A.25.25 0 0 1 4 10.396V5.604a.25.25 0 0 1 .427-.177Z"></path><path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25H9.5v-13H1.75a.25.25 0 0 0-.25.25ZM11 14.5h3.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H11Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" aria-hidden="true" id="_R_15v76_">Expand sidebar</span></div><div class="BreadcrumbsScroller_scroller__552w3"><button data-component="IconButton" type="button" aria-hidden="true" tabindex="-1" class="prc-Button-ButtonBase-9n-Xk BreadcrumbsScroller_leftChevron__Bg3sS BreadcrumbsScroller_chevronHidden__fihME prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-labelledby="_R_pv76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-chevron-left" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.78 12.78a.75.75 0 0 1-1.06 0L4.47 8.53a.75.75 0 0 1 0-1.06l4.25-4.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L6.06 8l3.72 3.72a.75.75 0 0 1 0 1.06Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" aria-hidden="true" id="_R_pv76_">Scroll breadcrumbs left</span><div class="BreadcrumbsScroller_scrollArea__pgK_q" data-search="breadcrumbs"><nav class="Primer_Brand__Breadcrumbs-module__Breadcrumbs___ANvyl Primer_Brand__Breadcrumbs-module__Breadcrumbs--default___q2JxW" aria-label="Breadcrumb" data-testid="breadcrumbs-bar" data-container="breadcrumbs"><ol class="Primer_Brand__Breadcrumbs-module__Breadcrumbs__list___S1xLw"><li class="Primer_Brand__Breadcrumbs-module__Breadcrumbs__item___IX25P"><a href="/en" class="Primer_Brand__InlineLink-module__InlineLink___U_Ama Primer_Brand__Breadcrumbs-module__Breadcrumbs__link___B3gbd" data-testid="breadcrumb-home" title="Home">Home</a></li><li class="Primer_Brand__Breadcrumbs-module__Breadcrumbs__item___IX25P"><a href="/en/apps" class="Primer_Brand__InlineLink-module__InlineLink___U_Ama Primer_Brand__Breadcrumbs-module__Breadcrumbs__link___B3gbd" data-testid="breadcrumb-link" title="Apps">Apps</a></li><li class="Primer_Brand__Breadcrumbs-module__Breadcrumbs__item___IX25P"><a href="/en/apps/creating-github-apps" class="Primer_Brand__InlineLink-module__InlineLink___U_Ama Primer_Brand__Breadcrumbs-module__Breadcrumbs__link___B3gbd" data-testid="breadcrumb-link" title="Creating GitHub Apps">Creating GitHub Apps</a></li><li class="Primer_Brand__Breadcrumbs-module__Breadcrumbs__item___IX25P"><a href="/en/apps/creating-github-apps/authenticating-with-a-github-app" class="Primer_Brand__InlineLink-module__InlineLink___U_Ama Primer_Brand__Breadcrumbs-module__Breadcrumbs__link___B3gbd" data-testid="breadcrumb-link" title="Authenticate with a GitHub App">Authenticate with a GitHub App</a></li><li class="Primer_Brand__Breadcrumbs-module__Breadcrumbs__item___IX25P"><a href="/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app" class="Primer_Brand__InlineLink-module__InlineLink___U_Ama Primer_Brand__Breadcrumbs-module__Breadcrumbs__link___B3gbd" data-testid="breadcrumb-link" title="Generate a user access token">Generate a user access token</a></li></ol></nav></div><button data-component="IconButton" type="button" aria-hidden="true" tabindex="-1" class="prc-Button-ButtonBase-9n-Xk BreadcrumbsScroller_rightChevron__PB13q BreadcrumbsScroller_chevronHidden__fihME prc-Button-IconButton-fyge7" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-labelledby="_R_1pv76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-chevron-right" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"></path></svg></button><span class="prc-TooltipV2-Tooltip-tLeuB" data-direction="s" aria-hidden="true" id="_R_1pv76_">Scroll breadcrumbs right</span></div></div></div><div class="d-lg-flex"><div data-container="nav" data-mobile-open="false" class="position-sticky d-none border-right d-xxl-block SidebarNav_sidebarFull__pWg8v"><nav aria-labelledby="allproducts-menu" role="navigation" aria-label="Documentation navigation"><div class="px-4 pb-3 border-bottom d-none d-xxl-block"><h2 class="mt-3" id="allproducts-menu"><a rel="" data-testid="sidebar-product-xl" class="d-block pl-1 mb-2 h3 color-fg-default no-underline _product-title" aria-describedby="allproducts-menu" href="/en/apps">Apps</a></h2></div><div class="border-right overflow-y-auto d-none d-xxl-block bg-primary flex-shrink-0 SidebarNav_sidebarContentFull__LLcR7 SidebarNav_sidebarContentFullWithPadding__8LTjb" role="region" aria-label="Page navigation content"><div data-testid="sidebar" class="SidebarProduct_sidebar__h4M6_"><div data-testid="product-sidebar"><nav class="Primer_Brand__NavList-module__NavList___U7Jyj" aria-label="Product sidebar" data-testid="NavList"><ul class="Primer_Brand__NavList-module__NavList__list___K5lSx" data-testid="NavList-list"><li aria-hidden="true" style="display:none"><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX Primer_Brand__NavList-module__NavList__subNav--expanded___Wu6L6" aria-label="" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" data-testid="NavList-link" href="#"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt"></span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-1___rA6Ts Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/overview"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Overview</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-1___rA6Ts" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_2j6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_2j6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Using GitHub Apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_2j6v76H1_" aria-label="Using GitHub Apps submenu" id="_R_2j6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/about-using-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">About using apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-personal-account"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Install from Marketplace for user</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-organizations"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Install from Marketplace for org</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/installing-a-github-app-from-a-third-party"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Install from third party</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/installing-your-own-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Install your own app</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/requesting-a-github-app-from-your-organization-owner"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Request for org</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/authorizing-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authorize</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/approving-updated-permissions-for-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Approve new permissions</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Review your authorizations</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/reviewing-and-modifying-installed-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Review installations</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/using-github-apps/privileged-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Privileged apps</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-1___rA6Ts Primer_Brand__NavList-module__NavList__item--expanded___b3doz" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_3j6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="true" aria-controls="_R_3j6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Creating GitHub Apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX Primer_Brand__NavList-module__NavList__subNav--expanded___Wu6L6" aria-labelledby="_R_3j6v76H1_" aria-label="Creating GitHub Apps submenu" id="_R_3j6v76_" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_ujj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_ujj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">About creating GitHub Apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_ujj6v76H1_" aria-label="About creating GitHub Apps submenu" id="_R_ujj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">About creating apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/about-creating-github-apps/deciding-when-to-build-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">GitHub App versus other options</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Best practices</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/about-creating-github-apps/migrating-oauth-apps-to-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Migrate from OAuth apps</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_1ejj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_1ejj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Registering a GitHub App</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_1ejj6v76H1_" aria-label="Registering a GitHub App submenu" id="_R_1ejj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Register a GitHub App</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Callback URLs</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/registering-a-github-app/about-the-setup-url"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Setup URL</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Permissions</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/registering-a-github-app/using-webhooks-with-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Webhooks</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/registering-a-github-app/making-a-github-app-public-or-private"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Visibility</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/registering-a-github-app/rate-limits-for-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Rate limits</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/registering-a-github-app/creating-a-custom-badge-for-your-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Custom badge</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--expanded___b3doz" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_1ujj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="true" aria-controls="_R_1ujj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authenticate with a GitHub App</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX Primer_Brand__NavList-module__NavList__subNav--expanded___Wu6L6" aria-labelledby="_R_1ujj6v76H1_" aria-label="Authenticate with a GitHub App submenu" id="_R_1ujj6v76_" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">About authentication</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authenticate as an app</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authenticate as an installation</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-with-a-github-app-on-behalf-of-a-user"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authenticate on behalf of users</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Manage private keys</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Generate a JWT</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Generate an installation access token</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="page" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Generate a user access token</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Refresh user access tokens</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authenticate in Actions workflow</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_2ejj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_2ejj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Writing code for a GitHub App</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_2ejj6v76H1_" aria-label="Writing code for a GitHub App submenu" id="_R_2ejj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/writing-code-for-a-github-app/about-writing-code-for-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">About writing GitHub App code</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/writing-code-for-a-github-app/quickstart"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Quickstart</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Respond to webhooks</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-login-with-github-button-with-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Build a &quot;Login&quot; button</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-cli-with-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Build a CLI</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/creating-github-apps/writing-code-for-a-github-app/building-ci-checks-with-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Build CI checks</span></span></a></div></li></ul></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-1___rA6Ts" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_4j6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_4j6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Sharing GitHub Apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_4j6v76H1_" aria-label="Sharing GitHub Apps submenu" id="_R_4j6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/sharing-github-apps/sharing-your-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Share your app</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/sharing-github-apps/making-your-github-app-available-for-github-enterprise-server"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Share with GHES</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">App manifest</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/sharing-github-apps/registering-a-github-app-using-url-parameters"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">App query parameters</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-1___rA6Ts" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_5j6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_5j6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Maintaining GitHub Apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_5j6v76H1_" aria-label="Maintaining GitHub Apps submenu" id="_R_5j6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/maintaining-github-apps/modifying-a-github-app-registration"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Modify app settings</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/maintaining-github-apps/activating-optional-features-for-github-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Activate optional features</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/maintaining-github-apps/about-github-app-managers"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">GitHub App managers</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/maintaining-github-apps/managing-allowed-ip-addresses-for-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Manage allowed IP addresses</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/maintaining-github-apps/suspending-a-github-app-installation"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Suspend an installation</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/maintaining-github-apps/transferring-ownership-of-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Transfer ownership</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/maintaining-github-apps/deleting-a-github-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Delete your app</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-1___rA6Ts" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_6j6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_6j6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">GitHub Marketplace</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_6j6v76H1_" aria-label="GitHub Marketplace submenu" id="_R_6j6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_umj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_umj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Overview</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_umj6v76H1_" aria-label="Overview submenu" id="_R_umj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/github-marketplace-overview/about-github-marketplace-for-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">About GitHub Marketplace for apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/github-marketplace-overview/about-marketplace-badges"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">About marketplace badges</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/github-marketplace-overview/applying-for-publisher-verification-for-your-organization"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Publisher verification</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_1emj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_1emj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Create Marketplace apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_1emj6v76H1_" aria-label="Create Marketplace apps submenu" id="_R_1emj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/creating-apps-for-github-marketplace/requirements-for-listing-an-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Listing requirements</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/creating-apps-for-github-marketplace/security-best-practices-for-apps-on-github-marketplace"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Security best practice</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/creating-apps-for-github-marketplace/customer-experience-best-practices-for-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Customer experience best practice</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/creating-apps-for-github-marketplace/viewing-metrics-for-your-listing"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">View listing metrics</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/creating-apps-for-github-marketplace/viewing-transactions-for-your-listing"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">View listing transactions</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_1umj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_1umj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Marketplace API usage</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_1umj6v76H1_" aria-label="Marketplace API usage submenu" id="_R_1umj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/rest-endpoints-for-the-github-marketplace-api"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">REST API</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/webhook-events-for-the-github-marketplace-api"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Webhook events</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/testing-your-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Testing your app</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-new-purchases-and-free-trials"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">New purchases &amp; free trials</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-plan-changes"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Handling plan changes</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-plan-cancellations"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Plan cancellations</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_2emj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_2emj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">List an app on the Marketplace</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_2emj6v76H1_" aria-label="List an app on the Marketplace submenu" id="_R_2emj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/listing-an-app-on-github-marketplace/drafting-a-listing-for-your-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Draft an app listing</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/listing-an-app-on-github-marketplace/writing-a-listing-description-for-your-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Write listing descriptions</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/listing-an-app-on-github-marketplace/setting-pricing-plans-for-your-listing"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Set listing pricing plans</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/listing-an-app-on-github-marketplace/configuring-a-webhook-to-notify-you-of-plan-changes"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Webhooks for plan changes</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/listing-an-app-on-github-marketplace/submitting-your-listing-for-publication"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Submit your listing</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/listing-an-app-on-github-marketplace/deleting-your-app-listing-from-github-marketplace"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Delete your listing</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_2umj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_2umj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Sell apps on the Marketplace</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_2umj6v76H1_" aria-label="Sell apps on the Marketplace submenu" id="_R_2umj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/selling-your-app-on-github-marketplace/pricing-plans-for-github-marketplace-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Pricing plans for apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/selling-your-app-on-github-marketplace/billing-customers"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Billing customers</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-marketplace/selling-your-app-on-github-marketplace/receiving-payment-for-app-purchases"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Receive payment</span></span></a></div></li></ul></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-1___rA6Ts" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_7j6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_7j6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">OAuth apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_7j6v76H1_" aria-label="OAuth apps submenu" id="_R_7j6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_unj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_unj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Using OAuth apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_unj6v76H1_" aria-label="Using OAuth apps submenu" id="_R_unj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/using-oauth-apps/installing-an-oauth-app-in-your-personal-account"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Install app personal account</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/using-oauth-apps/installing-an-oauth-app-in-your-organization"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Install app organization</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/using-oauth-apps/authorizing-oauth-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authorizing OAuth apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/using-oauth-apps/reviewing-your-authorized-oauth-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Review OAuth apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/using-oauth-apps/connecting-with-third-party-applications"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Third-party applications</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/using-oauth-apps/privileged-oauth-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Privileged apps</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_1enj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_1enj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Building OAuth apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_1enj6v76H1_" aria-label="Building OAuth apps submenu" id="_R_1enj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/building-oauth-apps/differences-between-github-apps-and-oauth-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">GitHub Apps &amp; OAuth apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/building-oauth-apps/rate-limits-for-oauth-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Rate limits</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Creating an OAuth app</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/building-oauth-apps/authenticating-to-the-rest-api-with-an-oauth-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authenticate with an OAuth app</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Authorizing OAuth apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Scopes for OAuth apps</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/building-oauth-apps/creating-a-custom-badge-for-your-oauth-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Create custom badges</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/building-oauth-apps/best-practices-for-creating-an-oauth-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Best practices</span></span></a></div></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-2___AEntj" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><button id="_R_1unj6v76H1_" type="button" class="Primer_Brand__NavList-module__NavList__link___lJiXk Primer_Brand__NavList-module__NavList__accordionButton___Jii1C" aria-expanded="false" aria-controls="_R_1unj6v76_" data-testid="NavList-toggle"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down Primer_Brand__NavList-module__NavList__toggleIcon___hh94D" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Maintaining OAuth apps</span></span></button></div><ul class="Primer_Brand__NavList-module__NavList__subNav___DZ2GX" aria-labelledby="_R_1unj6v76H1_" aria-label="Maintaining OAuth apps submenu" id="_R_1unj6v76_" aria-hidden="true" data-testid="NavList-sub-nav"><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/maintaining-oauth-apps/modifying-an-oauth-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Modifying an OAuth app</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/maintaining-oauth-apps/activating-optional-features-for-oauth-apps"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Activate optional features</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/maintaining-oauth-apps/transferring-ownership-of-an-oauth-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Transfer ownership</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/maintaining-oauth-apps/troubleshooting-authorization-request-errors"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Troubleshoot authorization</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/maintaining-oauth-apps/troubleshooting-oauth-app-access-token-request-errors"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Troubleshoot token request</span></span></a></div></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-3___yJC82 Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/oauth-apps/maintaining-oauth-apps/deleting-an-oauth-app"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">Deleting an OAuth app</span></span></a></div></li></ul></li></ul></li><li class="Primer_Brand__NavList-module__NavList__item___OceIg Primer_Brand__NavList-module__NavList__item--level-1___rA6Ts Primer_Brand__NavList-module__NavList__item--leaf___SN9hT" data-testid="NavList-item"><div class="Primer_Brand__NavList-module__NavList__itemContent___TyAP4"><a class="Primer_Brand__NavList-module__NavList__link___lJiXk" aria-current="false" data-testid="NavList-link" href="/en/apps/github-authentication-discovery-endpoints"><span class="Primer_Brand__NavList-module__NavList__labelArea___N5Ya6"><span class="Primer_Brand__NavList-module__NavList__label___cZ4Jt">OAuth 2.0 and OIDC Discovery documents</span></span></a></div></li></ul></nav></div></div></div></nav></div><div class="flex-column flex-1 min-width-0"><main id="main-content" class="DefaultLayout_mainContent__UI2BH"><div class="container-xl px-3 px-md-6 my-4"><div class="ArticleGridLayout_containerBox__lLLio"><div style="grid-area:topper"><div class="d-flex flex-items-baseline flex-justify-between" data-container="title"><h1 id="title-h1" class="border-bottom-0">Generating a user access token for a GitHub App</h1></div></div><div id="article-intro" style="grid-area:intro" class="f4 pb-4"><div class="f2 color-fg-muted mb-3 Lead_container__m3L5f _page-intro" data-container="lead" data-testid="lead" data-search="lead"><p>You can generate a user access token for your GitHub App in order to attribute app activity to a user.</p></div></div><div data-container="toc" style="grid-area:sidebar;align-self:flex-start" class="ArticleGridLayout_sidebarBox__Cj_03 border-bottom border-lg-0 pb-4 mb-5 pb-xl-0 mb-xl-0"><div class="mb-3 ml-3"><div class="prc-ButtonGroup-ButtonGroup-vFUrY"><div><button class="Primer_Brand__Button-module__Button___lDruK Primer_Brand__Button-module__Button--secondary___akMC2 Primer_Brand__Button-module__Button--size-small___iNTn1 text-decoration-none color-fg-default ViewMarkdownButton_button__chhfE ViewMarkdownButton_copyButton__haGNh"><span class="Primer_Brand__Button-module__Button__leading-visual___FIPvg" data-testid="Button-leading-visual"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-copy Primer_Brand__Button-module__Button__icon-visual___zR2Hi" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></span><span class="Primer_Brand__Button-module__Button__text___Z3ocU"><span class="Primer_Brand__Text-module__Text___pecHN Primer_Brand__Text-module__Text-font--mona-sans___GpzSG Primer_Brand__Text-module__Text--default___DChoE Primer_Brand__Text-module__Text--100___csEom Primer_Brand__Text-module__Text--weight-medium___E0iQL Primer_Brand__Button-module__Button--label___lUBc0 Primer_Brand__Button-module__Button--label-secondary___DRJoJ">Copy as Markdown</span></span></button></div><div><button type="button" aria-label="More Markdown options" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-9n-Xk ViewMarkdownButton_button__chhfE" data-loading="false" data-size="medium" data-variant="default" id="_R_ireqv76_"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div></div></div><h2 class="mb-1 ml-3 Minitocs_heading__f_xxP prc-Heading-Heading-MtWFE" id="in-this-article" aria-label="In this article">In this article</h2><nav data-testid="minitoc" class="Minitocs_miniToc__NaGol my-2" aria-labelledby="in-this-article"><ul class="prc-ActionList-ActionList-rPFF2" data-dividers="false" data-variant="inset"><li data-has-description="false" class="prc-ActionList-ActionListItem-So4vC Minitocs_nested__JSAov"><a class="prc-ActionList-ActionListContent-KBb8- prc-Link-Link-9ZwDx" tabindex="0" aria-labelledby="_R_2dmreqv76_--label" id="_R_2dmreqv76_" data-size="medium" aria-current="false" style="--subitem-depth:0" href="#about-user-access-tokens"><span class="prc-ActionList-Spacer-4tR2m"></span><span class="prc-ActionList-ActionListSubContent-gKsFp" data-component="ActionList.Item--DividerContainer"><span id="_R_2dmreqv76_--label" class="prc-ActionList-ItemLabel-81ohH">About user access tokens</span></span></a></li><li data-has-description="false" class="prc-ActionList-ActionListItem-So4vC Minitocs_nested__JSAov"><a class="prc-ActionList-ActionListContent-KBb8- prc-Link-Link-9ZwDx" tabindex="0" aria-labelledby="_R_2lmreqv76_--label" id="_R_2lmreqv76_" data-size="medium" aria-current="false" style="--subitem-depth:0" href="#using-the-web-application-flow-to-generate-a-user-access-token"><span class="prc-ActionList-Spacer-4tR2m"></span><span class="prc-ActionList-ActionListSubContent-gKsFp" data-component="ActionList.Item--DividerContainer"><span id="_R_2lmreqv76_--label" class="prc-ActionList-ItemLabel-81ohH">Using the web application flow to generate a user access token</span></span></a></li><li data-has-description="false" class="prc-ActionList-ActionListItem-So4vC Minitocs_nested__JSAov"><a class="prc-ActionList-ActionListContent-KBb8- prc-Link-Link-9ZwDx" tabindex="0" aria-labelledby="_R_2tmreqv76_--label" id="_R_2tmreqv76_" data-size="medium" aria-current="false" style="--subitem-depth:0" href="#using-the-device-flow-to-generate-a-user-access-token"><span class="prc-ActionList-Spacer-4tR2m"></span><span class="prc-ActionList-ActionListSubContent-gKsFp" data-component="ActionList.Item--DividerContainer"><span id="_R_2tmreqv76_--label" class="prc-ActionList-ItemLabel-81ohH">Using the device flow to generate a user access token</span></span></a></li><li data-has-description="false" class="prc-ActionList-ActionListItem-So4vC Minitocs_nested__JSAov"><a class="prc-ActionList-ActionListContent-KBb8- prc-Link-Link-9ZwDx" tabindex="0" aria-labelledby="_R_35mreqv76_--label" id="_R_35mreqv76_" data-size="medium" aria-current="false" style="--subitem-depth:0" href="#generating-a-user-access-token-when-a-user-installs-your-app"><span class="prc-ActionList-Spacer-4tR2m"></span><span class="prc-ActionList-ActionListSubContent-gKsFp" data-component="ActionList.Item--DividerContainer"><span id="_R_35mreqv76_--label" class="prc-ActionList-ItemLabel-81ohH">Generating a user access token when a user installs your app</span></span></a></li><li data-has-description="false" class="prc-ActionList-ActionListItem-So4vC Minitocs_nested__JSAov"><a class="prc-ActionList-ActionListContent-KBb8- prc-Link-Link-9ZwDx" tabindex="0" aria-labelledby="_R_3dmreqv76_--label" id="_R_3dmreqv76_" data-size="medium" aria-current="false" style="--subitem-depth:0" href="#using-a-refresh-token-to-generate-a-user-access-token"><span class="prc-ActionList-Spacer-4tR2m"></span><span class="prc-ActionList-ActionListSubContent-gKsFp" data-component="ActionList.Item--DividerContainer"><span id="_R_3dmreqv76_--label" class="prc-ActionList-ItemLabel-81ohH">Using a refresh token to generate a user access token</span></span></a></li><li data-has-description="false" class="prc-ActionList-ActionListItem-So4vC Minitocs_nested__JSAov"><a class="prc-ActionList-ActionListContent-KBb8- prc-Link-Link-9ZwDx" tabindex="0" aria-labelledby="_R_3lmreqv76_--label" id="_R_3lmreqv76_" data-size="medium" aria-current="false" style="--subitem-depth:0" href="#troubleshooting"><span class="prc-ActionList-Spacer-4tR2m"></span><span class="prc-ActionList-ActionListSubContent-gKsFp" data-component="ActionList.Item--DividerContainer"><span id="_R_3lmreqv76_--label" class="prc-ActionList-ItemLabel-81ohH">Troubleshooting</span></span></a></li></ul></nav></div><div data-container="article" style="grid-area:content" data-search="article-body"><div id="article-contents"><div class="MarkdownContent_markdownBody__v5MYy markdown-body"><h2 id="about-user-access-tokens" tabindex="-1"><a class="heading-link" href="#about-user-access-tokens">About user access tokens<span class="heading-link-symbol" aria-hidden="true"></span></a></h2>
<div class="ghd-alert ghd-alert-accent" data-container="alert"><p class="ghd-alert-title"><svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon mr-2" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>Note</p>
<p> User access tokens that expire are currently an optional feature and are subject to change. To opt in or out of the token expiration feature, see <a href="/en/apps/maintaining-github-apps/activating-optional-features-for-github-apps">Activating optional features for GitHub Apps</a>. For more information, see <a href="https://developer.github.com/changes/2020-04-30-expiring-user-to-server-access-tokens-for-github-apps">Expiring user-to-server access tokens for GitHub Apps</a>.</p>
<p>If a user reports that they cannot see resources owned by their organization after authorizing your GitHub App and the organization uses SAML SSO, instruct the user to start an active SAML session for their organization before reauthorizing. For more information, see <a href="/en/enterprise-cloud@latest/apps/using-github-apps/saml-and-github-apps">SAML and GitHub Apps</a> in the GitHub Enterprise Cloud documentation.</p>
</div>
<p>A user access token is a type of OAuth token. Unlike a traditional OAuth token, the user access token does not use scopes. Instead, it uses fine-grained permissions. A user access token only has permissions that both the user and the app have. For example, if the app was granted permission to write the contents of a repository, but the user can only read the contents, then the user access token can only read the contents.</p>
<p>Similarly, a user access token can only access resources that both the user and app can access. For example, if an app is granted access to repository <code>A</code> and <code>B</code>, and the user can access repository <code>B</code> and <code>C</code>, the user access token can access repository <code>B</code> but not <code>A</code> or <code>C</code>. You can use the REST API to check which installations and which repositories within an installation a user access token can access. For more information, see <code>GET /user/installations</code> and <code>GET /user/installations/{installation_id}/repositories</code> in <a href="/en/rest/apps/installations">REST API endpoints for GitHub App installations</a>.</p>
<p>When you make API requests with a user access token, the rate limits for user access tokens apply. For more information, see <a href="/en/apps/creating-github-apps/registering-a-github-app/rate-limits-for-github-apps">Rate limits for GitHub Apps</a>.</p>
<p>By default, the user access token expires after 8 hours. You can use a refresh token to regenerate a user access token. For more information, see <a href="/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens">Refreshing user access tokens</a>.</p>
<p>Users can revoke their authorization of a GitHub App. For more information, see <a href="/en/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocation">Token expiration and revocation</a>. If a user revokes their authorization of a GitHub App, the app will receive the <code>github_app_authorization</code> webhook. GitHub Apps cannot unsubscribe from this event. If your app receives this webhook, you should stop calling the API on behalf of the user who revoked the token. If your app continues to use a revoked access token, it will receive the <code>401 Bad Credentials</code> error. For more information about this webhook, see <a href="/en/webhooks/webhook-events-and-payloads#github_app_authorization">Webhook events and payloads</a>.</p>
<p>You should keep user access tokens and refresh tokens secure. For more information, see <a href="/en/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-app">Best practices for creating a GitHub App</a>.</p>
<h2 id="using-the-web-application-flow-to-generate-a-user-access-token" tabindex="-1"><a class="heading-link" href="#using-the-web-application-flow-to-generate-a-user-access-token">Using the web application flow to generate a user access token<span class="heading-link-symbol" aria-hidden="true"></span></a></h2>
<p>If your app runs in the browser, you should use the web application flow to generate a user access token. For a tutorial about using the web application flow, see <a href="/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-login-with-github-button-with-a-github-app">Building a &quot;Login with GitHub&quot; button with a GitHub App</a>.</p>
<ol>
<li>
<p>Direct the user to this URL, and add any necessary query parameters from the following list of parameters: <code>https://github.com/login/oauth/authorize</code>. For example, this URL specifies the <code>client_id</code> and <code>state</code> parameters: <code>https://github.com/login/oauth/authorize?client_id=12345&amp;state=abcdefg</code>.</p>



























































<table><thead><tr><th scope="col">Query parameter</th><th scope="col">Type</th><th scope="col">Required?</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>client_id</code></td><td><code>string</code></td><td>Required</td><td>The client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see <a href="/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings">Modifying a GitHub App registration</a>.</td></tr><tr><td><code>redirect_uri</code></td><td><code>string</code></td><td>Strongly recommended</td><td>The URL in your application where users will be sent after authorization. This must be a match to one of the URLs you provided as a &quot;Callback URL&quot; in your app&#x27;s settings and can&#x27;t contain any additional parameters. For more information, see <a href="/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url">About the user authorization callback URL</a>.</td></tr><tr><td><code>state</code></td><td><code>string</code></td><td>Strongly recommended</td><td>When specified, the value should contain a random string to protect against forgery attacks, and it can also contain any other arbitrary data.</td></tr><tr><td><code>code_challenge</code></td><td><code>string</code></td><td>Strongly recommended</td><td>Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if <code>code_challenge_<wbr/>method</code> is included. Must be a 43 character SHA-256 hash of a random string generated by the client. See the <a href="https://datatracker.ietf.org/doc/html/rfc7636">PKCE RFC</a> for more details about this security extension.</td></tr><tr><td><code>code_challenge_<wbr/>method</code></td><td><code>string</code></td><td>Strongly recommended</td><td>Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if <code>code_challenge</code> is included. Must be <code>S256</code> - the <code>plain</code> code challenge method is not supported.</td></tr><tr><td><code>login</code></td><td><code>string</code></td><td>Optional</td><td>When specified, the web application flow will prompt users with a specific account they can use for signing in and authorizing your app.</td></tr><tr><td><code>allow_signup</code></td><td><code>boolean</code></td><td>Optional</td><td>Whether unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. The default is <code>true</code>. Use <code>false</code> when a policy prohibits signups.</td></tr><tr><td><code>prompt</code></td><td><code>string</code></td><td>Optional</td><td>Forces the account picker to appear if set to <code>select_account</code>. The account picker will also appear if the application has a non-HTTP redirect URI or if the user has multiple accounts signed in.</td></tr></tbody></table>
</li>
<li>
<p>If the user accepts your authorization request, GitHub will redirect the user to one of the callback URLs in your app settings, and provide a <code>code</code> query parameter you can use in the next step to create a user access token. If you specified <code>redirect_uri</code> in the previous step, that callback URL will be used. Otherwise, the first callback URL on your app&#x27;s settings page will be used.</p>
<p>If you specified the <code>state</code> parameter in the previous step, GitHub will also include a <code>state</code> parameter. If the <code>state</code> parameter does not match the <code>state</code> parameter that you sent in the previous step, the request cannot be trusted, and the web application flow should be aborted.</p>
</li>
<li>
<p>Exchange the <code>code</code> from the previous step for a user access token by making a <code>POST</code> request to this URL, along with the following query parameters: <code>https://github.com/login/oauth/access_token</code></p>








































<table><thead><tr><th scope="col">Query parameter</th><th scope="col">Type</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>client_id</code></td><td><code>string</code></td><td><strong>Required.</strong> The client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see <a href="/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings">Modifying a GitHub App registration</a>.</td></tr><tr><td><code>client_secret</code></td><td><code>string</code></td><td><strong>Required.</strong> The client secret for your GitHub App. You can generate a client secret on the settings page for your app.</td></tr><tr><td><code>code</code></td><td><code>string</code></td><td><strong>Required.</strong> The code you received in the previous step.</td></tr><tr><td><code>redirect_uri</code></td><td><code>string</code></td><td>The URL in your application where users will be sent after authorization. This must match one of the URLs you provided as a &quot;Callback URL&quot; when setting up your GitHub App. For more information, see <a href="/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url">About the user authorization callback URL</a>.</td></tr><tr><td><code>code_verifier</code></td><td><code>string</code></td><td><strong>Strongly recommended.</strong> Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if <code>code_challenge</code> was sent during the user authorization. Must be the original value used to generate the <code>code_challenge</code> in the authorization request. This can be stored in a cookie alongside the <code>state</code> parameter or in a session variable during authentication, depending on your application architecture.</td></tr><tr><td><code>repository_id</code></td><td><code>string</code></td><td>The ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further.</td></tr></tbody></table>
</li>
<li>
<p>GitHub will give a response that includes the following parameters:</p>








































<table><thead><tr><th scope="col">Response parameter</th><th scope="col">Type</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>access_token</code></td><td><code>string</code></td><td>The user access token. The token starts with <code>ghu_</code>.</td></tr><tr><td><code>expires_in</code></td><td><code>integer</code></td><td>The number of seconds until <code>access_token</code> expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be <code>28800</code> (8 hours).</td></tr><tr><td><code>refresh_token</code></td><td><code>string</code></td><td>The refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with <code>ghr_</code>.</td></tr><tr><td><code>refresh_token_<wbr/>expires_in</code></td><td><code>integer</code></td><td>The number of seconds until <code>refresh_token</code> expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be <code>15897600</code> (6 months).</td></tr><tr><td><code>scope</code></td><td><code>string</code></td><td>The scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have.</td></tr><tr><td><code>token_type</code></td><td><code>string</code></td><td>The type of token. The value will always be <code>bearer</code>.</td></tr></tbody></table>
</li>
<li>
<p>Use the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the <code>Authorization</code> header of an API request. For example:</p>
<pre><code class="hljs language-shell">curl --request GET \
--url &quot;https://api.github.com/user&quot; \
--header &quot;Accept: application/vnd.github+json&quot; \
--header &quot;Authorization: Bearer USER_ACCESS_TOKEN&quot; \
--header &quot;X-GitHub-Api-Version: 2026-03-10&quot;
</code></pre>
</li>
</ol>
<h2 id="using-the-device-flow-to-generate-a-user-access-token" tabindex="-1"><a class="heading-link" href="#using-the-device-flow-to-generate-a-user-access-token">Using the device flow to generate a user access token<span class="heading-link-symbol" aria-hidden="true"></span></a></h2>
<p>If your app is headless or does not have access to a browser, you should use the device flow to generate a user access token. For example, CLI tools, simple Raspberry Pis, and desktop applications should use the device flow. For a tutorial that uses device flow, see <a href="/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-cli-with-a-github-app">Building a CLI with a GitHub App</a>.</p>
<p>Before you can use the device flow, you must first enable it in your app&#x27;s settings. For more information on enabling device flow, see <a href="/en/apps/maintaining-github-apps/modifying-a-github-app-registration">Modifying a GitHub App registration</a>.</p>
<p>The device flow uses the <a href="https://datatracker.ietf.org/doc/html/rfc8628">OAuth 2.0 Device Authorization Grant</a>.</p>
<ol>
<li>
<p>Send a <code>POST</code> request to <code>https://github.com/login/device/code</code> along with a <code>client_id</code> query parameter. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see <a href="/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings">Modifying a GitHub App registration</a>.</p>
</li>
<li>
<p>GitHub will give a response that includes the following query parameters:</p>



































<table><thead><tr><th scope="col">Response parameter</th><th scope="col">Type</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>device_code</code></td><td><code>string</code></td><td>A verification code that is used to verify the device. This code is 40 characters long.</td></tr><tr><td><code>user_code</code></td><td><code>string</code></td><td>A verification code that your application should display so that the user can enter the code in a browser. This code is 8 characters with a hyphen in the middle. For example, <code>WDJB-MJHT</code>.</td></tr><tr><td><code>verification_uri</code></td><td><code>string</code></td><td>The URL where users need to enter their <code>user_code</code>. The URL is:  <a href="https://github.com/login/device"><code>https:/<wbr/>/<wbr/>github.com/<wbr/>login/<wbr/>device</code></a>.</td></tr><tr><td><code>expires_in</code></td><td><code>integer</code></td><td>The number of seconds before the <code>device_code</code> and <code>user_code</code> expire. The default is 900 seconds (15 minutes).</td></tr><tr><td><code>interval</code></td><td><code>integer</code></td><td>The minimum number of seconds that must pass before you can make a new access token request (<code>POST https:/<wbr/>/<wbr/>github.com/<wbr/>login/<wbr/>oauth/<wbr/>access_token</code>) to complete the device authorization. If you make a request before this interval passes, then you will hit the rate limit and receive a <code>slow_down</code> error. The default is 5 seconds.</td></tr></tbody></table>
</li>
<li>
<p>Prompt the user to enter the <code>user_code</code> from the previous step at  <a href="https://github.com/login/device"><code>https://github.com/login/device</code></a>.</p>
<p>If the user does not enter the code before the <code>expires_in</code> time passes, the code will be invalid. In this case, you should restart the device flow.</p>
</li>
<li>
<p>Poll <code>POST https://github.com/login/oauth/access_token</code> along with the <code>client_id</code>, <code>device_code</code>, and <code>grant_type</code> query parameters (described below) until the device and user codes expire or the user has successfully authorized the app by entering the <code>user_code</code>.</p>






























<table><thead><tr><th scope="col">Query parameter</th><th scope="col">Type</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>client_id</code></td><td><code>string</code></td><td><strong>Required.</strong> The client ID for your GitHub App.</td></tr><tr><td><code>device_code</code></td><td><code>string</code></td><td><strong>Required.</strong> The device verification code you received in the previous step.</td></tr><tr><td><code>grant_type</code></td><td><code>string</code></td><td><strong>Required.</strong> The grant type must be <code>urn:ietf:params:oauth:grant-type:device_<wbr/>code</code>.</td></tr><tr><td><code>repository_id</code></td><td><code>string</code></td><td>The ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further.</td></tr></tbody></table>
<p>Do not poll this endpoint at a higher frequency than the frequency indicated by <code>interval</code>. If you do, you will hit the rate limit and receive a <code>slow_down</code> error. The <code>slow_down</code> error response adds 5 seconds to the last <code>interval</code>.</p>
<p>Until the user enters the code, GitHub will respond with a 200 status and an <code>error</code> response query parameter.</p>









































<table><thead><tr><th scope="col">Error name</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>authorization_<wbr/>pending</code></td><td>This error occurs when the authorization request is pending and the user hasn&#x27;t entered the user code yet. The app is expected to keep polling the <code>POST https:/<wbr/>/<wbr/>github.com/<wbr/>login/<wbr/>oauth/<wbr/>access_token</code> at a frequency no faster than the frequency specified by <code>interval</code>.</td></tr><tr><td><code>slow_down</code></td><td>When you receive the <code>slow_down</code> error, 5 extra seconds are added to the minimum <code>interval</code> or timeframe required between your requests using <code>POST https:/<wbr/>/<wbr/>github.com/<wbr/>login/<wbr/>oauth/<wbr/>access_token</code>. For example, if the starting interval required at least 5 seconds between requests and you get a <code>slow_down</code> error response, you must now wait a minimum of 10 seconds before making a new request for a token. The error response includes the new <code>interval</code> that you must use.</td></tr><tr><td><code>expired_token</code></td><td>If the device code expired, then you will see the <code>token_expired</code> error. You must make a new request for a device code.</td></tr><tr><td><code>unsupported_grant_<wbr/>type</code></td><td>The grant type must be <code>urn:ietf:params:oauth:grant-type:device_<wbr/>code</code> and included as an input parameter when you poll the OAuth token request <code>POST https:/<wbr/>/<wbr/>github.com/<wbr/>login/<wbr/>oauth/<wbr/>access_token</code>.</td></tr><tr><td><code>incorrect_client_<wbr/>credentials</code></td><td>For the device flow, you must pass your app&#x27;s client ID, which you can find on your app settings page. The client ID is different from the app ID and client secret.</td></tr><tr><td><code>incorrect_device_<wbr/>code</code></td><td>The <code>device_code</code> provided is not valid.</td></tr><tr><td><code>access_denied</code></td><td>When a user clicks cancel during the authorization process, you&#x27;ll receive an <code>access_denied</code> error, and the user won&#x27;t be able to use the verification code again.</td></tr><tr><td><code>device_flow_disabled</code></td><td>Device flow has not been enabled in the app&#x27;s settings. For more information on enabling device flow, see <a href="/en/apps/maintaining-github-apps/modifying-a-github-app-registration">Modifying a GitHub App registration</a>.</td></tr></tbody></table>
</li>
<li>
<p>Once the user has entered the <code>user_code</code>, GitHub will give a response that includes the following query parameters:</p>








































<table><thead><tr><th scope="col">Response parameter</th><th scope="col">Type</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>access_token</code></td><td><code>string</code></td><td>The user access token. The token starts with <code>ghu_</code>.</td></tr><tr><td><code>expires_in</code></td><td><code>integer</code></td><td>The number of seconds until <code>access_token</code> expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be <code>28800</code> (8 hours).</td></tr><tr><td><code>refresh_token</code></td><td><code>string</code></td><td>The refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with <code>ghr_</code>.</td></tr><tr><td><code>refresh_token_<wbr/>expires_in</code></td><td><code>integer</code></td><td>The number of seconds until <code>refresh_token</code> expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be <code>15897600</code> (6 months).</td></tr><tr><td><code>scope</code></td><td><code>string</code></td><td>The scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have.</td></tr><tr><td><code>token_type</code></td><td><code>string</code></td><td>The type of token. The value will always be <code>bearer</code>.</td></tr></tbody></table>
</li>
<li>
<p>Use the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the <code>Authorization</code> header of an API request. For example:</p>
<pre><code class="hljs language-shell">curl --request GET \
--url &quot;https://api.github.com/user&quot; \
--header &quot;Accept: application/vnd.github+json&quot; \
--header &quot;Authorization: Bearer USER_ACCESS_TOKEN&quot; \
--header &quot;X-GitHub-Api-Version: 2026-03-10&quot;
</code></pre>
</li>
</ol>
<h2 id="generating-a-user-access-token-when-a-user-installs-your-app" tabindex="-1"><a class="heading-link" href="#generating-a-user-access-token-when-a-user-installs-your-app">Generating a user access token when a user installs your app<span class="heading-link-symbol" aria-hidden="true"></span></a></h2>
<p>If you select <strong>Request user authorization (OAuth) during installation</strong> in your app settings, GitHub will start the web application flow immediately after a user installs your app.</p>
<p>You can generate a user access token with this method regardless of whether the app is installed on a user account or an organization account. However, if the app was installed on an organization account, you will need to use the web application flow or device flow to generate a user access token for other users in the organization.</p>
<ol>
<li>
<p>When a user installs your app, GitHub will redirect the user to <code>https://github.com/login/oauth/authorize?client_id=CLIENT_ID</code>, where <code>CLIENT_ID</code> is the client ID of your app.</p>
</li>
<li>
<p>If the user accepts your authorization request, GitHub will redirect the user to the first callback URL in your app settings, and provide a <code>code</code> query parameter.</p>
<p>If you want to control which callback URL is used, do not select <strong>Request user authorization (OAuth) during installation</strong>. Instead, direct users through the full web application flow and specify the <code>redirect_uri</code> parameter.</p>
</li>
<li>
<p>Exchange the <code>code</code> from the previous step for a user access token by making a <code>POST</code> request to this URL, along with the following query parameters: <code>https://github.com/login/oauth/access_token</code></p>








































<table><thead><tr><th scope="col">Query parameter</th><th scope="col">Type</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>client_id</code></td><td><code>string</code></td><td><strong>Required.</strong> The client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see <a href="/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings">Modifying a GitHub App registration</a>.</td></tr><tr><td><code>client_secret</code></td><td><code>string</code></td><td><strong>Required.</strong> The client secret for your GitHub App. You can generate a client secret on the settings page for your app.</td></tr><tr><td><code>code</code></td><td><code>string</code></td><td><strong>Required.</strong> The code you received in the previous step.</td></tr><tr><td><code>redirect_uri</code></td><td><code>string</code></td><td>The URL in your application where users will be sent after authorization. This must match one of the URLs you provided as a &quot;Callback URL&quot; when setting up your GitHub App. For more information, see <a href="/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url">About the user authorization callback URL</a>.</td></tr><tr><td><code>code_verifier</code></td><td><code>string</code></td><td><strong>Strongly recommended.</strong> Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if <code>code_challenge</code> was sent during the user authorization. Must be the original value used to generate the <code>code_challenge</code> in the authorization request. This can be stored in a cookie alongside the <code>state</code> parameter or in a session variable during authentication, depending on your application architecture.</td></tr><tr><td><code>repository_id</code></td><td><code>string</code></td><td>The ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further.</td></tr></tbody></table>
</li>
<li>
<p>GitHub will give a response that includes the following parameters:</p>








































<table><thead><tr><th scope="col">Response parameter</th><th scope="col">Type</th><th scope="col">Description</th></tr></thead><tbody><tr><td><code>access_token</code></td><td><code>string</code></td><td>The user access token. The token starts with <code>ghu_</code>.</td></tr><tr><td><code>expires_in</code></td><td><code>integer</code></td><td>The number of seconds until <code>access_token</code> expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be <code>28800</code> (8 hours).</td></tr><tr><td><code>refresh_token</code></td><td><code>string</code></td><td>The refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with <code>ghr_</code>.</td></tr><tr><td><code>refresh_token_<wbr/>expires_in</code></td><td><code>integer</code></td><td>The number of seconds until <code>refresh_token</code> expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be <code>15897600</code> (6 months).</td></tr><tr><td><code>scope</code></td><td><code>string</code></td><td>The scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have.</td></tr><tr><td><code>token_type</code></td><td><code>string</code></td><td>The type of token. The value will always be <code>bearer</code>.</td></tr></tbody></table>
</li>
<li>
<p>Use the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the <code>Authorization</code> header of an API request. For example:</p>
<pre><code class="hljs language-shell">curl --request GET \
--url &quot;https://api.github.com/user&quot; \
--header &quot;Accept: application/vnd.github+json&quot; \
--header &quot;Authorization: Bearer USER_ACCESS_TOKEN&quot; \
--header &quot;X-GitHub-Api-Version: 2026-03-10&quot;
</code></pre>
</li>
</ol>
<h2 id="using-a-refresh-token-to-generate-a-user-access-token" tabindex="-1"><a class="heading-link" href="#using-a-refresh-token-to-generate-a-user-access-token">Using a refresh token to generate a user access token<span class="heading-link-symbol" aria-hidden="true"></span></a></h2>
<p>By default, user access tokens expires after 8 hours. If you receive a user access token with an expiration, you will also receive a refresh token. The refresh token expire after 6 months. You can use this refresh token to regenerate a user access token. For more information, see <a href="/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens">Refreshing user access tokens</a>.</p>
<p>GitHub strongly encourages you to use user access tokens that expire. If you previously opted out of using user access tokens that expire but want to re-enable this feature, see <a href="/en/apps/maintaining-github-apps/activating-optional-features-for-github-apps">Activating optional features for GitHub Apps</a>.</p>
<h2 id="troubleshooting" tabindex="-1"><a class="heading-link" href="#troubleshooting">Troubleshooting<span class="heading-link-symbol" aria-hidden="true"></span></a></h2>
<p>The following sections outline some errors you may receive when generating a user access token.</p>
<h3 id="incorrect-client-credentials" tabindex="-1"><a class="heading-link" href="#incorrect-client-credentials">Incorrect client credentials<span class="heading-link-symbol" aria-hidden="true"></span></a></h3>
<p>If the <code>client_id</code> or <code>client_secret</code> that you specify are incorrect, you will receive an <code>incorrect_client_credentials</code> error.</p>
<p>To resolve this error, make sure to use the correct credentials for your GitHub App. You can find the client ID and client secret on the settings page for your GitHub App. For more information about navigating to your GitHub App settings page, see <a href="/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings">Modifying a GitHub App registration</a>.</p>
<h3 id="redirect-uri-mismatch" tabindex="-1"><a class="heading-link" href="#redirect-uri-mismatch">Redirect URI mismatch<span class="heading-link-symbol" aria-hidden="true"></span></a></h3>
<p>If you specify a <code>redirect_uri</code> that doesn&#x27;t match one of the callback URLs in your GitHub App registration, you will receive a <code>redirect_uri_mismatch</code> error.</p>
<p>To resolve this error, either provide a <code>redirect_uri</code> that matches one of the callback URLs for your GitHub App registration, or omit this parameter to default to the first callback URL that is listed on your GitHub App registration. For more information, see <a href="/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url">About the user authorization callback URL</a>.</p>
<h3 id="bad-verification-code" tabindex="-1"><a class="heading-link" href="#bad-verification-code">Bad verification code<span class="heading-link-symbol" aria-hidden="true"></span></a></h3>
<p>If you are using device flow and the verification code (<code>device_code</code>) that you specified is incorrect, expired, or doesn&#x27;t
match the value that you received from the initial request to <code>https://github.com/login/device/code</code>, you will receive a <code>bad_verification_code</code> error.</p>
<p>To resolve this error, you should start the device flow again to get a new code. For more information, see <a href="#using-the-device-flow-to-generate-a-user-access-token">Using the device flow to generate a user access token</a>.</p>
<h3 id="bad-refresh-token" tabindex="-1"><a class="heading-link" href="#bad-refresh-token">Bad refresh token<span class="heading-link-symbol" aria-hidden="true"></span></a></h3>
<p>If the refresh token that you specified is invalid or expired, you will receive a <code>bad_refresh_token</code> error.</p>
<p>To resolve this error, you must restart the web application flow or device flow to get a new user access token and refresh token. You will only receive a refresh token if your GitHub App has opted in to expiring user access tokens. For more information, see <a href="/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens">Refreshing user access tokens</a>.</p>
<h3 id="unsupported-grant-type" tabindex="-1"><a class="heading-link" href="#unsupported-grant-type">Unsupported grant type<span class="heading-link-symbol" aria-hidden="true"></span></a></h3>
<p>When you request a user access token via the device flow, the <code>grant_type</code> parameter must be <code>urn:ietf:params:oauth:grant-type:device_code</code>. When you refresh a user access token by using a refresh token, the <code>grant_type</code> parameter must be <code>refresh_token</code>. If you don&#x27;t use the correct grant type, you will receive an <code>unsupported_grant_type</code> error.</p>
<h3 id="unverified-user-email" tabindex="-1"><a class="heading-link" href="#unverified-user-email">Unverified user email<span class="heading-link-symbol" aria-hidden="true"></span></a></h3>
<p>If the user for whom you are trying to generate a user access token has not verified their primary email address with GitHub, you will receive an <code>unverified_user_email</code> error.</p>
<p>To resolve this error, prompt the user to verify the primary email address on their GitHub account. For more information, see <a href="/en/account-and-profile/how-tos/email-preferences/verifying-your-email-address">Verifying your email address</a>.</p></div></div></div></div></div></main><footer data-container="footer"><section class="container-xl mt-lg-8 mt-6 px-3 px-md-6 no-print mx-auto"><h2 class="f3">Help and support</h2><div class="border-top border-color-secondary pt-6 SupportSection_supportGrid__XXBdA"><form class="Survey_underlineLinks__Z2RJW f5" data-testid="survey-form" aria-live="polite"><h3 id="survey-title" class="f4 mb-3">Did you find what you needed?</h3><input type="text" class="d-none" name="survey-token" value=""/><div class="mb-2" role="radiogroup" aria-labelledby="survey-title"><input class="Survey_visuallyHidden__Xh_nl Survey_customRadio__aNqUl" id="survey-yes" type="radio" aria-label="Yes" name="survey-vote" value="Y"/><label class="btn mr-1" for="survey-yes"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-thumbsup color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8.347.631A.75.75 0 0 1 9.123.26l.238.04a3.25 3.25 0 0 1 2.591 4.098L11.494 6h.665a3.25 3.25 0 0 1 3.118 4.167l-1.135 3.859A2.751 2.751 0 0 1 11.503 16H6.586a3.75 3.75 0 0 1-2.184-.702A1.75 1.75 0 0 1 3 16H1.75A1.75 1.75 0 0 1 0 14.25v-6.5C0 6.784.784 6 1.75 6h3.417a.25.25 0 0 0 .217-.127ZM4.75 13.649l.396.33c.404.337.914.521 1.44.521h4.917a1.25 1.25 0 0 0 1.2-.897l1.135-3.859A1.75 1.75 0 0 0 12.159 7.5H10.5a.75.75 0 0 1-.721-.956l.731-2.558a1.75 1.75 0 0 0-1.127-2.14L6.69 6.611a1.75 1.75 0 0 1-1.523.889H4.75ZM3.25 7.5h-1.5a.25.25 0 0 0-.25.25v6.5c0 .138.112.25.25.25H3a.25.25 0 0 0 .25-.25Z"></path></svg> <!-- -->Yes</label><input class="Survey_visuallyHidden__Xh_nl Survey_customRadio__aNqUl" id="survey-no" type="radio" aria-label="No" name="survey-vote" value="N"/><label class="btn" for="survey-no"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-thumbsdown color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M7.653 15.369a.75.75 0 0 1-.776.371l-.238-.04a3.25 3.25 0 0 1-2.591-4.099L4.506 10h-.665A3.25 3.25 0 0 1 .723 5.833l1.135-3.859A2.75 2.75 0 0 1 4.482 0H9.43c.78.003 1.538.25 2.168.702A1.752 1.752 0 0 1 12.989 0h1.272A1.75 1.75 0 0 1 16 1.75v6.5A1.75 1.75 0 0 1 14.25 10h-3.417a.25.25 0 0 0-.217.127ZM11.25 2.351l-.396-.33a2.248 2.248 0 0 0-1.44-.521H4.496a1.25 1.25 0 0 0-1.199.897L2.162 6.256A1.75 1.75 0 0 0 3.841 8.5H5.5a.75.75 0 0 1 .721.956l-.731 2.558a1.75 1.75 0 0 0 1.127 2.14L9.31 9.389a1.75 1.75 0 0 1 1.523-.889h.417Zm1.5 6.149h1.5a.25.25 0 0 0 .25-.25v-6.5a.25.25 0 0 0-.25-.25H13a.25.25 0 0 0-.25.25Z"></path></svg> <!-- -->No</label></div><a rel="" class="f6" target="_blank" href="/en/site-policy/privacy-policies/github-privacy-statement">Privacy policy</a></form><div class="f5 contribution"><h3 class="f4 mb-3">Help us make these docs great!</h3><p class="max-w-xs color-fg-muted mb-3">All GitHub docs are open source. See something that&#x27;s wrong or unclear? Submit a pull request.</p><a class="btn" href="https://github.com/github/docs/blob/main/content/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app.md"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-git-pull-request octicon mr-1" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg>Make a contribution</a><p class="color-fg-muted f6 mt-2"><a class="text-underline" href="/contributing" target="_blank" rel="noopener">Learn how to contribute</a></p></div><div><h3 class="mb-3 f4">Still need help?</h3><div class="mb-2"><a id="ask-community" href="https://github.com/orgs/community/discussions" class="text-underline"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-people octicon mr-1" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 5.5a3.5 3.5 0 1 1 5.898 2.549 5.508 5.508 0 0 1 3.034 4.084.75.75 0 1 1-1.482.235 4 4 0 0 0-7.9 0 .75.75 0 0 1-1.482-.236A5.507 5.507 0 0 1 3.102 8.05 3.493 3.493 0 0 1 2 5.5ZM11 4a3.001 3.001 0 0 1 2.22 5.018 5.01 5.01 0 0 1 2.56 3.012.749.749 0 0 1-.885.954.752.752 0 0 1-.549-.514 3.507 3.507 0 0 0-2.522-2.372.75.75 0 0 1-.574-.73v-.352a.75.75 0 0 1 .416-.672A1.5 1.5 0 0 0 11 5.5.75.75 0 0 1 11 4Zm-5.5-.5a2 2 0 1 0-.001 3.999A2 2 0 0 0 5.5 3.5Z"></path></svg>Ask the GitHub community</a></div><div><a id="support" href="https://support.github.com" class="text-underline"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-comment-discussion octicon mr-1" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path></svg>Contact support</a></div></div></div></section><section class="container-xl px-3 mt-6 pb-8 px-md-6 color-fg-muted"><h2 class="f4 mb-2 col-12">Legal</h2><ul role="list" class="d-flex flex-wrap list-style-none"><li role="listitem" class="mr-3">© <!-- -->2026<!-- --> GitHub, Inc.</li><li role="listitem" class="mr-3"><a class="text-underline" href="/en/site-policy/github-terms/github-terms-of-service">Terms</a></li><li role="listitem" class="mr-3"><a class="text-underline" href="/en/site-policy/privacy-policies/github-privacy-statement">Privacy</a></li><li role="listitem" class="mr-3"><a class="text-underline" href="https://www.githubstatus.com/">Status</a></li><li role="listitem" class="mr-3"><a class="text-underline" href="https://github.com/pricing">Pricing</a></li><li role="listitem" class="mr-3"><a class="text-underline" href="https://services.github.com">Expert services</a></li><li role="listitem" class="mr-3"><a class="text-underline" href="https://github.blog">Blog</a></li></ul></section><div role="tooltip" class="position-fixed bottom-0 mb-4 right-0 mr-4 z-1 ScrollButton_transition200__rLxBo ScrollButton_opacity0__vjKQD ScrollButton_scrollWrapper__Vk_CC" aria-hidden="true"><button tabindex="-1" class="ghd-scroll-to-top tooltipped tooltipped-n tooltipped-no-delay btn circle border-1 d-flex flex-items-center flex-justify-center ScrollButton_customFocus__L3FsX ScrollButton_scrollButton__N0now" aria-label="Scroll to top"><svg data-component="Octicon" aria-hidden="true" focusable="false" class="octicon octicon-chevron-up" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.22 10.53a.749.749 0 0 1 0-1.06l4.25-4.25a.749.749 0 0 1 1.06 0l4.25 4.25a.749.749 0 1 1-1.06 1.06L8 6.811 4.28 10.53a.749.749 0 0 1-1.06 0Z"></path></svg></button></div></footer></div></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"mainContext":{"allVersions":{"free-pro-team@latest":{"version":"free-pro-team@latest","versionTitle":"Free, Pro, \u0026 Team","apiVersions":["2026-03-10","2022-11-28"],"latestApiVersion":"2026-03-10"},"enterprise-cloud@latest":{"version":"enterprise-cloud@latest","versionTitle":"Enterprise Cloud","apiVersions":["2026-03-10","2022-11-28"],"latestApiVersion":"2026-03-10"},"enterprise-server@3.22":{"version":"enterprise-server@3.22","versionTitle":"Enterprise Server 3.22","apiVersions":["2026-03-10","2022-11-28"],"latestApiVersion":"2026-03-10","isGHES":true},"enterprise-server@3.21":{"version":"enterprise-server@3.21","versionTitle":"Enterprise Server 3.21","apiVersions":["2026-03-10","2022-11-28"],"latestApiVersion":"2026-03-10","isGHES":true},"enterprise-server@3.20":{"version":"enterprise-server@3.20","versionTitle":"Enterprise Server 3.20","apiVersions":["2022-11-28"],"latestApiVersion":"2022-11-28","isGHES":true},"enterprise-server@3.19":{"version":"enterprise-server@3.19","versionTitle":"Enterprise Server 3.19","apiVersions":["2022-11-28"],"latestApiVersion":"2022-11-28","isGHES":true},"enterprise-server@3.18":{"version":"enterprise-server@3.18","versionTitle":"Enterprise Server 3.18","apiVersions":["2022-11-28"],"latestApiVersion":"2022-11-28","isGHES":true},"enterprise-server@3.17":{"version":"enterprise-server@3.17","versionTitle":"Enterprise Server 3.17","apiVersions":["2022-11-28"],"latestApiVersion":"2022-11-28","isGHES":true}},"breadcrumbs":[{"href":"/en/apps","title":"Apps"},{"href":"/en/apps/creating-github-apps","title":"Creating GitHub Apps"},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app","title":"Authenticate with a GitHub App"},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app","title":"Generate a user access token"}],"communityRedirect":{},"currentCategory":"creating-github-apps","currentLayoutName":"default","currentPathWithoutLanguage":"/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app","currentProduct":{"id":"apps","name":"Apps","href":"/apps","dir":"content/apps","toc":"content/apps/index.md","wip":false,"hidden":false,"versions":["free-pro-team@latest","enterprise-cloud@latest","enterprise-server@3.22","enterprise-server@3.21","enterprise-server@3.20","enterprise-server@3.19","enterprise-server@3.18","enterprise-server@3.17"]},"currentProductName":"Apps","currentProductTree":null,"currentVersion":"free-pro-team@latest","data":{"ui":{"alerts":{"NOTE":"Note","IMPORTANT":"Important","WARNING":"Warning","TIP":"Tip","CAUTION":"Caution"},"header":{"github_docs":"GitHub Docs","contact":"Contact","notices":{"release_candidate":" is currently available as a \u003ca href=\"/admin/overview/about-upgrades-to-new-releases\"\u003erelease candidate\u003c/a\u003e.","early_access":"📣 Please \u003cb\u003edo not share\u003c/b\u003e this URL publicly. This page contains content about a private preview feature.","release_notes_use_latest":"Please use the latest release for the latest security, performance, and bug fixes.","machine_translation":"Some of this page may have been machine-translated or translated using AI.","ghes_release_notes_upgrade_patch_only":"📣 This is not the \u003ca href=\"#{{ latestPatch }}\"\u003elatest patch release\u003c/a\u003e of Enterprise Server.","ghes_release_notes_upgrade_release_only":"📣 This is not the \u003ca href=\"/enterprise-server@{{ latestRelease }}/admin/release-notes\"\u003elatest release\u003c/a\u003e of Enterprise Server.","ghes_release_notes_upgrade_patch_and_release":"📣 This is not the \u003ca href=\"#{{ latestPatch }}\"\u003elatest patch release\u003c/a\u003e of this release series, and this is not the \u003ca href=\"/enterprise-server@{{ latestRelease }}/admin/release-notes\"\u003elatest release\u003c/a\u003e of Enterprise Server."},"sign_up_cta":"Sign up","menu":"Menu","open_menu_label":"Open menu","go_home":"Home","collapse_sidebar":"Collapse sidebar","expand_sidebar":"Expand sidebar","scroll_breadcrumbs_left":"Scroll breadcrumbs left","scroll_breadcrumbs_right":"Scroll breadcrumbs right"},"search":{"input":{"placeholder":"Search or ask {{icon}} Copilot","placeholder_no_icon":"Search or ask Copilot","shortcut":"Type {{icon}} to search"},"overlay":{"aria_label":"Search overlay","input_aria_label":"Search or ask Copilot","suggestions_list_aria_label":"Search suggestions","ai_suggestions_list_aria_label":"Copilot search suggestions","general_suggestions_list_aria_label":"Docs search suggestions","general_suggestions_list_heading":"Search docs","ai_autocomplete_list_heading":"Ask Copilot","give_feedback":"Give feedback","beta_tag":"Beta","return_to_search":"Return to search","clear_search_query":"Clear","view_all_search_results":"View more results","no_results_found":"No results found","no_results_found_announcement":"Search Docs: No results found","search_docs_with_query":"Search docs for \"{{query}}\"","privacy_disclaimer":"For product and service improvement purposes, the GitHub Docs team will retain questions and answers generated in the Docs search function. Please see the \u003ca href=\"https://docs.github.com/privacy\"\u003e\u003cu\u003eGitHub Privacy Statement\u003c/u\u003e\u003c/a\u003e to review how GitHub collects and uses your data."},"ai":{"disclaimer":"\u003ca href=\"https://docs.github.com/en/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-chat-in-githubcom\"\u003eCopilot\u003c/a\u003e uses AI. Check for mistakes.","references":"Copilot Sources","loading_status_message":"Loading Copilot response...","done_loading_status_message":"Done loading Copilot response","share_answer":"Copy answer URL","share_copied_announcement":"Copied share URL!","thumbs_up":"This answer was helpful","thumbs_down":"This answer was not helpful","thumbs_announcement":"Thank you for your feedback!","back_to_search":"Back to search","responses":{"unable_to_answer":"Sorry, I'm unable to answer that question. Check that you selected the correct GitHub version or try a different question.","query_too_large":"Sorry, your question is too long. Please try shortening it and asking again.","asked_too_many_times":"Sorry, you've asked too many questions in a short time period. Please wait a few minutes and try again.","invalid_query":"Sorry, I'm unable to answer that question. Please try asking a different question."},"response":{"copy_code":"Copy code to clipboard","copy_code_lang":"Copy {language} code to clipboard","copied_code":"Copied!"}},"failure":{"general_title":"There was an error loading search results.","ai_title":"There was an error loading Copilot.","description":"You can still use this field to search our docs."}},"old_search":{"description":"Enter a search term to find it in the GitHub Docs.","placeholder":"Search GitHub Docs","label":"Search GitHub Docs"},"survey":{"able_to_find":"Did you find what you needed?","yes":"Yes","no":"No","cancel":"Cancel","additional_feedback":"Can you tell us more about your rating? (Optional)","optional":"Optional","required":"Required","email_label":"Leave your email if we can contact you. (Optional)","email_validation":"Please enter a valid email address","send":"Send","feedback":"Thank you! We received your feedback.","not_support":"If you need a reply, please contact \u003ca href=\"https://support.github.com/\"\u003esupport\u003c/a\u003e.","privacy_policy":"Privacy policy","server_error":"Unable to process comment at the moment. Please try again."},"toc":{"getting_started":"Getting started","popular":"Popular","startHere":"Start here","whats_new":"What's new","all_changelogs":"All changelog posts"},"meta":{"default_description":"Get started, troubleshoot, and make the most of GitHub. Documentation for new users, developers, administrators, and all of GitHub's products."},"scroll_button":{"scroll_to_top":"Scroll to top"},"pages":{"article_version":"Article version","miniToc":"In this article","all_enterprise_releases":"All Enterprise Server releases","about_versions":"About versions","permissions_callout_title":"Who can use this feature?","copy_as_markdown":"Copy as Markdown","copy_as_markdown_desc":"Use with any LLM","view_as_markdown":"View as Markdown","view_as_markdown_desc":"Open page in another tab","ask_copilot":"Ask Copilot","ask_copilot_desc":"Open directly in Copilot Chat","more_markdown_options":"More Markdown options","opens_in_new_tab":"(opens in new tab)","copied":"Copied!"},"picker":{"language_picker_label":"Language","product_picker_default_text":"All products","version_picker_default_text":"Choose a version"},"footer":{"support_heading":"Help and support","legal_heading":"Legal","imprint":"Imprint","terms":"Terms","privacy":"Privacy","status":"Status","pricing":"Pricing","expert_services":"Expert services","blog":"Blog","machine":"Some of this content may be machine- or AI-translated."},"contribution_cta":{"title":"Help us make these docs great!","body":"All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.","button":"Make a contribution","to_guidelines":"Learn how to contribute"},"support":{"still_need_help":"Still need help?","contact_support":"Contact support","ask_community":"Ask the GitHub community"},"rest":{"banner":{"api_versioned":"The REST API is now versioned.","api_version_info":"For more information, see \"\u003ca href=\"{{ versionWithApiVersion }}/rest/overview/api-versions\"\u003eAbout API versioning\u003c/a\u003e.\"","ghes_api_versioned":"After a site administrator upgrades your Enterprise Server instance to {{ firstGhesReleaseWithApiVersions.versionTitle }} or later, the REST API will be versioned. To learn how to find your instance's version, see \"\u003ca href=\"/{{ currentVersion }}/get-started/learning-about-github/about-versions-of-github-docs#github-enterprise-server\"\u003eAbout versions of GitHub Docs\u003c/a\u003e\".","redirect_notice":"We've recently moved some of the REST API documentation.","redirect_repo":"If you can't find what you're looking for, you might try the new {{ newRestPagesLinks }} REST API pages.","redirect_enterprise":"If you can't find what you're looking for, you might try the {{ actionsPageLink }} REST API page.","actions_api_title":"Actions"},"versioning":{"about_versions":"About REST API versions"},"overview":{"permissions":{"access":"Access","endpoints":"Endpoint","tokens":"Token types","additionalPermissions":"Additional permissions","uat":"UAT","iat":"IAT"}},"screen_reader_text_checkmark_icon":"Multiple permissions are required, or a different permission may be used. For more information about the permissions, see the documentation for this endpoint."},"cookbook_landing":{"spotlight":"Spotlight","explore_articles":"Explore {{ number }} examples","reset_filters":"Reset filters","search_articles":"Search examples","category":"Category","complexity":"Complexity","surface":"Surface"},"code_tabs":{"aria_label":"Code languages"},"popovers":{"role_description":"hovercard link"}},"reusables":{},"variables":{"release_candidate":{"version":"enterprise-server@3.22"}}},"enterpriseServerReleases":{"isOldestReleaseDeprecated":false,"oldestSupported":"3.17","nextDeprecationDate":"2026-08-25","supported":["3.22","3.21","3.20","3.19","3.18","3.17"],"releasesWithOldestDeprecationDate":["3.17"]},"enterpriseServerVersions":["enterprise-server@3.22","enterprise-server@3.21","enterprise-server@3.20","enterprise-server@3.19","enterprise-server@3.18","enterprise-server@3.17"],"error":"","featureFlags":{},"fullUrl":"https://docs-internal.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app","isHomepageVersion":false,"nonEnterpriseDefaultVersion":"free-pro-team@latest","page":{"documentType":"article","contentType":null,"title":"Generating a user access token for a GitHub App","fullTitle":"Generating a user access token for a GitHub App - GitHub Docs","introPlainText":"You can generate a user access token for your GitHub App in order to attribute app activity to a user.","applicableVersions":["free-pro-team@latest","enterprise-cloud@latest","enterprise-server@3.22","enterprise-server@3.21","enterprise-server@3.20","enterprise-server@3.19","enterprise-server@3.18","enterprise-server@3.17"],"hidden":false,"noEarlyAccessBanner":false,"docsTeamMetrics":null},"relativePath":"apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app.md","sidebarTree":{"href":"/en/apps","title":"Apps","childPages":[{"href":"/en/apps/overview","title":"Overview","childPages":[]},{"href":"/en/apps/using-github-apps","title":"Using GitHub Apps","childPages":[{"href":"/en/apps/using-github-apps/about-using-github-apps","title":"About using apps","childPages":[]},{"href":"/en/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-personal-account","title":"Install from Marketplace for user","childPages":[]},{"href":"/en/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-organizations","title":"Install from Marketplace for org","childPages":[]},{"href":"/en/apps/using-github-apps/installing-a-github-app-from-a-third-party","title":"Install from third party","childPages":[]},{"href":"/en/apps/using-github-apps/installing-your-own-github-app","title":"Install your own app","childPages":[]},{"href":"/en/apps/using-github-apps/requesting-a-github-app-from-your-organization-owner","title":"Request for org","childPages":[]},{"href":"/en/apps/using-github-apps/authorizing-github-apps","title":"Authorize","childPages":[]},{"href":"/en/apps/using-github-apps/approving-updated-permissions-for-a-github-app","title":"Approve new permissions","childPages":[]},{"href":"/en/apps/using-github-apps/reviewing-and-revoking-authorization-of-github-apps","title":"Review your authorizations","childPages":[]},{"href":"/en/apps/using-github-apps/reviewing-and-modifying-installed-github-apps","title":"Review installations","childPages":[]},{"href":"/en/apps/using-github-apps/privileged-github-apps","title":"Privileged apps","childPages":[]}]},{"href":"/en/apps/creating-github-apps","title":"Creating GitHub Apps","childPages":[{"href":"/en/apps/creating-github-apps/about-creating-github-apps","title":"About creating GitHub Apps","childPages":[{"href":"/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps","title":"About creating apps","childPages":[]},{"href":"/en/apps/creating-github-apps/about-creating-github-apps/deciding-when-to-build-a-github-app","title":"GitHub App versus other options","childPages":[]},{"href":"/en/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-app","title":"Best practices","childPages":[]},{"href":"/en/apps/creating-github-apps/about-creating-github-apps/migrating-oauth-apps-to-github-apps","title":"Migrate from OAuth apps","childPages":[]}]},{"href":"/en/apps/creating-github-apps/registering-a-github-app","title":"Registering a GitHub App","childPages":[{"href":"/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app","title":"Register a GitHub App","childPages":[]},{"href":"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url","title":"Callback URLs","childPages":[]},{"href":"/en/apps/creating-github-apps/registering-a-github-app/about-the-setup-url","title":"Setup URL","childPages":[]},{"href":"/en/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app","title":"Permissions","childPages":[]},{"href":"/en/apps/creating-github-apps/registering-a-github-app/using-webhooks-with-github-apps","title":"Webhooks","childPages":[]},{"href":"/en/apps/creating-github-apps/registering-a-github-app/making-a-github-app-public-or-private","title":"Visibility","childPages":[]},{"href":"/en/apps/creating-github-apps/registering-a-github-app/rate-limits-for-github-apps","title":"Rate limits","childPages":[]},{"href":"/en/apps/creating-github-apps/registering-a-github-app/creating-a-custom-badge-for-your-github-app","title":"Custom badge","childPages":[]}]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app","title":"Authenticate with a GitHub App","childPages":[{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app","title":"About authentication","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app","title":"Authenticate as an app","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation","title":"Authenticate as an installation","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-with-a-github-app-on-behalf-of-a-user","title":"Authenticate on behalf of users","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps","title":"Manage private keys","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app","title":"Generate a JWT","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app","title":"Generate an installation access token","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app","title":"Generate a user access token","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens","title":"Refresh user access tokens","childPages":[]},{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow","title":"Authenticate in Actions workflow","childPages":[]}]},{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app","title":"Writing code for a GitHub App","childPages":[{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app/about-writing-code-for-a-github-app","title":"About writing GitHub App code","childPages":[]},{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app/quickstart","title":"Quickstart","childPages":[]},{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-github-app-that-responds-to-webhook-events","title":"Respond to webhooks","childPages":[],"layout":"inline"},{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-login-with-github-button-with-a-github-app","title":"Build a \"Login\" button","childPages":[]},{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-cli-with-a-github-app","title":"Build a CLI","childPages":[]},{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app/building-ci-checks-with-a-github-app","title":"Build CI checks","childPages":[]}]}]},{"href":"/en/apps/sharing-github-apps","title":"Sharing GitHub Apps","childPages":[{"href":"/en/apps/sharing-github-apps/sharing-your-github-app","title":"Share your app","childPages":[]},{"href":"/en/apps/sharing-github-apps/making-your-github-app-available-for-github-enterprise-server","title":"Share with GHES","childPages":[]},{"href":"/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest","title":"App manifest","childPages":[]},{"href":"/en/apps/sharing-github-apps/registering-a-github-app-using-url-parameters","title":"App query parameters","childPages":[]}]},{"href":"/en/apps/maintaining-github-apps","title":"Maintaining GitHub Apps","childPages":[{"href":"/en/apps/maintaining-github-apps/modifying-a-github-app-registration","title":"Modify app settings","childPages":[]},{"href":"/en/apps/maintaining-github-apps/activating-optional-features-for-github-apps","title":"Activate optional features","childPages":[]},{"href":"/en/apps/maintaining-github-apps/about-github-app-managers","title":"GitHub App managers","childPages":[]},{"href":"/en/apps/maintaining-github-apps/managing-allowed-ip-addresses-for-a-github-app","title":"Manage allowed IP addresses","childPages":[]},{"href":"/en/apps/maintaining-github-apps/suspending-a-github-app-installation","title":"Suspend an installation","childPages":[]},{"href":"/en/apps/maintaining-github-apps/transferring-ownership-of-a-github-app","title":"Transfer ownership","childPages":[]},{"href":"/en/apps/maintaining-github-apps/deleting-a-github-app","title":"Delete your app","childPages":[]}]},{"href":"/en/apps/github-marketplace","title":"GitHub Marketplace","childPages":[{"href":"/en/apps/github-marketplace/github-marketplace-overview","title":"Overview","childPages":[{"href":"/en/apps/github-marketplace/github-marketplace-overview/about-github-marketplace-for-apps","title":"About GitHub Marketplace for apps","childPages":[]},{"href":"/en/apps/github-marketplace/github-marketplace-overview/about-marketplace-badges","title":"About marketplace badges","childPages":[]},{"href":"/en/apps/github-marketplace/github-marketplace-overview/applying-for-publisher-verification-for-your-organization","title":"Publisher verification","childPages":[]}]},{"href":"/en/apps/github-marketplace/creating-apps-for-github-marketplace","title":"Create Marketplace apps","childPages":[{"href":"/en/apps/github-marketplace/creating-apps-for-github-marketplace/requirements-for-listing-an-app","title":"Listing requirements","childPages":[]},{"href":"/en/apps/github-marketplace/creating-apps-for-github-marketplace/security-best-practices-for-apps-on-github-marketplace","title":"Security best practice","childPages":[]},{"href":"/en/apps/github-marketplace/creating-apps-for-github-marketplace/customer-experience-best-practices-for-apps","title":"Customer experience best practice","childPages":[]},{"href":"/en/apps/github-marketplace/creating-apps-for-github-marketplace/viewing-metrics-for-your-listing","title":"View listing metrics","childPages":[]},{"href":"/en/apps/github-marketplace/creating-apps-for-github-marketplace/viewing-transactions-for-your-listing","title":"View listing transactions","childPages":[]}]},{"href":"/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app","title":"Marketplace API usage","childPages":[{"href":"/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/rest-endpoints-for-the-github-marketplace-api","title":"REST API","childPages":[]},{"href":"/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/webhook-events-for-the-github-marketplace-api","title":"Webhook events","childPages":[]},{"href":"/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/testing-your-app","title":"Testing your app","childPages":[]},{"href":"/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-new-purchases-and-free-trials","title":"New purchases \u0026 free trials","childPages":[]},{"href":"/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-plan-changes","title":"Handling plan changes","childPages":[]},{"href":"/en/apps/github-marketplace/using-the-github-marketplace-api-in-your-app/handling-plan-cancellations","title":"Plan cancellations","childPages":[]}]},{"href":"/en/apps/github-marketplace/listing-an-app-on-github-marketplace","title":"List an app on the Marketplace","childPages":[{"href":"/en/apps/github-marketplace/listing-an-app-on-github-marketplace/drafting-a-listing-for-your-app","title":"Draft an app listing","childPages":[]},{"href":"/en/apps/github-marketplace/listing-an-app-on-github-marketplace/writing-a-listing-description-for-your-app","title":"Write listing descriptions","childPages":[]},{"href":"/en/apps/github-marketplace/listing-an-app-on-github-marketplace/setting-pricing-plans-for-your-listing","title":"Set listing pricing plans","childPages":[]},{"href":"/en/apps/github-marketplace/listing-an-app-on-github-marketplace/configuring-a-webhook-to-notify-you-of-plan-changes","title":"Webhooks for plan changes","childPages":[]},{"href":"/en/apps/github-marketplace/listing-an-app-on-github-marketplace/submitting-your-listing-for-publication","title":"Submit your listing","childPages":[]},{"href":"/en/apps/github-marketplace/listing-an-app-on-github-marketplace/deleting-your-app-listing-from-github-marketplace","title":"Delete your listing","childPages":[]}]},{"href":"/en/apps/github-marketplace/selling-your-app-on-github-marketplace","title":"Sell apps on the Marketplace","childPages":[{"href":"/en/apps/github-marketplace/selling-your-app-on-github-marketplace/pricing-plans-for-github-marketplace-apps","title":"Pricing plans for apps","childPages":[]},{"href":"/en/apps/github-marketplace/selling-your-app-on-github-marketplace/billing-customers","title":"Billing customers","childPages":[]},{"href":"/en/apps/github-marketplace/selling-your-app-on-github-marketplace/receiving-payment-for-app-purchases","title":"Receive payment","childPages":[]}]}]},{"href":"/en/apps/oauth-apps","title":"OAuth apps","childPages":[{"href":"/en/apps/oauth-apps/using-oauth-apps","title":"Using OAuth apps","childPages":[{"href":"/en/apps/oauth-apps/using-oauth-apps/installing-an-oauth-app-in-your-personal-account","title":"Install app personal account","childPages":[]},{"href":"/en/apps/oauth-apps/using-oauth-apps/installing-an-oauth-app-in-your-organization","title":"Install app organization","childPages":[]},{"href":"/en/apps/oauth-apps/using-oauth-apps/authorizing-oauth-apps","title":"Authorizing OAuth apps","childPages":[]},{"href":"/en/apps/oauth-apps/using-oauth-apps/reviewing-your-authorized-oauth-apps","title":"Review OAuth apps","childPages":[]},{"href":"/en/apps/oauth-apps/using-oauth-apps/connecting-with-third-party-applications","title":"Third-party applications","childPages":[]},{"href":"/en/apps/oauth-apps/using-oauth-apps/privileged-oauth-apps","title":"Privileged apps","childPages":[]}]},{"href":"/en/apps/oauth-apps/building-oauth-apps","title":"Building OAuth apps","childPages":[{"href":"/en/apps/oauth-apps/building-oauth-apps/differences-between-github-apps-and-oauth-apps","title":"GitHub Apps \u0026 OAuth apps","childPages":[]},{"href":"/en/apps/oauth-apps/building-oauth-apps/rate-limits-for-oauth-apps","title":"Rate limits","childPages":[]},{"href":"/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app","title":"Creating an OAuth app","childPages":[]},{"href":"/en/apps/oauth-apps/building-oauth-apps/authenticating-to-the-rest-api-with-an-oauth-app","title":"Authenticate with an OAuth app","childPages":[]},{"href":"/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps","title":"Authorizing OAuth apps","childPages":[]},{"href":"/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps","title":"Scopes for OAuth apps","childPages":[]},{"href":"/en/apps/oauth-apps/building-oauth-apps/creating-a-custom-badge-for-your-oauth-app","title":"Create custom badges","childPages":[]},{"href":"/en/apps/oauth-apps/building-oauth-apps/best-practices-for-creating-an-oauth-app","title":"Best practices","childPages":[]}]},{"href":"/en/apps/oauth-apps/maintaining-oauth-apps","title":"Maintaining OAuth apps","childPages":[{"href":"/en/apps/oauth-apps/maintaining-oauth-apps/modifying-an-oauth-app","title":"Modifying an OAuth app","childPages":[]},{"href":"/en/apps/oauth-apps/maintaining-oauth-apps/activating-optional-features-for-oauth-apps","title":"Activate optional features","childPages":[]},{"href":"/en/apps/oauth-apps/maintaining-oauth-apps/transferring-ownership-of-an-oauth-app","title":"Transfer ownership","childPages":[]},{"href":"/en/apps/oauth-apps/maintaining-oauth-apps/troubleshooting-authorization-request-errors","title":"Troubleshoot authorization","childPages":[]},{"href":"/en/apps/oauth-apps/maintaining-oauth-apps/troubleshooting-oauth-app-access-token-request-errors","title":"Troubleshoot token request","childPages":[]},{"href":"/en/apps/oauth-apps/maintaining-oauth-apps/deleting-an-oauth-app","title":"Deleting an OAuth app","childPages":[]}]}]},{"href":"/en/apps/github-authentication-discovery-endpoints","title":"OAuth 2.0 and OIDC Discovery documents","childPages":[]}],"layout":"discovery-landing"},"sidebarExpanded":{},"sidebarCollapsed":false,"status":200,"xHost":"docs.github.com"},"articleContext":{"title":"Generating a user access token for a GitHub App","intro":"\u003cp\u003eYou can generate a user access token for your GitHub App in order to attribute app activity to a user.\u003c/p\u003e","effectiveDate":"","renderedPage":"\u003ch2 id=\"about-user-access-tokens\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#about-user-access-tokens\"\u003eAbout user access tokens\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003cdiv class=\"ghd-alert ghd-alert-accent\" data-container=\"alert\"\u003e\u003cp class=\"ghd-alert-title\"\u003e\u003csvg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon mr-2\" aria-hidden\u003e\u003cpath d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"\u003e\u003c/path\u003e\u003c/svg\u003eNote\u003c/p\u003e\n\u003cp\u003e User access tokens that expire are currently an optional feature and are subject to change. To opt in or out of the token expiration feature, see \u003ca href=\"/en/apps/maintaining-github-apps/activating-optional-features-for-github-apps\"\u003eActivating optional features for GitHub Apps\u003c/a\u003e. For more information, see \u003ca href=\"https://developer.github.com/changes/2020-04-30-expiring-user-to-server-access-tokens-for-github-apps\"\u003eExpiring user-to-server access tokens for GitHub Apps\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eIf a user reports that they cannot see resources owned by their organization after authorizing your GitHub App and the organization uses SAML SSO, instruct the user to start an active SAML session for their organization before reauthorizing. For more information, see \u003ca href=\"/en/enterprise-cloud@latest/apps/using-github-apps/saml-and-github-apps\"\u003eSAML and GitHub Apps\u003c/a\u003e in the GitHub Enterprise Cloud documentation.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eA user access token is a type of OAuth token. Unlike a traditional OAuth token, the user access token does not use scopes. Instead, it uses fine-grained permissions. A user access token only has permissions that both the user and the app have. For example, if the app was granted permission to write the contents of a repository, but the user can only read the contents, then the user access token can only read the contents.\u003c/p\u003e\n\u003cp\u003eSimilarly, a user access token can only access resources that both the user and app can access. For example, if an app is granted access to repository \u003ccode\u003eA\u003c/code\u003e and \u003ccode\u003eB\u003c/code\u003e, and the user can access repository \u003ccode\u003eB\u003c/code\u003e and \u003ccode\u003eC\u003c/code\u003e, the user access token can access repository \u003ccode\u003eB\u003c/code\u003e but not \u003ccode\u003eA\u003c/code\u003e or \u003ccode\u003eC\u003c/code\u003e. You can use the REST API to check which installations and which repositories within an installation a user access token can access. For more information, see \u003ccode\u003eGET /user/installations\u003c/code\u003e and \u003ccode\u003eGET /user/installations/{installation_id}/repositories\u003c/code\u003e in \u003ca href=\"/en/rest/apps/installations\"\u003eREST API endpoints for GitHub App installations\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eWhen you make API requests with a user access token, the rate limits for user access tokens apply. For more information, see \u003ca href=\"/en/apps/creating-github-apps/registering-a-github-app/rate-limits-for-github-apps\"\u003eRate limits for GitHub Apps\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eBy default, the user access token expires after 8 hours. You can use a refresh token to regenerate a user access token. For more information, see \u003ca href=\"/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens\"\u003eRefreshing user access tokens\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eUsers can revoke their authorization of a GitHub App. For more information, see \u003ca href=\"/en/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocation\"\u003eToken expiration and revocation\u003c/a\u003e. If a user revokes their authorization of a GitHub App, the app will receive the \u003ccode\u003egithub_app_authorization\u003c/code\u003e webhook. GitHub Apps cannot unsubscribe from this event. If your app receives this webhook, you should stop calling the API on behalf of the user who revoked the token. If your app continues to use a revoked access token, it will receive the \u003ccode\u003e401 Bad Credentials\u003c/code\u003e error. For more information about this webhook, see \u003ca href=\"/en/webhooks/webhook-events-and-payloads#github_app_authorization\"\u003eWebhook events and payloads\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eYou should keep user access tokens and refresh tokens secure. For more information, see \u003ca href=\"/en/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-app\"\u003eBest practices for creating a GitHub App\u003c/a\u003e.\u003c/p\u003e\n\u003ch2 id=\"using-the-web-application-flow-to-generate-a-user-access-token\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#using-the-web-application-flow-to-generate-a-user-access-token\"\u003eUsing the web application flow to generate a user access token\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003cp\u003eIf your app runs in the browser, you should use the web application flow to generate a user access token. For a tutorial about using the web application flow, see \u003ca href=\"/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-login-with-github-button-with-a-github-app\"\u003eBuilding a \"Login with GitHub\" button with a GitHub App\u003c/a\u003e.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eDirect the user to this URL, and add any necessary query parameters from the following list of parameters: \u003ccode\u003ehttps://github.com/login/oauth/authorize\u003c/code\u003e. For example, this URL specifies the \u003ccode\u003eclient_id\u003c/code\u003e and \u003ccode\u003estate\u003c/code\u003e parameters: \u003ccode\u003ehttps://github.com/login/oauth/authorize?client_id=12345\u0026#x26;state=abcdefg\u003c/code\u003e.\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eQuery parameter\u003c/th\u003e\u003cth scope=\"col\"\u003eType\u003c/th\u003e\u003cth scope=\"col\"\u003eRequired?\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eclient_id\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eRequired\u003c/td\u003e\u003ctd\u003eThe client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see \u003ca href=\"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings\"\u003eModifying a GitHub App registration\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eredirect_uri\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eStrongly recommended\u003c/td\u003e\u003ctd\u003eThe URL in your application where users will be sent after authorization. This must be a match to one of the URLs you provided as a \"Callback URL\" in your app's settings and can't contain any additional parameters. For more information, see \u003ca href=\"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url\"\u003eAbout the user authorization callback URL\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003estate\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eStrongly recommended\u003c/td\u003e\u003ctd\u003eWhen specified, the value should contain a random string to protect against forgery attacks, and it can also contain any other arbitrary data.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003ecode_challenge\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eStrongly recommended\u003c/td\u003e\u003ctd\u003eUsed to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if \u003ccode\u003ecode_challenge_\u003cwbr\u003emethod\u003c/code\u003e is included. Must be a 43 character SHA-256 hash of a random string generated by the client. See the \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc7636\"\u003ePKCE RFC\u003c/a\u003e for more details about this security extension.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003ecode_challenge_\u003cwbr\u003emethod\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eStrongly recommended\u003c/td\u003e\u003ctd\u003eUsed to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if \u003ccode\u003ecode_challenge\u003c/code\u003e is included. Must be \u003ccode\u003eS256\u003c/code\u003e - the \u003ccode\u003eplain\u003c/code\u003e code challenge method is not supported.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003elogin\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eOptional\u003c/td\u003e\u003ctd\u003eWhen specified, the web application flow will prompt users with a specific account they can use for signing in and authorizing your app.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eallow_signup\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003eboolean\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eOptional\u003c/td\u003e\u003ctd\u003eWhether unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. The default is \u003ccode\u003etrue\u003c/code\u003e. Use \u003ccode\u003efalse\u003c/code\u003e when a policy prohibits signups.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eprompt\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eOptional\u003c/td\u003e\u003ctd\u003eForces the account picker to appear if set to \u003ccode\u003eselect_account\u003c/code\u003e. The account picker will also appear if the application has a non-HTTP redirect URI or if the user has multiple accounts signed in.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eIf the user accepts your authorization request, GitHub will redirect the user to one of the callback URLs in your app settings, and provide a \u003ccode\u003ecode\u003c/code\u003e query parameter you can use in the next step to create a user access token. If you specified \u003ccode\u003eredirect_uri\u003c/code\u003e in the previous step, that callback URL will be used. Otherwise, the first callback URL on your app's settings page will be used.\u003c/p\u003e\n\u003cp\u003eIf you specified the \u003ccode\u003estate\u003c/code\u003e parameter in the previous step, GitHub will also include a \u003ccode\u003estate\u003c/code\u003e parameter. If the \u003ccode\u003estate\u003c/code\u003e parameter does not match the \u003ccode\u003estate\u003c/code\u003e parameter that you sent in the previous step, the request cannot be trusted, and the web application flow should be aborted.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eExchange the \u003ccode\u003ecode\u003c/code\u003e from the previous step for a user access token by making a \u003ccode\u003ePOST\u003c/code\u003e request to this URL, along with the following query parameters: \u003ccode\u003ehttps://github.com/login/oauth/access_token\u003c/code\u003e\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eQuery parameter\u003c/th\u003e\u003cth scope=\"col\"\u003eType\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eclient_id\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see \u003ca href=\"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings\"\u003eModifying a GitHub App registration\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eclient_secret\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The client secret for your GitHub App. You can generate a client secret on the settings page for your app.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003ecode\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The code you received in the previous step.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eredirect_uri\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe URL in your application where users will be sent after authorization. This must match one of the URLs you provided as a \"Callback URL\" when setting up your GitHub App. For more information, see \u003ca href=\"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url\"\u003eAbout the user authorization callback URL\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003ecode_verifier\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eStrongly recommended.\u003c/strong\u003e Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if \u003ccode\u003ecode_challenge\u003c/code\u003e was sent during the user authorization. Must be the original value used to generate the \u003ccode\u003ecode_challenge\u003c/code\u003e in the authorization request. This can be stored in a cookie alongside the \u003ccode\u003estate\u003c/code\u003e parameter or in a session variable during authentication, depending on your application architecture.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erepository_id\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eGitHub will give a response that includes the following parameters:\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eResponse parameter\u003c/th\u003e\u003cth scope=\"col\"\u003eType\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eaccess_token\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe user access token. The token starts with \u003ccode\u003eghu_\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eexpires_in\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe number of seconds until \u003ccode\u003eaccess_token\u003c/code\u003e expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be \u003ccode\u003e28800\u003c/code\u003e (8 hours).\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erefresh_token\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with \u003ccode\u003eghr_\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erefresh_token_\u003cwbr\u003eexpires_in\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe number of seconds until \u003ccode\u003erefresh_token\u003c/code\u003e expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be \u003ccode\u003e15897600\u003c/code\u003e (6 months).\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003escope\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003etoken_type\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe type of token. The value will always be \u003ccode\u003ebearer\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eUse the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the \u003ccode\u003eAuthorization\u003c/code\u003e header of an API request. For example:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"hljs language-shell\"\u003ecurl --request GET \\\n--url \"https://api.github.com/user\" \\\n--header \"Accept: application/vnd.github+json\" \\\n--header \"Authorization: Bearer USER_ACCESS_TOKEN\" \\\n--header \"X-GitHub-Api-Version: 2026-03-10\"\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"using-the-device-flow-to-generate-a-user-access-token\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#using-the-device-flow-to-generate-a-user-access-token\"\u003eUsing the device flow to generate a user access token\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003cp\u003eIf your app is headless or does not have access to a browser, you should use the device flow to generate a user access token. For example, CLI tools, simple Raspberry Pis, and desktop applications should use the device flow. For a tutorial that uses device flow, see \u003ca href=\"/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-cli-with-a-github-app\"\u003eBuilding a CLI with a GitHub App\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eBefore you can use the device flow, you must first enable it in your app's settings. For more information on enabling device flow, see \u003ca href=\"/en/apps/maintaining-github-apps/modifying-a-github-app-registration\"\u003eModifying a GitHub App registration\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eThe device flow uses the \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc8628\"\u003eOAuth 2.0 Device Authorization Grant\u003c/a\u003e.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eSend a \u003ccode\u003ePOST\u003c/code\u003e request to \u003ccode\u003ehttps://github.com/login/device/code\u003c/code\u003e along with a \u003ccode\u003eclient_id\u003c/code\u003e query parameter. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see \u003ca href=\"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings\"\u003eModifying a GitHub App registration\u003c/a\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eGitHub will give a response that includes the following query parameters:\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eResponse parameter\u003c/th\u003e\u003cth scope=\"col\"\u003eType\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003edevice_code\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eA verification code that is used to verify the device. This code is 40 characters long.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003euser_code\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eA verification code that your application should display so that the user can enter the code in a browser. This code is 8 characters with a hyphen in the middle. For example, \u003ccode\u003eWDJB-MJHT\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003everification_uri\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe URL where users need to enter their \u003ccode\u003euser_code\u003c/code\u003e. The URL is:  \u003ca href=\"https://github.com/login/device\"\u003e\u003ccode\u003ehttps:/\u003cwbr\u003e/\u003cwbr\u003egithub.com/\u003cwbr\u003elogin/\u003cwbr\u003edevice\u003c/code\u003e\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eexpires_in\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe number of seconds before the \u003ccode\u003edevice_code\u003c/code\u003e and \u003ccode\u003euser_code\u003c/code\u003e expire. The default is 900 seconds (15 minutes).\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003einterval\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe minimum number of seconds that must pass before you can make a new access token request (\u003ccode\u003ePOST https:/\u003cwbr\u003e/\u003cwbr\u003egithub.com/\u003cwbr\u003elogin/\u003cwbr\u003eoauth/\u003cwbr\u003eaccess_token\u003c/code\u003e) to complete the device authorization. If you make a request before this interval passes, then you will hit the rate limit and receive a \u003ccode\u003eslow_down\u003c/code\u003e error. The default is 5 seconds.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003ePrompt the user to enter the \u003ccode\u003euser_code\u003c/code\u003e from the previous step at  \u003ca href=\"https://github.com/login/device\"\u003e\u003ccode\u003ehttps://github.com/login/device\u003c/code\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eIf the user does not enter the code before the \u003ccode\u003eexpires_in\u003c/code\u003e time passes, the code will be invalid. In this case, you should restart the device flow.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003ePoll \u003ccode\u003ePOST https://github.com/login/oauth/access_token\u003c/code\u003e along with the \u003ccode\u003eclient_id\u003c/code\u003e, \u003ccode\u003edevice_code\u003c/code\u003e, and \u003ccode\u003egrant_type\u003c/code\u003e query parameters (described below) until the device and user codes expire or the user has successfully authorized the app by entering the \u003ccode\u003euser_code\u003c/code\u003e.\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eQuery parameter\u003c/th\u003e\u003cth scope=\"col\"\u003eType\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eclient_id\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The client ID for your GitHub App.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003edevice_code\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The device verification code you received in the previous step.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003egrant_type\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The grant type must be \u003ccode\u003eurn:ietf:params:oauth:grant-type:device_\u003cwbr\u003ecode\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erepository_id\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003cp\u003eDo not poll this endpoint at a higher frequency than the frequency indicated by \u003ccode\u003einterval\u003c/code\u003e. If you do, you will hit the rate limit and receive a \u003ccode\u003eslow_down\u003c/code\u003e error. The \u003ccode\u003eslow_down\u003c/code\u003e error response adds 5 seconds to the last \u003ccode\u003einterval\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eUntil the user enters the code, GitHub will respond with a 200 status and an \u003ccode\u003eerror\u003c/code\u003e response query parameter.\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eError name\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eauthorization_\u003cwbr\u003epending\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThis error occurs when the authorization request is pending and the user hasn't entered the user code yet. The app is expected to keep polling the \u003ccode\u003ePOST https:/\u003cwbr\u003e/\u003cwbr\u003egithub.com/\u003cwbr\u003elogin/\u003cwbr\u003eoauth/\u003cwbr\u003eaccess_token\u003c/code\u003e at a frequency no faster than the frequency specified by \u003ccode\u003einterval\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eslow_down\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eWhen you receive the \u003ccode\u003eslow_down\u003c/code\u003e error, 5 extra seconds are added to the minimum \u003ccode\u003einterval\u003c/code\u003e or timeframe required between your requests using \u003ccode\u003ePOST https:/\u003cwbr\u003e/\u003cwbr\u003egithub.com/\u003cwbr\u003elogin/\u003cwbr\u003eoauth/\u003cwbr\u003eaccess_token\u003c/code\u003e. For example, if the starting interval required at least 5 seconds between requests and you get a \u003ccode\u003eslow_down\u003c/code\u003e error response, you must now wait a minimum of 10 seconds before making a new request for a token. The error response includes the new \u003ccode\u003einterval\u003c/code\u003e that you must use.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eexpired_token\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eIf the device code expired, then you will see the \u003ccode\u003etoken_expired\u003c/code\u003e error. You must make a new request for a device code.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eunsupported_grant_\u003cwbr\u003etype\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe grant type must be \u003ccode\u003eurn:ietf:params:oauth:grant-type:device_\u003cwbr\u003ecode\u003c/code\u003e and included as an input parameter when you poll the OAuth token request \u003ccode\u003ePOST https:/\u003cwbr\u003e/\u003cwbr\u003egithub.com/\u003cwbr\u003elogin/\u003cwbr\u003eoauth/\u003cwbr\u003eaccess_token\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eincorrect_client_\u003cwbr\u003ecredentials\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eFor the device flow, you must pass your app's client ID, which you can find on your app settings page. The client ID is different from the app ID and client secret.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eincorrect_device_\u003cwbr\u003ecode\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe \u003ccode\u003edevice_code\u003c/code\u003e provided is not valid.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eaccess_denied\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eWhen a user clicks cancel during the authorization process, you'll receive an \u003ccode\u003eaccess_denied\u003c/code\u003e error, and the user won't be able to use the verification code again.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003edevice_flow_disabled\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eDevice flow has not been enabled in the app's settings. For more information on enabling device flow, see \u003ca href=\"/en/apps/maintaining-github-apps/modifying-a-github-app-registration\"\u003eModifying a GitHub App registration\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eOnce the user has entered the \u003ccode\u003euser_code\u003c/code\u003e, GitHub will give a response that includes the following query parameters:\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eResponse parameter\u003c/th\u003e\u003cth scope=\"col\"\u003eType\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eaccess_token\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe user access token. The token starts with \u003ccode\u003eghu_\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eexpires_in\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe number of seconds until \u003ccode\u003eaccess_token\u003c/code\u003e expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be \u003ccode\u003e28800\u003c/code\u003e (8 hours).\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erefresh_token\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with \u003ccode\u003eghr_\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erefresh_token_\u003cwbr\u003eexpires_in\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe number of seconds until \u003ccode\u003erefresh_token\u003c/code\u003e expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be \u003ccode\u003e15897600\u003c/code\u003e (6 months).\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003escope\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003etoken_type\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe type of token. The value will always be \u003ccode\u003ebearer\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eUse the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the \u003ccode\u003eAuthorization\u003c/code\u003e header of an API request. For example:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"hljs language-shell\"\u003ecurl --request GET \\\n--url \"https://api.github.com/user\" \\\n--header \"Accept: application/vnd.github+json\" \\\n--header \"Authorization: Bearer USER_ACCESS_TOKEN\" \\\n--header \"X-GitHub-Api-Version: 2026-03-10\"\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"generating-a-user-access-token-when-a-user-installs-your-app\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#generating-a-user-access-token-when-a-user-installs-your-app\"\u003eGenerating a user access token when a user installs your app\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003cp\u003eIf you select \u003cstrong\u003eRequest user authorization (OAuth) during installation\u003c/strong\u003e in your app settings, GitHub will start the web application flow immediately after a user installs your app.\u003c/p\u003e\n\u003cp\u003eYou can generate a user access token with this method regardless of whether the app is installed on a user account or an organization account. However, if the app was installed on an organization account, you will need to use the web application flow or device flow to generate a user access token for other users in the organization.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eWhen a user installs your app, GitHub will redirect the user to \u003ccode\u003ehttps://github.com/login/oauth/authorize?client_id=CLIENT_ID\u003c/code\u003e, where \u003ccode\u003eCLIENT_ID\u003c/code\u003e is the client ID of your app.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eIf the user accepts your authorization request, GitHub will redirect the user to the first callback URL in your app settings, and provide a \u003ccode\u003ecode\u003c/code\u003e query parameter.\u003c/p\u003e\n\u003cp\u003eIf you want to control which callback URL is used, do not select \u003cstrong\u003eRequest user authorization (OAuth) during installation\u003c/strong\u003e. Instead, direct users through the full web application flow and specify the \u003ccode\u003eredirect_uri\u003c/code\u003e parameter.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eExchange the \u003ccode\u003ecode\u003c/code\u003e from the previous step for a user access token by making a \u003ccode\u003ePOST\u003c/code\u003e request to this URL, along with the following query parameters: \u003ccode\u003ehttps://github.com/login/oauth/access_token\u003c/code\u003e\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eQuery parameter\u003c/th\u003e\u003cth scope=\"col\"\u003eType\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eclient_id\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see \u003ca href=\"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings\"\u003eModifying a GitHub App registration\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eclient_secret\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The client secret for your GitHub App. You can generate a client secret on the settings page for your app.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003ecode\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eRequired.\u003c/strong\u003e The code you received in the previous step.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eredirect_uri\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe URL in your application where users will be sent after authorization. This must match one of the URLs you provided as a \"Callback URL\" when setting up your GitHub App. For more information, see \u003ca href=\"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url\"\u003eAbout the user authorization callback URL\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003ecode_verifier\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003eStrongly recommended.\u003c/strong\u003e Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if \u003ccode\u003ecode_challenge\u003c/code\u003e was sent during the user authorization. Must be the original value used to generate the \u003ccode\u003ecode_challenge\u003c/code\u003e in the authorization request. This can be stored in a cookie alongside the \u003ccode\u003estate\u003c/code\u003e parameter or in a session variable during authentication, depending on your application architecture.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erepository_id\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eGitHub will give a response that includes the following parameters:\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003ctable\u003e\u003cthead\u003e\u003ctr\u003e\u003cth scope=\"col\"\u003eResponse parameter\u003c/th\u003e\u003cth scope=\"col\"\u003eType\u003c/th\u003e\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eaccess_token\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe user access token. The token starts with \u003ccode\u003eghu_\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003eexpires_in\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe number of seconds until \u003ccode\u003eaccess_token\u003c/code\u003e expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be \u003ccode\u003e28800\u003c/code\u003e (8 hours).\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erefresh_token\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with \u003ccode\u003eghr_\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003erefresh_token_\u003cwbr\u003eexpires_in\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003einteger\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe number of seconds until \u003ccode\u003erefresh_token\u003c/code\u003e expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be \u003ccode\u003e15897600\u003c/code\u003e (6 months).\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003escope\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003ccode\u003etoken_type\u003c/code\u003e\u003c/td\u003e\u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\u003ctd\u003eThe type of token. The value will always be \u003ccode\u003ebearer\u003c/code\u003e.\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eUse the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the \u003ccode\u003eAuthorization\u003c/code\u003e header of an API request. For example:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"hljs language-shell\"\u003ecurl --request GET \\\n--url \"https://api.github.com/user\" \\\n--header \"Accept: application/vnd.github+json\" \\\n--header \"Authorization: Bearer USER_ACCESS_TOKEN\" \\\n--header \"X-GitHub-Api-Version: 2026-03-10\"\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"using-a-refresh-token-to-generate-a-user-access-token\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#using-a-refresh-token-to-generate-a-user-access-token\"\u003eUsing a refresh token to generate a user access token\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003cp\u003eBy default, user access tokens expires after 8 hours. If you receive a user access token with an expiration, you will also receive a refresh token. The refresh token expire after 6 months. You can use this refresh token to regenerate a user access token. For more information, see \u003ca href=\"/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens\"\u003eRefreshing user access tokens\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eGitHub strongly encourages you to use user access tokens that expire. If you previously opted out of using user access tokens that expire but want to re-enable this feature, see \u003ca href=\"/en/apps/maintaining-github-apps/activating-optional-features-for-github-apps\"\u003eActivating optional features for GitHub Apps\u003c/a\u003e.\u003c/p\u003e\n\u003ch2 id=\"troubleshooting\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#troubleshooting\"\u003eTroubleshooting\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h2\u003e\n\u003cp\u003eThe following sections outline some errors you may receive when generating a user access token.\u003c/p\u003e\n\u003ch3 id=\"incorrect-client-credentials\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#incorrect-client-credentials\"\u003eIncorrect client credentials\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eIf the \u003ccode\u003eclient_id\u003c/code\u003e or \u003ccode\u003eclient_secret\u003c/code\u003e that you specify are incorrect, you will receive an \u003ccode\u003eincorrect_client_credentials\u003c/code\u003e error.\u003c/p\u003e\n\u003cp\u003eTo resolve this error, make sure to use the correct credentials for your GitHub App. You can find the client ID and client secret on the settings page for your GitHub App. For more information about navigating to your GitHub App settings page, see \u003ca href=\"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings\"\u003eModifying a GitHub App registration\u003c/a\u003e.\u003c/p\u003e\n\u003ch3 id=\"redirect-uri-mismatch\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#redirect-uri-mismatch\"\u003eRedirect URI mismatch\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eIf you specify a \u003ccode\u003eredirect_uri\u003c/code\u003e that doesn't match one of the callback URLs in your GitHub App registration, you will receive a \u003ccode\u003eredirect_uri_mismatch\u003c/code\u003e error.\u003c/p\u003e\n\u003cp\u003eTo resolve this error, either provide a \u003ccode\u003eredirect_uri\u003c/code\u003e that matches one of the callback URLs for your GitHub App registration, or omit this parameter to default to the first callback URL that is listed on your GitHub App registration. For more information, see \u003ca href=\"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url\"\u003eAbout the user authorization callback URL\u003c/a\u003e.\u003c/p\u003e\n\u003ch3 id=\"bad-verification-code\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#bad-verification-code\"\u003eBad verification code\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eIf you are using device flow and the verification code (\u003ccode\u003edevice_code\u003c/code\u003e) that you specified is incorrect, expired, or doesn't\nmatch the value that you received from the initial request to \u003ccode\u003ehttps://github.com/login/device/code\u003c/code\u003e, you will receive a \u003ccode\u003ebad_verification_code\u003c/code\u003e error.\u003c/p\u003e\n\u003cp\u003eTo resolve this error, you should start the device flow again to get a new code. For more information, see \u003ca href=\"#using-the-device-flow-to-generate-a-user-access-token\"\u003eUsing the device flow to generate a user access token\u003c/a\u003e.\u003c/p\u003e\n\u003ch3 id=\"bad-refresh-token\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#bad-refresh-token\"\u003eBad refresh token\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eIf the refresh token that you specified is invalid or expired, you will receive a \u003ccode\u003ebad_refresh_token\u003c/code\u003e error.\u003c/p\u003e\n\u003cp\u003eTo resolve this error, you must restart the web application flow or device flow to get a new user access token and refresh token. You will only receive a refresh token if your GitHub App has opted in to expiring user access tokens. For more information, see \u003ca href=\"/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens\"\u003eRefreshing user access tokens\u003c/a\u003e.\u003c/p\u003e\n\u003ch3 id=\"unsupported-grant-type\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#unsupported-grant-type\"\u003eUnsupported grant type\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eWhen you request a user access token via the device flow, the \u003ccode\u003egrant_type\u003c/code\u003e parameter must be \u003ccode\u003eurn:ietf:params:oauth:grant-type:device_code\u003c/code\u003e. When you refresh a user access token by using a refresh token, the \u003ccode\u003egrant_type\u003c/code\u003e parameter must be \u003ccode\u003erefresh_token\u003c/code\u003e. If you don't use the correct grant type, you will receive an \u003ccode\u003eunsupported_grant_type\u003c/code\u003e error.\u003c/p\u003e\n\u003ch3 id=\"unverified-user-email\" tabindex=\"-1\"\u003e\u003ca class=\"heading-link\" href=\"#unverified-user-email\"\u003eUnverified user email\u003cspan class=\"heading-link-symbol\" aria-hidden=\"true\"\u003e\u003c/span\u003e\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eIf the user for whom you are trying to generate a user access token has not verified their primary email address with GitHub, you will receive an \u003ccode\u003eunverified_user_email\u003c/code\u003e error.\u003c/p\u003e\n\u003cp\u003eTo resolve this error, prompt the user to verify the primary email address on their GitHub account. For more information, see \u003ca href=\"/en/account-and-profile/how-tos/email-preferences/verifying-your-email-address\"\u003eVerifying your email address\u003c/a\u003e.\u003c/p\u003e","renderedPageHast":{"type":"root","children":[{"type":"element","tagName":"h2","properties":{"id":"about-user-access-tokens","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#about-user-access-tokens"},"children":[{"type":"text","value":"About user access tokens"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":"ghd-alert ghd-alert-accent","dataContainer":"alert"},"children":[{"type":"element","tagName":"p","properties":{"className":["ghd-alert-title"]},"children":[{"type":"element","tagName":"svg","properties":{"version":"1.1","width":16,"height":16,"viewBox":"0 0 16 16","className":["octicon","mr-2"],"ariaHidden":true},"children":[{"type":"element","tagName":"path","properties":{"d":"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"},"children":[]}]},{"type":"text","value":"Note"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":" User access tokens that expire are currently an optional feature and are subject to change. To opt in or out of the token expiration feature, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/activating-optional-features-for-github-apps"},"children":[{"type":"text","value":"Activating optional features for GitHub Apps"}]},{"type":"text","value":". For more information, see "},{"type":"element","tagName":"a","properties":{"href":"https://developer.github.com/changes/2020-04-30-expiring-user-to-server-access-tokens-for-github-apps"},"children":[{"type":"text","value":"Expiring user-to-server access tokens for GitHub Apps"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If a user reports that they cannot see resources owned by their organization after authorizing your GitHub App and the organization uses SAML SSO, instruct the user to start an active SAML session for their organization before reauthorizing. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/enterprise-cloud@latest/apps/using-github-apps/saml-and-github-apps"},"children":[{"type":"text","value":"SAML and GitHub Apps"}]},{"type":"text","value":" in the GitHub Enterprise Cloud documentation."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"A user access token is a type of OAuth token. Unlike a traditional OAuth token, the user access token does not use scopes. Instead, it uses fine-grained permissions. A user access token only has permissions that both the user and the app have. For example, if the app was granted permission to write the contents of a repository, but the user can only read the contents, then the user access token can only read the contents."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Similarly, a user access token can only access resources that both the user and app can access. For example, if an app is granted access to repository "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"A"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"B"}]},{"type":"text","value":", and the user can access repository "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"B"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"C"}]},{"type":"text","value":", the user access token can access repository "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"B"}]},{"type":"text","value":" but not "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"A"}]},{"type":"text","value":" or "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"C"}]},{"type":"text","value":". You can use the REST API to check which installations and which repositories within an installation a user access token can access. For more information, see "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /user/installations"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"GET /user/installations/{installation_id}/repositories"}]},{"type":"text","value":" in "},{"type":"element","tagName":"a","properties":{"href":"/en/rest/apps/installations"},"children":[{"type":"text","value":"REST API endpoints for GitHub App installations"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"When you make API requests with a user access token, the rate limits for user access tokens apply. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/registering-a-github-app/rate-limits-for-github-apps"},"children":[{"type":"text","value":"Rate limits for GitHub Apps"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"By default, the user access token expires after 8 hours. You can use a refresh token to regenerate a user access token. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens"},"children":[{"type":"text","value":"Refreshing user access tokens"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Users can revoke their authorization of a GitHub App. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocation"},"children":[{"type":"text","value":"Token expiration and revocation"}]},{"type":"text","value":". If a user revokes their authorization of a GitHub App, the app will receive the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"github_app_authorization"}]},{"type":"text","value":" webhook. GitHub Apps cannot unsubscribe from this event. If your app receives this webhook, you should stop calling the API on behalf of the user who revoked the token. If your app continues to use a revoked access token, it will receive the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"401 Bad Credentials"}]},{"type":"text","value":" error. For more information about this webhook, see "},{"type":"element","tagName":"a","properties":{"href":"/en/webhooks/webhook-events-and-payloads#github_app_authorization"},"children":[{"type":"text","value":"Webhook events and payloads"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You should keep user access tokens and refresh tokens secure. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-app"},"children":[{"type":"text","value":"Best practices for creating a GitHub App"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"using-the-web-application-flow-to-generate-a-user-access-token","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#using-the-web-application-flow-to-generate-a-user-access-token"},"children":[{"type":"text","value":"Using the web application flow to generate a user access token"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If your app runs in the browser, you should use the web application flow to generate a user access token. For a tutorial about using the web application flow, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-login-with-github-button-with-a-github-app"},"children":[{"type":"text","value":"Building a \"Login with GitHub\" button with a GitHub App"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Direct the user to this URL, and add any necessary query parameters from the following list of parameters: "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://github.com/login/oauth/authorize"}]},{"type":"text","value":". For example, this URL specifies the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_id"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"state"}]},{"type":"text","value":" parameters: "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://github.com/login/oauth/authorize?client_id=12345\u0026state=abcdefg"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Query parameter"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Type"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Required?"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_id"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Required"}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings"},"children":[{"type":"text","value":"Modifying a GitHub App registration"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redirect_uri"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Strongly recommended"}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The URL in your application where users will be sent after authorization. This must be a match to one of the URLs you provided as a \"Callback URL\" in your app's settings and can't contain any additional parameters. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url"},"children":[{"type":"text","value":"About the user authorization callback URL"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"state"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Strongly recommended"}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"When specified, the value should contain a random string to protect against forgery attacks, and it can also contain any other arbitrary data."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_challenge"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Strongly recommended"}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_challenge_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"method"}]},{"type":"text","value":" is included. Must be a 43 character SHA-256 hash of a random string generated by the client. See the "},{"type":"element","tagName":"a","properties":{"href":"https://datatracker.ietf.org/doc/html/rfc7636"},"children":[{"type":"text","value":"PKCE RFC"}]},{"type":"text","value":" for more details about this security extension."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_challenge_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"method"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Strongly recommended"}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_challenge"}]},{"type":"text","value":" is included. Must be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"S256"}]},{"type":"text","value":" - the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"plain"}]},{"type":"text","value":" code challenge method is not supported."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"login"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Optional"}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"When specified, the web application flow will prompt users with a specific account they can use for signing in and authorizing your app."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"allow_signup"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"boolean"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Optional"}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Whether unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. The default is "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"true"}]},{"type":"text","value":". Use "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"false"}]},{"type":"text","value":" when a policy prohibits signups."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"prompt"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Optional"}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Forces the account picker to appear if set to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"select_account"}]},{"type":"text","value":". The account picker will also appear if the application has a non-HTTP redirect URI or if the user has multiple accounts signed in."}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If the user accepts your authorization request, GitHub will redirect the user to one of the callback URLs in your app settings, and provide a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code"}]},{"type":"text","value":" query parameter you can use in the next step to create a user access token. If you specified "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redirect_uri"}]},{"type":"text","value":" in the previous step, that callback URL will be used. Otherwise, the first callback URL on your app's settings page will be used."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you specified the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"state"}]},{"type":"text","value":" parameter in the previous step, GitHub will also include a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"state"}]},{"type":"text","value":" parameter. If the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"state"}]},{"type":"text","value":" parameter does not match the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"state"}]},{"type":"text","value":" parameter that you sent in the previous step, the request cannot be trusted, and the web application flow should be aborted."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Exchange the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code"}]},{"type":"text","value":" from the previous step for a user access token by making a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST"}]},{"type":"text","value":" request to this URL, along with the following query parameters: "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://github.com/login/oauth/access_token"}]}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Query parameter"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Type"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_id"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings"},"children":[{"type":"text","value":"Modifying a GitHub App registration"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_secret"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The client secret for your GitHub App. You can generate a client secret on the settings page for your app."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The code you received in the previous step."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redirect_uri"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The URL in your application where users will be sent after authorization. This must match one of the URLs you provided as a \"Callback URL\" when setting up your GitHub App. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url"},"children":[{"type":"text","value":"About the user authorization callback URL"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_verifier"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Strongly recommended."}]},{"type":"text","value":" Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_challenge"}]},{"type":"text","value":" was sent during the user authorization. Must be the original value used to generate the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_challenge"}]},{"type":"text","value":" in the authorization request. This can be stored in a cookie alongside the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"state"}]},{"type":"text","value":" parameter or in a session variable during authentication, depending on your application architecture."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"repository_id"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further."}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"GitHub will give a response that includes the following parameters:"}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Response parameter"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Type"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access_token"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The user access token. The token starts with "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ghu_"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"expires_in"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"integer"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The number of seconds until "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access_token"}]},{"type":"text","value":" expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"28800"}]},{"type":"text","value":" (8 hours)."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ghr_"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"expires_in"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"integer"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The number of seconds until "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token"}]},{"type":"text","value":" expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"15897600"}]},{"type":"text","value":" (6 months)."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"scope"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"token_type"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The type of token. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"bearer"}]},{"type":"text","value":"."}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Use the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Authorization"}]},{"type":"text","value":" header of an API request. For example:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["hljs","language-shell"]},"children":[{"type":"text","value":"curl --request GET \\\n--url \"https://api.github.com/user\" \\\n--header \"Accept: application/vnd.github+json\" \\\n--header \"Authorization: Bearer USER_ACCESS_TOKEN\" \\\n--header \"X-GitHub-Api-Version: 2026-03-10\"\n"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"using-the-device-flow-to-generate-a-user-access-token","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#using-the-device-flow-to-generate-a-user-access-token"},"children":[{"type":"text","value":"Using the device flow to generate a user access token"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If your app is headless or does not have access to a browser, you should use the device flow to generate a user access token. For example, CLI tools, simple Raspberry Pis, and desktop applications should use the device flow. For a tutorial that uses device flow, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/writing-code-for-a-github-app/building-a-cli-with-a-github-app"},"children":[{"type":"text","value":"Building a CLI with a GitHub App"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Before you can use the device flow, you must first enable it in your app's settings. For more information on enabling device flow, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/modifying-a-github-app-registration"},"children":[{"type":"text","value":"Modifying a GitHub App registration"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The device flow uses the "},{"type":"element","tagName":"a","properties":{"href":"https://datatracker.ietf.org/doc/html/rfc8628"},"children":[{"type":"text","value":"OAuth 2.0 Device Authorization Grant"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Send a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST"}]},{"type":"text","value":" request to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://github.com/login/device/code"}]},{"type":"text","value":" along with a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_id"}]},{"type":"text","value":" query parameter. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings"},"children":[{"type":"text","value":"Modifying a GitHub App registration"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"GitHub will give a response that includes the following query parameters:"}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Response parameter"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Type"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"device_code"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"A verification code that is used to verify the device. This code is 40 characters long."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"user_code"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"A verification code that your application should display so that the user can enter the code in a browser. This code is 8 characters with a hyphen in the middle. For example, "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"WDJB-MJHT"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"verification_uri"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The URL where users need to enter their "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"user_code"}]},{"type":"text","value":". The URL is:  "},{"type":"element","tagName":"a","properties":{"href":"https://github.com/login/device"},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https:/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"github.com/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"login/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"device"}]}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"expires_in"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"integer"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The number of seconds before the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"device_code"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"user_code"}]},{"type":"text","value":" expire. The default is 900 seconds (15 minutes)."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"interval"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"integer"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The minimum number of seconds that must pass before you can make a new access token request ("},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST https:/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"github.com/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"login/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"oauth/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"access_token"}]},{"type":"text","value":") to complete the device authorization. If you make a request before this interval passes, then you will hit the rate limit and receive a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"slow_down"}]},{"type":"text","value":" error. The default is 5 seconds."}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Prompt the user to enter the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"user_code"}]},{"type":"text","value":" from the previous step at  "},{"type":"element","tagName":"a","properties":{"href":"https://github.com/login/device"},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://github.com/login/device"}]}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If the user does not enter the code before the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"expires_in"}]},{"type":"text","value":" time passes, the code will be invalid. In this case, you should restart the device flow."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Poll "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST https://github.com/login/oauth/access_token"}]},{"type":"text","value":" along with the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_id"}]},{"type":"text","value":", "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"device_code"}]},{"type":"text","value":", and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"grant_type"}]},{"type":"text","value":" query parameters (described below) until the device and user codes expire or the user has successfully authorized the app by entering the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"user_code"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Query parameter"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Type"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_id"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The client ID for your GitHub App."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"device_code"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The device verification code you received in the previous step."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"grant_type"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The grant type must be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"urn:ietf:params:oauth:grant-type:device_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"code"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"repository_id"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further."}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Do not poll this endpoint at a higher frequency than the frequency indicated by "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"interval"}]},{"type":"text","value":". If you do, you will hit the rate limit and receive a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"slow_down"}]},{"type":"text","value":" error. The "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"slow_down"}]},{"type":"text","value":" error response adds 5 seconds to the last "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"interval"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Until the user enters the code, GitHub will respond with a 200 status and an "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"error"}]},{"type":"text","value":" response query parameter."}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Error name"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"authorization_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"pending"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"This error occurs when the authorization request is pending and the user hasn't entered the user code yet. The app is expected to keep polling the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST https:/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"github.com/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"login/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"oauth/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"access_token"}]},{"type":"text","value":" at a frequency no faster than the frequency specified by "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"interval"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"slow_down"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"When you receive the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"slow_down"}]},{"type":"text","value":" error, 5 extra seconds are added to the minimum "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"interval"}]},{"type":"text","value":" or timeframe required between your requests using "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST https:/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"github.com/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"login/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"oauth/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"access_token"}]},{"type":"text","value":". For example, if the starting interval required at least 5 seconds between requests and you get a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"slow_down"}]},{"type":"text","value":" error response, you must now wait a minimum of 10 seconds before making a new request for a token. The error response includes the new "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"interval"}]},{"type":"text","value":" that you must use."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"expired_token"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"If the device code expired, then you will see the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"token_expired"}]},{"type":"text","value":" error. You must make a new request for a device code."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"unsupported_grant_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"type"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The grant type must be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"urn:ietf:params:oauth:grant-type:device_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"code"}]},{"type":"text","value":" and included as an input parameter when you poll the OAuth token request "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST https:/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"github.com/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"login/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"oauth/"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"access_token"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"incorrect_client_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"credentials"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"For the device flow, you must pass your app's client ID, which you can find on your app settings page. The client ID is different from the app ID and client secret."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"incorrect_device_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"code"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"device_code"}]},{"type":"text","value":" provided is not valid."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access_denied"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"When a user clicks cancel during the authorization process, you'll receive an "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access_denied"}]},{"type":"text","value":" error, and the user won't be able to use the verification code again."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"device_flow_disabled"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Device flow has not been enabled in the app's settings. For more information on enabling device flow, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/modifying-a-github-app-registration"},"children":[{"type":"text","value":"Modifying a GitHub App registration"}]},{"type":"text","value":"."}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Once the user has entered the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"user_code"}]},{"type":"text","value":", GitHub will give a response that includes the following query parameters:"}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Response parameter"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Type"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access_token"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The user access token. The token starts with "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ghu_"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"expires_in"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"integer"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The number of seconds until "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access_token"}]},{"type":"text","value":" expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"28800"}]},{"type":"text","value":" (8 hours)."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ghr_"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"expires_in"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"integer"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The number of seconds until "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token"}]},{"type":"text","value":" expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"15897600"}]},{"type":"text","value":" (6 months)."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"scope"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"token_type"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The type of token. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"bearer"}]},{"type":"text","value":"."}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Use the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Authorization"}]},{"type":"text","value":" header of an API request. For example:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["hljs","language-shell"]},"children":[{"type":"text","value":"curl --request GET \\\n--url \"https://api.github.com/user\" \\\n--header \"Accept: application/vnd.github+json\" \\\n--header \"Authorization: Bearer USER_ACCESS_TOKEN\" \\\n--header \"X-GitHub-Api-Version: 2026-03-10\"\n"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"generating-a-user-access-token-when-a-user-installs-your-app","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#generating-a-user-access-token-when-a-user-installs-your-app"},"children":[{"type":"text","value":"Generating a user access token when a user installs your app"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you select "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Request user authorization (OAuth) during installation"}]},{"type":"text","value":" in your app settings, GitHub will start the web application flow immediately after a user installs your app."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can generate a user access token with this method regardless of whether the app is installed on a user account or an organization account. However, if the app was installed on an organization account, you will need to use the web application flow or device flow to generate a user access token for other users in the organization."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"When a user installs your app, GitHub will redirect the user to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://github.com/login/oauth/authorize?client_id=CLIENT_ID"}]},{"type":"text","value":", where "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"CLIENT_ID"}]},{"type":"text","value":" is the client ID of your app."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If the user accepts your authorization request, GitHub will redirect the user to the first callback URL in your app settings, and provide a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code"}]},{"type":"text","value":" query parameter."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you want to control which callback URL is used, do not select "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Request user authorization (OAuth) during installation"}]},{"type":"text","value":". Instead, direct users through the full web application flow and specify the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redirect_uri"}]},{"type":"text","value":" parameter."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Exchange the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code"}]},{"type":"text","value":" from the previous step for a user access token by making a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"POST"}]},{"type":"text","value":" request to this URL, along with the following query parameters: "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://github.com/login/oauth/access_token"}]}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Query parameter"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Type"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_id"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The client ID for your GitHub App. The client ID is different from the app ID. You can find the client ID on the settings page for your app. For more information about navigating to the settings page for your GitHub App, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings"},"children":[{"type":"text","value":"Modifying a GitHub App registration"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_secret"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The client secret for your GitHub App. You can generate a client secret on the settings page for your app."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Required."}]},{"type":"text","value":" The code you received in the previous step."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redirect_uri"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The URL in your application where users will be sent after authorization. This must match one of the URLs you provided as a \"Callback URL\" when setting up your GitHub App. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url"},"children":[{"type":"text","value":"About the user authorization callback URL"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_verifier"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Strongly recommended."}]},{"type":"text","value":" Used to secure the authentication flow with PKCE (Proof Key for Code Exchange). Required if "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_challenge"}]},{"type":"text","value":" was sent during the user authorization. Must be the original value used to generate the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"code_challenge"}]},{"type":"text","value":" in the authorization request. This can be stored in a cookie alongside the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"state"}]},{"type":"text","value":" parameter or in a session variable during authentication, depending on your application architecture."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"repository_id"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The ID of a single repository that the user access token can access. If the GitHub App or user cannot access the repository, this will be ignored. Use this parameter to restrict the access of the user access token further."}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"GitHub will give a response that includes the following parameters:"}]},{"type":"text","value":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"element","tagName":"thead","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Response parameter"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Type"}]},{"type":"element","tagName":"th","properties":{"scope":"col"},"children":[{"type":"text","value":"Description"}]}]}]},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access_token"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The user access token. The token starts with "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ghu_"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"expires_in"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"integer"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The number of seconds until "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"access_token"}]},{"type":"text","value":" expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"28800"}]},{"type":"text","value":" (8 hours)."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The refresh token. If you disabled expiration of user access tokens, this parameter will be omitted. The token starts with "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ghr_"}]},{"type":"text","value":"."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token_"},{"type":"element","tagName":"wbr","properties":{},"children":[]},{"type":"text","value":"expires_in"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"integer"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The number of seconds until "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token"}]},{"type":"text","value":" expires. If you disabled expiration of user access tokens, this parameter will be omitted. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"15897600"}]},{"type":"text","value":" (6 months)."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"scope"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The scopes that the token has. This value will always be an empty string. Unlike a traditional OAuth token, the user access token is limited to the permissions that both your app and the user have."}]}]},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"token_type"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The type of token. The value will always be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"bearer"}]},{"type":"text","value":"."}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Use the user access token from the previous step to make API requests on behalf of the user. Include the user access token in the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Authorization"}]},{"type":"text","value":" header of an API request. For example:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["hljs","language-shell"]},"children":[{"type":"text","value":"curl --request GET \\\n--url \"https://api.github.com/user\" \\\n--header \"Accept: application/vnd.github+json\" \\\n--header \"Authorization: Bearer USER_ACCESS_TOKEN\" \\\n--header \"X-GitHub-Api-Version: 2026-03-10\"\n"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"using-a-refresh-token-to-generate-a-user-access-token","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#using-a-refresh-token-to-generate-a-user-access-token"},"children":[{"type":"text","value":"Using a refresh token to generate a user access token"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"By default, user access tokens expires after 8 hours. If you receive a user access token with an expiration, you will also receive a refresh token. The refresh token expire after 6 months. You can use this refresh token to regenerate a user access token. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens"},"children":[{"type":"text","value":"Refreshing user access tokens"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"GitHub strongly encourages you to use user access tokens that expire. If you previously opted out of using user access tokens that expire but want to re-enable this feature, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/activating-optional-features-for-github-apps"},"children":[{"type":"text","value":"Activating optional features for GitHub Apps"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"troubleshooting","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#troubleshooting"},"children":[{"type":"text","value":"Troubleshooting"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The following sections outline some errors you may receive when generating a user access token."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"incorrect-client-credentials","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#incorrect-client-credentials"},"children":[{"type":"text","value":"Incorrect client credentials"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_id"}]},{"type":"text","value":" or "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"client_secret"}]},{"type":"text","value":" that you specify are incorrect, you will receive an "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"incorrect_client_credentials"}]},{"type":"text","value":" error."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To resolve this error, make sure to use the correct credentials for your GitHub App. You can find the client ID and client secret on the settings page for your GitHub App. For more information about navigating to your GitHub App settings page, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/maintaining-github-apps/modifying-a-github-app-registration#navigating-to-your-github-app-settings"},"children":[{"type":"text","value":"Modifying a GitHub App registration"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"redirect-uri-mismatch","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#redirect-uri-mismatch"},"children":[{"type":"text","value":"Redirect URI mismatch"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you specify a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redirect_uri"}]},{"type":"text","value":" that doesn't match one of the callback URLs in your GitHub App registration, you will receive a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redirect_uri_mismatch"}]},{"type":"text","value":" error."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To resolve this error, either provide a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"redirect_uri"}]},{"type":"text","value":" that matches one of the callback URLs for your GitHub App registration, or omit this parameter to default to the first callback URL that is listed on your GitHub App registration. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/registering-a-github-app/about-the-user-authorization-callback-url"},"children":[{"type":"text","value":"About the user authorization callback URL"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"bad-verification-code","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#bad-verification-code"},"children":[{"type":"text","value":"Bad verification code"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you are using device flow and the verification code ("},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"device_code"}]},{"type":"text","value":") that you specified is incorrect, expired, or doesn't\nmatch the value that you received from the initial request to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://github.com/login/device/code"}]},{"type":"text","value":", you will receive a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"bad_verification_code"}]},{"type":"text","value":" error."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To resolve this error, you should start the device flow again to get a new code. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"#using-the-device-flow-to-generate-a-user-access-token"},"children":[{"type":"text","value":"Using the device flow to generate a user access token"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"bad-refresh-token","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#bad-refresh-token"},"children":[{"type":"text","value":"Bad refresh token"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If the refresh token that you specified is invalid or expired, you will receive a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"bad_refresh_token"}]},{"type":"text","value":" error."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To resolve this error, you must restart the web application flow or device flow to get a new user access token and refresh token. You will only receive a refresh token if your GitHub App has opted in to expiring user access tokens. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens"},"children":[{"type":"text","value":"Refreshing user access tokens"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"unsupported-grant-type","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#unsupported-grant-type"},"children":[{"type":"text","value":"Unsupported grant type"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"When you request a user access token via the device flow, the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"grant_type"}]},{"type":"text","value":" parameter must be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"urn:ietf:params:oauth:grant-type:device_code"}]},{"type":"text","value":". When you refresh a user access token by using a refresh token, the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"grant_type"}]},{"type":"text","value":" parameter must be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refresh_token"}]},{"type":"text","value":". If you don't use the correct grant type, you will receive an "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"unsupported_grant_type"}]},{"type":"text","value":" error."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"unverified-user-email","tabIndex":-1},"children":[{"type":"element","tagName":"a","properties":{"className":["heading-link"],"href":"#unverified-user-email"},"children":[{"type":"text","value":"Unverified user email"},{"type":"element","tagName":"span","properties":{"className":["heading-link-symbol"],"ariaHidden":"true"},"children":[]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If the user for whom you are trying to generate a user access token has not verified their primary email address with GitHub, you will receive an "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"unverified_user_email"}]},{"type":"text","value":" error."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To resolve this error, prompt the user to verify the primary email address on their GitHub account. For more information, see "},{"type":"element","tagName":"a","properties":{"href":"/en/account-and-profile/how-tos/email-preferences/verifying-your-email-address"},"children":[{"type":"text","value":"Verifying your email address"}]},{"type":"text","value":"."}]}],"data":{"quirksMode":false}},"miniTocItems":[{"contents":{"href":"#about-user-access-tokens","title":"About user access tokens"}},{"contents":{"href":"#using-the-web-application-flow-to-generate-a-user-access-token","title":"Using the web application flow to generate a user access token"}},{"contents":{"href":"#using-the-device-flow-to-generate-a-user-access-token","title":"Using the device flow to generate a user access token"}},{"contents":{"href":"#generating-a-user-access-token-when-a-user-installs-your-app","title":"Generating a user access token when a user installs your app"}},{"contents":{"href":"#using-a-refresh-token-to-generate-a-user-access-token","title":"Using a refresh token to generate a user access token"}},{"contents":{"href":"#troubleshooting","title":"Troubleshooting"}}],"permissions":"","includesPlatformSpecificContent":false,"includesToolSpecificContent":false,"defaultPlatform":"","defaultTool":"","product":"","currentJourneyTrack":null,"detectedPlatforms":[],"detectedTools":[],"allTools":{"vscode":"Visual Studio Code","jetbrains":"JetBrains IDEs","visualstudio":"Visual Studio","cli":"GitHub CLI","webui":"Web browser","eclipse":"Eclipse","desktop":"Desktop","vimneovim":"Vim/Neovim","azure_data_studio":"Azure Data Studio","xcode":"Xcode","curl":"curl","javascript":"JavaScript","windowsterminal":"Windows Terminal","codespaces":"Codespaces","api":"API","mobile":"Mobile","copilotcli":"Copilot CLI","bash":"Bash","powershell":"PowerShell","skillsets":"Skillsets","agents":"Agents","jetbrains_beta":"JetBrains IDEs (Beta)","github_mobile":"GitHub Mobile","ides":"IDEs","importer_cli":"GitHub Enterprise Importer CLI"},"supportPortalVaIframeProps":{"supportPortalUrl":"https://support.github.com","vaFlowUrlParameter":""},"currentLayout":"default","currentPath":"/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app"}},"languagesContext":{"languages":{"en":{"name":"English","code":"en"},"es":{"name":"Spanish","code":"es","nativeName":"Español"},"ja":{"name":"Japanese","code":"ja","nativeName":"日本語"},"pt":{"name":"Portuguese","code":"pt","nativeName":"Português do Brasil"},"zh":{"name":"Simplified Chinese","code":"zh","hreflang":"zh-Hans","nativeName":"简体中文"},"ru":{"name":"Russian","code":"ru","nativeName":"Русский"},"fr":{"name":"French","code":"fr","nativeName":"Français"},"ko":{"name":"Korean","code":"ko","nativeName":"한국어"},"de":{"name":"German","code":"de","nativeName":"Deutsch"}}},"__N_SSP":true},"page":"/[versionId]/[productId]/[...restPage]","query":{"versionId":"free-pro-team@latest","productId":"apps","restPage":["creating-github-apps","authenticating-with-a-github-app","generating-a-user-access-token-for-a-github-app"]},"buildId":"37rneBrFhguD_pCpKvY4P","isFallback":false,"isExperimentalCompile":false,"gssp":true,"appGip":true,"locale":"en","locales":["en","es","ja","pt","zh","ru","fr","ko","de"],"defaultLocale":"en","scriptLoader":[]}</script></body></html>