OAuth 2.0 Bearer Token authenticates requests on behalf of your developer App. As this method is specific to the App, it does not involve any users. This method is typically for developers that need read-only access to public information. This authentication method requires for you to pass a Bearer Token with your request, which you can generate within the Keys and tokens section of your developer Apps. Here is an example of what a request looks like with a fake Bearer Token:
API calls using app-only authentication are rate limited per endpoint at the App level.To use this method, you’ll need a Bearer Token, which you can generate by passing your API Key and Secret through the POST oauth2/token endpoint, or by generating it in the “keys and token” section of your App settings in the Developer Console.If you’d like to revoke a Bearer Token, you can use the POST oauth2/invalidate_token endpoint, or click where it says “revoke” next to the Bearer Token in the “keys and tokens” section of your App settings.
OAuth 2.0 Authorization Code Flow with PKCE allows you to authenticate on behalf of another user with have more control over an application’s scopes and improves authorization flows across multiple devices. In other words, developers building applications for people on X will have more control over the information their App requests from its users, so that you only have to ask your end-users for the data and information you need.This modern authorization protocol will allow you to present your end-users with a more streamlined consent flow for authorizing your app, which only displays the specific scopes you have requested from them. Not only does this reduce your data burden, but it may also lead to increased trust from end-users.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"X","colors":{"primary":"#0E0E0E","light":"#B0B0B0","dark":"#0E0E0E"},"logo":{"light":"https://mintcdn.com/generaltranslation/p-tsc5qa00w8y5M4/logo/light.svg?fit=max\u0026auto=format\u0026n=p-tsc5qa00w8y5M4\u0026q=85\u0026s=299a991122fb35a82f868bc62a8be1ae","dark":"https://mintcdn.com/generaltranslation/p-tsc5qa00w8y5M4/logo/dark.svg?fit=max\u0026auto=format\u0026n=p-tsc5qa00w8y5M4\u0026q=85\u0026s=06e5086f68ab588cc44787b665898b75"},"favicon":"/favicon.png","appearance":{"default":"dark","strict":true},"background":{"color":{"dark":"#050505"}},"navbar":{"links":[{"href":"https://developer.x.com/en/support","label":"Support"}],"primary":{"type":"button","label":"Developer Console","href":"https://developer.x.com/en/portal/petition/essential/basic-info"}},"footer":{"socials":{"x":"https://x.com/xdevelopers","github":"https://github.com/xdevplatform"},"links":[{"header":"Legal","items":[{"label":"Terms of Service","href":"https://x.com/en/tos"},{"label":"Privacy Policy","href":"https://x.com/en/privacy"},{"label":"Cookies","href":"https://help.x.com/en/rules-and-policies/x-cookies"},{"label":"Developer Terms","href":"https://docs.x.com/developer-terms"}]}]},"seo":{"metatags":{"canonical":"https://docs.x.com","og:site_name":"X Developer Platform","og:type":"website","og:locale":"en_US","twitter:card":"summary_large_image","twitter:site":"@xdevelopers","description":"Build, analyze, and innovate with X's real-time, global data and APIs. Access comprehensive API documentation, SDKs, tutorials, and developer tools.","author":"X Developer Platform","language":"en","robots":"index, follow","googlebot":"index, follow"},"indexing":"all"},"contextual":{"options":["copy","view",{"title":"Open in Grok","description":"Ask questions about this page","icon":"/logo/grok.svg","href":{"base":"https://grok.com","query":[{"key":"q","value":"Read from https://docs.x.com$path so I can ask questions about it."}]}}],"display":"header"},"styling":{"latex":true},"navigation":{"languages":[{"language":"en","href":"overview"},{"language":"es","href":"es/overview"},{"language":"fr","href":"fr/overview"},{"language":"hi","href":"hi/overview"},{"language":"ja","href":"ja/overview"},{"language":"ko","href":"ko/overview"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"generaltranslation","hasAudioNarration":false,"actualSubdomain":"generaltranslation","customDomains":[],"gitSource":{"type":"github","owner":"fernando-aviles","repo":"x-docs","deployBranch":"locadex/setup-1769989792329","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae92afb0a94bfe43457bdcb:success","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"en","tag":"API Reference","count":371},{"language":"es","tag":"Referencia de la API","count":371},{"language":"fr","tag":"Référence de l’API","count":371},{"language":"hi","tag":"API संदर्भ","count":371},{"language":"ja","tag":"APIリファレンス","count":371},{"language":"ko","tag":"API 참조 문서","count":371},{"language":"en","tag":"TypeScript SDK","count":315},{"language":"es","tag":"SDK de TypeScript","count":315},{"language":"fr","tag":"SDK TypeScript","count":315},{"language":"hi","tag":"TypeScript SDK","count":315},{"language":"ja","tag":"TypeScript SDK","count":315},{"language":"ko","tag":"TypeScript SDK","count":315},{"language":"en","tag":"X API","count":295},{"language":"es","tag":"X API","count":294},{"language":"fr","tag":"X API","count":294},{"language":"hi","tag":"X API","count":294},{"language":"ja","tag":"X API","count":294},{"language":"ko","tag":"X API","count":294},{"language":"en","tag":"Interfaces","count":284},{"language":"es","tag":"Interfaces","count":284},{"language":"fr","tag":"Interfaces","count":284},{"language":"hi","tag":"इंटरफेस","count":284},{"language":"ja","tag":"インターフェイス","count":284},{"language":"ko","tag":"인터페이스","count":284},{"language":"en","tag":"Misc","count":281},{"language":"es","tag":"Varios","count":281},{"language":"fr","tag":"Divers","count":281},{"language":"hi","tag":"विविध","count":281},{"language":"ja","tag":"その他","count":281},{"language":"ko","tag":"기타","count":281},{"language":"en","tag":"Posts","count":78},{"language":"es","tag":"Publicaciones","count":78},{"language":"fr","tag":"Publications","count":78},{"language":"hi","tag":"पोस्ट्स","count":78},{"language":"ja","tag":"投稿","count":78},{"language":"ko","tag":"포스트","count":78},{"language":"en","tag":"Guides","count":76},{"language":"es","tag":"Guías","count":76},{"language":"fr","tag":"Guides","count":76},{"language":"ja","tag":"ガイド","count":76},{"language":"ko","tag":"가이드","count":76},{"language":"en","tag":"Python SDK","count":67},{"language":"es","tag":"SDK de Python","count":67},{"language":"fr","tag":"SDK Python","count":67},{"language":"hi","tag":"Python SDK","count":67},{"language":"ja","tag":"Python SDK","count":67},{"language":"ko","tag":"Python SDK","count":67},{"language":"en","tag":"Fundamentals","count":56},{"language":"hi","tag":"मार्गदर्शिकाएँ","count":50},{"language":"es","tag":"Conceptos básicos","count":43},{"language":"ko","tag":"기본 개념","count":43},{"language":"en","tag":"Lists","count":40},{"language":"es","tag":"Listas","count":40},{"language":"fr","tag":"Listes","count":40},{"language":"hi","tag":"सूचियाँ","count":40},{"language":"ja","tag":"リスト","count":40},{"language":"ko","tag":"리스트","count":40},{"language":"hi","tag":"बुनियादी बातें","count":39},{"language":"fr","tag":"Accueil","count":37},{"language":"ja","tag":"ホーム","count":37}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"@font-face{font-family:\"GraphikWide\";src:url(\"https://mintlify-assets.b-cdn.net/x/GraphikWide-Semibold-Trial.woff\") format(\"woff\");font-weight:600}.font-branded,h1,h2,h3{font-family:\"GraphikWide\";letter-spacing:-1%}.form{padding:15px;width:100%;min-height:300px;overflow-y:auto}.rate-limit-table th{text-align:left}tr td[data-label=\"Endpoint\"] a{font-size:12px}tr td[data-label=\"Pro Limit\"],tr td[data-label=\"Basic Limit\"],tr td[data-label=\"Free Limit\"]{font-size:12px}td[data-label=\"Pro Limit\"] strong,td[data-label=\"Basic Limit\"] strong,td[data-label=\"Free Limit\"] strong{margin-bottom:8px;display:block}.text-hero{color:white;font-weight:600;font-size:3rem;margin:0}@media (max-width: 767px){.text-hero{font-size:2rem}}#assistant-entry span{font-size:0!important;line-height:0!important}#assistant-entry span::before{content:\"Ask Grok\";font-size:0.875rem;line-height:1.5rem}#assistant-entry svg{display:none!important}#assistant-entry::before{content:\"\";display:inline-block;width:18px;height:18px;background-image:url(\"data:image/svg+xml,%3Csvg fill='%23000000' fill-rule='evenodd' height='1em' style='flex:none;line-height:1' viewBox='0 0 24 24' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3EGrok%3C/title%3E%3Cpath d='M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-size:contain;vertical-align:middle}.dark #assistant-entry::before{background-image:url(\"data:image/svg+xml,%3Csvg fill='%23ffffff' fill-rule='evenodd' height='1em' style='flex:none;line-height:1' viewBox='0 0 24 24' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3EGrok%3C/title%3E%3Cpath d='M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815'/%3E%3C/svg%3E\")}.chat-assistant-sheet-header span.font-semibold{font-size:0!important}.chat-assistant-sheet-header span.font-semibold::before{content:\"Grok\";font-size:0.875rem;font-weight:600}.chat-assistant-sheet-header svg.size-5.text-primary.dark\\:text-primary-light{display:none!important}.chat-assistant-sheet-header .flex.items-center.gap-2::before{content:\"\";display:inline-block;width:18px;height:18px;background-image:url(\"data:image/svg+xml,%3Csvg fill='%23000000' fill-rule='evenodd' height='1em' style='flex:none;line-height:1' viewBox='0 0 24 24' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3EGrok%3C/title%3E%3Cpath d='M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-size:contain;vertical-align:middle}.dark .chat-assistant-sheet-header .flex.items-center.gap-2::before{background-image:url(\"data:image/svg+xml,%3Csvg fill='%23ffffff' fill-rule='evenodd' height='1em' style='flex:none;line-height:1' viewBox='0 0 24 24' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3EGrok%3C/title%3E%3Cpath d='M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815'/%3E%3C/svg%3E\")}[data-component-part=\"update-label\"]{background-color:white;color:black!important}#navbar>*:nth-child(2){max-width:none!important;margin-left:0!important;margin-right:0!important}#sidebar{left:0!important}#sidebar-content{padding-left:2rem}#injected-slider{max-width:400px}#cost-estimator-button{position:relative}#cost-estimator-dropdown{min-width:400px;box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)}#usage-slider{-webkit-appearance:none;appearance:none;height:6px;background:#e5e7eb;outline:none;border-radius:3px}.dark #usage-slider{background:rgba(255, 255, 255, 0.1)}#usage-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:white;border:2px solid #00BA7C;border-radius:50%;cursor:pointer}.dark #usage-slider::-webkit-slider-thumb{background:#0B0C0E}#usage-slider::-moz-range-thumb{width:16px;height:16px;background:white;border:2px solid #00BA7C;border-radius:50%;cursor:pointer}.dark #usage-slider::-moz-range-thumb{background:#0B0C0E}"}],"page":{"pagePath":"fundamentals/authentication/oauth-2-0/overview","slug":"/fundamentals/authentication/oauth-2-0/overview","pageMetadata":{"title":"OAuth 2.0","sidebarTitle":"Overview","keywords":["OAuth 2.0","OAuth 2.0 authentication","OAuth 2.0 PKCE","Bearer token","app-only auth","OAuth 2.0 flow","authorization code"],"description":null,"href":"/fundamentals/authentication/oauth-2-0/overview"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`3`,id:`bearer-token-also-known-as-app-only`,children:`Bearer Token (also known as app-only)`}),`\n`,_jsxs(_components.p,{children:[`OAuth 2.0 Bearer Token authenticates requests on behalf of your `,_jsx(_components.a,{href:`/resources/fundamentals/developer-apps`,children:`developer App`}),`. As this method is specific to the App, it does not involve any users. This method is typically for developers that need read-only access to public information.\\xA0`]}),`\n`,_jsx(_components.p,{children:`This authentication method requires for you to pass a Bearer Token with your request, which you can generate within the Keys and tokens section of your developer Apps. Here is an example of what a request looks like with a fake Bearer Token:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`curl `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.x.com/2/tweets?ids=1261326399320715264,1278347468690915330\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAFnz2wAAAAAAxTmQbp%2BIHDtAhTBbyNJon%2BA72K4%3DeIaigY0QBrv6Rp8KZQQLOTpo9ubw5Jt?WRE8avbi\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`API calls using app-only authentication are `,_jsx(_components.a,{href:`/resources/fundamentals/rate-limits`,children:`rate limited`}),` per endpoint at the App level.`]}),`\n`,_jsxs(_components.p,{children:[`To use this method, you’ll need a Bearer Token, which you can generate by passing your API Key and Secret through the\\xA0`,_jsx(_components.a,{href:`/resources/fundamentals/authentication/api-reference#post-oauth2-token`,children:`POST oauth2/token`}),`\\xA0endpoint, or by generating it in the “keys and token” section of your App settings in the `,_jsx(_components.a,{href:`/resources/fundamentals/developer-portal`,children:`Developer Console`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`If you’d like to revoke a Bearer Token, you can use the\\xA0`,_jsx(_components.a,{href:`/resources/fundamentals/authentication/api-reference#post-oauth2-invalidate-token`,children:`POST oauth2/invalidate_token`}),`\\xA0endpoint, or click where it says “revoke” next to the Bearer Token in the “keys and tokens” section of your App settings.`]}),`\n`,_jsx(Heading,{level:`3`,id:`oauth-2-0-authorization-code-flow-with-pkce`,children:`OAuth 2.0\\xA0Authorization Code Flow with PKCE`}),`\n`,_jsx(_components.p,{children:`OAuth 2.0\\xA0Authorization Code Flow with PKCE allows you to authenticate on behalf of another user with have more control over an application’s scopes and improves authorization flows across multiple devices. In other words, developers building applications for people on X will have more control over the information their App requests from its users, so that you only have to ask your end-users for the data and information you need.`}),`\n`,_jsx(_components.p,{children:`This modern authorization protocol will allow you to present your end-users with a more streamlined consent flow for authorizing your app, which only displays the specific scopes you have requested from them. Not only does this reduce your data burden, but it may also lead to increased trust from end-users.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"OAuth 2.0","sidebarTitle":"Overview","keywords":["OAuth 2.0","OAuth 2.0 authentication","OAuth 2.0 PKCE","Bearer token","app-only auth","OAuth 2.0 flow","authorization code"],"description":null,"href":"/fundamentals/authentication/oauth-2-0/overview"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Bearer Token (also known as app-only)","slug":"bearer-token-also-known-as-app-only","depth":3,"children":[]},{"title":"OAuth 2.0 Authorization Code Flow with PKCE","slug":"oauth-2-0-authorization-code-flow-with-pkce","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/generaltranslation/f67e695317871503/widgets.js","/_mintlify/custom/generaltranslation/dd4721d49d6e0698/sliders.js"],"subdomain":"generaltranslation","siteName":"X","title":"OAuth 2.0 - X","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/fundamentals/authentication/oauth-2-0/overview","matchLevel":0},"es":{"href":"/es/fundamentals/authentication/oauth-2-0/overview","matchLevel":1},"fr":{"href":"/fr/fundamentals/authentication/oauth-2-0/overview","matchLevel":1},"hi":{"href":"/hi/fundamentals/authentication/oauth-2-0/overview","matchLevel":1},"ja":{"href":"/ja/fundamentals/authentication/oauth-2-0/overview","matchLevel":1},"ko":{"href":"/ko/fundamentals/authentication/oauth-2-0/overview","matchLevel":1}}},"lastModified":"2026-04-02T03:58:07.264Z","originalFileLocation":"fundamentals/authentication/oauth-2-0/overview.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Build, analyze, and innovate with X\u0026#x27;s real-time, global data and APIs. Access comprehensive API documentation, SDKs, tutorials, and developer tools.\">\u003cmeta data-mint-head name=\"application-name\" content=\"X\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"OAuth 2.0 - X\">\u003cmeta data-mint-head property=\"og:description\" content=\"Build, analyze, and innovate with X\u0026#x27;s real-time, global data and APIs. Access comprehensive API documentation, SDKs, tutorials, and developer tools.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"X Developer Platform\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://generaltranslation.mintlify.site/_mintlify/api/og/v2?division=OAuth+2.0\u0026amp;title=OAuth+2.0\u0026amp;theme=3199bd2c292b5ac8dc3f7441\u0026amp;signature=39fd1434ff3750d25a0bf3cceb115f7bef2076dbb030a7a666bc8effc9c1f1c4\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"OAuth 2.0 - X\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Build, analyze, and innovate with X\u0026#x27;s real-time, global data and APIs. Access comprehensive API documentation, SDKs, tutorials, and developer tools.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://generaltranslation.mintlify.site/_mintlify/api/og/v2?division=OAuth+2.0\u0026amp;title=OAuth+2.0\u0026amp;theme=3199bd2c292b5ac8dc3f7441\u0026amp;signature=39fd1434ff3750d25a0bf3cceb115f7bef2076dbb030a7a666bc8effc9c1f1c4\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/generaltranslation/3OgqNYd4DMBAanRo/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"X\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0E0E0E\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"author\" content=\"X Developer Platform\">\u003cmeta data-mint-head name=\"language\" content=\"en\">\u003cmeta data-mint-head name=\"googlebot\" content=\"index, follow\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/fundamentals/authentication/oauth-2-0/overview.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.x.com/es/fundamentals/authentication/oauth-2-0/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.x.com/fr/fundamentals/authentication/oauth-2-0/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"hi\" href=\"https://docs.x.com/hi/fundamentals/authentication/oauth-2-0/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.x.com/ja/fundamentals/authentication/oauth-2-0/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.x.com/ko/fundamentals/authentication/oauth-2-0/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.x.com/#organization\",\"name\":\"X\",\"url\":\"https://docs.x.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/generaltranslation/p-tsc5qa00w8y5M4/logo/light.svg?fit=max\u0026auto=format\u0026n=p-tsc5qa00w8y5M4\u0026q=85\u0026s=299a991122fb35a82f868bc62a8be1ae\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.x.com#website\",\"name\":\"X\",\"url\":\"https://docs.x.com\",\"publisher\":{\"@id\":\"https://docs.x.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview#webpage\",\"url\":\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview\",\"name\":\"OAuth 2.0\",\"dateModified\":\"2026-04-02T03:58:07.264Z\",\"isPartOf\":{\"@id\":\"https://docs.x.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Fundamentals\",\"item\":\"https://docs.x.com/fundamentals/developer-apps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authentication\",\"item\":\"https://docs.x.com/fundamentals/authentication/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"OAuth 2.0\",\"item\":\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview#article\",\"headline\":\"OAuth 2.0\",\"name\":\"OAuth 2.0\",\"url\":\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview\",\"mainEntityOfPage\":{\"@id\":\"https://docs.x.com/fundamentals/authentication/oauth-2-0/overview#webpage\"},\"dateModified\":\"2026-04-02T03:58:07.264Z\",\"keywords\":\"OAuth 2.0, OAuth 2.0 authentication, OAuth 2.0 PKCE, Bearer token, app-only auth, OAuth 2.0 flow, authorization code\",\"publisher\":{\"@id\":\"https://docs.x.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.x.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"X\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"X\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/fundamentals/authentication/oauth-2-0/overview.md","siteName":"X","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"Home","groups":[{"group":"Getting Started","pages":[{"title":"X Developer Platform","sidebarTitle":"Overview","mode":"wide","icon":"house","href":"/overview"}]},{"group":"Fundamentals","pages":[{"title":"Apps","sidebarTitle":"Apps","icon":"cube","href":"/fundamentals/developer-apps"},{"title":"Developer Console","sidebarTitle":"Developer Console","icon":"grid-2","href":"/fundamentals/developer-portal"},{"group":"Authentication","icon":"key","pages":[{"title":"Authentication","sidebarTitle":"Overview","href":"/fundamentals/authentication/overview"},{"group":"Guides","pages":[{"title":"Log in with X","href":"/fundamentals/authentication/guides/log-in-with-x"},{"title":"Best practices","href":"/fundamentals/authentication/guides/authentication-best-practices"},{"title":"Connection to X API using TLS","sidebarTitle":"TLS","href":"/fundamentals/authentication/guides/tls"},{"title":"X API v2 authentication mapping","sidebarTitle":"Endpoint mapping","href":"/fundamentals/authentication/guides/v2-authentication-mapping"}]},{"group":"OAuth 1.0a","pages":[{"title":"API Key and Secret","sidebarTitle":"API Key and Secret","href":"/fundamentals/authentication/oauth-1-0a/api-key-and-secret"},{"title":"Obtaining Access Tokens using 3-legged OAuth flow","sidebarTitle":"User Access Tokens (3-legged OAuth flow)","href":"/fundamentals/authentication/oauth-1-0a/obtaining-user-access-tokens"},{"title":"Authorizing a request","sidebarTitle":"Authorizing a request","href":"/fundamentals/authentication/oauth-1-0a/authorizing-a-request"},{"title":"OAuth Echo","sidebarTitle":"OAuth Echo","href":"/fundamentals/authentication/oauth-1-0a/oauth-echo"},{"title":"PIN-based authorization","sidebarTitle":"PIN-based OAuth","href":"/fundamentals/authentication/oauth-1-0a/pin-based-oauth"},{"title":"Creating a signature","sidebarTitle":"Creating a signature","href":"/fundamentals/authentication/oauth-1-0a/creating-a-signature"},{"title":"Percent encoding parameters","sidebarTitle":"Percent encoding parameters","description":null,"href":"/fundamentals/authentication/oauth-1-0a/percent-encoding-parameters"}]},{"group":"OAuth 2.0","pages":[{"title":"OAuth 2.0","sidebarTitle":"Overview","href":"/fundamentals/authentication/oauth-2-0/overview"},{"title":"App only authentication and OAuth 2.0 Bearer Token","sidebarTitle":"OAuth 2.0 App-Only (Bearer Token)","description":null,"href":"/fundamentals/authentication/oauth-2-0/application-only"},{"title":"Using and generating an app-only Bearer Token","sidebarTitle":"Generating and using app-only Bearer Tokens","href":"/fundamentals/authentication/oauth-2-0/bearer-tokens"},{"title":"OAuth 2.0 Authorization Code Flow with PKCE","sidebarTitle":"OAuth 2.0 Authorization Code Flow with PKCE","href":"/fundamentals/authentication/oauth-2-0/authorization-code"},{"title":"How to connect to endpoints using OAuth 2.0 Authorization Code Flow with PKCE","sidebarTitle":"OAuth 2.0 Making requests on behalf of users","href":"/fundamentals/authentication/oauth-2-0/user-access-token"}]},{"title":"Basic authentication","sidebarTitle":"Basic authentication","href":"/fundamentals/authentication/basic-auth"},{"title":"OAuth FAQ","sidebarTitle":"FAQ","href":"/fundamentals/authentication/faq"},{"title":"OAuth API reference index","sidebarTitle":"API reference","href":"/fundamentals/authentication/api-reference"}]},{"title":"Counting Characters","sidebarTitle":"Counting Characters","icon":"text-size","href":"/fundamentals/counting-characters"},{"title":"Rate Limits","sidebarTitle":"Rate Limits","icon":"gauge-high","href":"/fundamentals/rate-limits"},{"title":"X IDs","sidebarTitle":"X IDs","icon":"fingerprint","href":"/fundamentals/x-ids"},{"title":"Security","sidebarTitle":"Security","icon":"shield-halved","href":"/fundamentals/security"}]},{"group":"Partners \u0026 Customers","pages":[{"title":"X Official Partner","sidebarTitle":"Partner Directory","href":"/enterprise/partner-directory"},{"title":"Enterprise data customers","sidebarTitle":"Customer Directory","href":"/enterprise/customer-directory"},{"group":"Request Access","pages":[{"title":"Enterprise Access Form","href":"/forms/enterprise-api-interest"},{"title":"Government End User Request Form","href":"/forms/government-end-user-request"}]}]},{"group":"Resources","pages":[{"title":"Tools and Libraries","mode":"wide","icon":"toolbox","href":"/tools-and-libraries"},{"title":"Tutorials","mode":"wide","icon":"link","href":"/tutorials"},{"title":"Subscribe to developer news","sidebarTitle":"Newsletter","mode":"wide","icon":"envelope","href":"/newsletter"},{"title":"X Developer Platform Livestreams","sidebarTitle":"Livestreams","mode":"wide","icon":"video","href":"/livestreams"},{"title":"Billing support form","sidebarTitle":"Billing Support","icon":"headset","href":"/forms/billing-support"},{"title":"Policies and agreements","sidebarTitle":"Developer Terms","mode":"wide","icon":"gavel","href":"/developer-terms"}]}]},{"tab":"X API","pages":[{"title":"X API","href":"/x-api/introduction"}]},{"tab":"X Ads API","pages":[{"title":"X Ads API","href":"/x-ads-api/introduction"}]},{"tab":"XDKs","pages":[{"title":"XDKs","href":"/xdks/overview"}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/tutorials/explore-a-users-posts"}]},{"tab":"Use Cases","pages":[{"title":"Use Cases","href":"/use-cases/build-for-business"}]},{"tab":"Success Stories","pages":[{"title":"Success Stories","href":"/success-stories"}]},{"tab":"Status","pages":[{"title":"Status","href":"/status"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"Python SDK","hidden":true,"pages":[{"title":"Python SDK","href":"/xdks/python/overview"}]},{"tab":"TypeScript SDK","hidden":true,"pages":[{"title":"TypeScript SDK","href":"/xdks/typescript/overview"}]}],"global":{"anchors":[{"anchor":"Developer Console","icon":"circle-play","href":"https://developer.x.com/en/portal/petition/essential/basic-info"},{"anchor":"Forums","icon":"messages","href":"https://devcommunity.x.com"},{"anchor":"GitHub","icon":"github","href":"https://github.com/xdevplatform"}]}},{"language":"es","pages":[{"title":"es","href":"/es/fundamentals/authentication/oauth-2-0/overview"}]},{"language":"fr","pages":[{"title":"fr","href":"/fr/fundamentals/authentication/oauth-2-0/overview"}]},{"language":"hi","pages":[{"title":"hi","href":"/hi/fundamentals/authentication/oauth-2-0/overview"}]},{"language":"ja","pages":[{"title":"ja","href":"/ja/fundamentals/authentication/oauth-2-0/overview"}]},{"language":"ko","pages":[{"title":"ko","href":"/ko/fundamentals/authentication/oauth-2-0/overview"}]}]},"basePath":"","title":"OAuth 2.0 - X","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":[],"chunks":[]}