Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.
In this section, we’ll look at passing Authorization and Authentication information in our requests, by accessing the GitHub REST API.Let’s try making a GET request to the URL https://api.github.com/user.You’ll get the following response:
This is because you are not authorized to access the API and to gain access you would need to authenticate yourself. We use tokens to authenticate a user and to do so we first need to generate an access token from GitHub.
To get access to the GitHub API, you first need to generate a personal access token. For our demonstration, we will generate one granting access to public repositories.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Hoppscotch Documentation","description":"Find user guides, quickstarts, tutorials, use cases, code samples, and more.","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/hoppscotch/YzZ1u98z3f2mVgzZ/logo/light.svg?fit=max\u0026auto=format\u0026n=YzZ1u98z3f2mVgzZ\u0026q=85\u0026s=b61955a81bc00d70adfa5f8633848cd9","dark":"https://mintcdn.com/hoppscotch/YzZ1u98z3f2mVgzZ/logo/dark.svg?fit=max\u0026auto=format\u0026n=YzZ1u98z3f2mVgzZ\u0026q=85\u0026s=2630e96c15d9cdafd16ed468ce7e146d"},"favicon":"https://mintcdn.com/hoppscotch/YzZ1u98z3f2mVgzZ/favicon.svg?fit=max\u0026auto=format\u0026n=YzZ1u98z3f2mVgzZ\u0026q=85\u0026s=50976061e41b634209dc92da5209db5b","navbar":{"primary":{"type":"github","href":"https://github.com/hoppscotch/hoppscotch"}},"footer":{"socials":{"discord":"https://hoppscotch.io/discord","x":"https://hoppscotch.io/twitter","linkedin":"https://www.linkedin.com/company/hoppscotch"}},"search":{"prompt":"Search"},"styling":{"eyebrows":"breadcrumbs","latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"hoppscotch","hasAudioNarration":false,"actualSubdomain":"hoppscotch","customDomains":["docs.hoppscotch.io"],"gitSource":{"type":"github","owner":"hoppscotch","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6abd09cc08245e67b4f3c51e","collectionId":"8167c2a3-9774-40d0-ba25-e1939dff934f","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6abd09cc08245e67b4f3c51e"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{},"buildId":"6abd09cc08245e67b4f3c51e","clientVersion":"0.0.3966","searchFilterCounts":[{"language":"default","tag":"Documentation","count":84},{"language":"default","tag":"Features","count":26},{"language":"default","tag":"Getting started","count":25},{"language":"default","tag":"Self-Host","count":20},{"language":"default","tag":"Enterprise Edition","count":12},{"language":"default","tag":"Support","count":12},{"language":"default","tag":"Resources","count":10},{"language":"default","tag":"RESTful API","count":10},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Clients","count":9}]},"assistantConfig":{},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"documentation/getting-started/rest/auth-tokens","slug":"/documentation/getting-started/rest/auth-tokens","pageMetadata":{"sidebarTitle":"Using auth tokens","title":"Using auth tokens","description":"Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.","href":"/documentation/getting-started/rest/auth-tokens"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"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`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`In this section, we’ll look at passing Authorization and Authentication information in our requests, by accessing the `,_jsx(_components.a,{href:`https://docs.github.com/en/rest`,children:`GitHub REST API`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Let’s try making a `,_jsx(_components.code,{children:`GET`}),` request to the URL `,_jsx(_components.code,{children:`https://api.github.com/user`}),`.`]}),`\n`,_jsx(_components.p,{children:`You’ll get the following response:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Requires authentication\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"documentation_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://docs.github.com/rest/reference/users#get-the-authenticated-user\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This is because you are not authorized to access the API and to gain access you would need to authenticate yourself. We use tokens to authenticate a user and to do so we first need to generate an access token from GitHub.`}),`\n`,_jsx(Heading,{level:`2`,id:`generating-access-token`,children:`Generating access token`}),`\n`,_jsx(_components.p,{children:`To get access to the GitHub API, you first need to generate a personal access token. For our demonstration, we will generate one granting access to public repositories.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Login to the GitHub account.`}),`\n`,_jsxs(_components.li,{children:[`Go to your `,_jsx(_components.a,{href:`https://github.com/settings/tokens`,children:`personal access tokens page`}),` and click on “`,_jsx(_components.strong,{children:`Generate new token`}),`”.`]}),`\n`,_jsx(_components.li,{children:`Select tokens (classic).`}),`\n`,_jsxs(_components.li,{children:[`Specify the note as “`,_jsx(_components.strong,{children:`Hoppscotch API`}),`” so that you can remember why you created it.`]}),`\n`,_jsxs(_components.li,{children:[`Under the “Select scopes” section only check `,_jsx(_components.code,{children:`public_repo`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Scroll down and click on “`,_jsx(_components.strong,{children:`Generate token`}),`”.`]}),`\n`,_jsx(_components.li,{children:`You just generated your access token, now copy the token to your clipboard.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`storing-auth-token-in-a-variable`,children:`Storing auth token in a variable`}),`\n`,_jsx(Tip,{children:`It is a recommended safe practice to have your auth details in environment variables rather than inputting them directly to the authorization tab.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Click on the “`,_jsx(_components.strong,{children:`Global`}),`” environment to add a variable.`]}),`\n`,_jsxs(_components.li,{children:[`Create a variable called `,_jsx(_components.code,{children:`token`}),` and paste the token from GitHub as its value.`]}),`\n`,_jsxs(_components.li,{children:[`Now open the Authorization tab and select `,_jsx(_components.code,{children:`Bearer`}),` from the dropdown list.`]}),`\n`,_jsxs(_components.li,{children:[`Input the token as shown below, make sure that you reference the token in variable format, i.e. `,_jsx(_components.code,{children:`\u003c\u003ctoken>>`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Click on “`,_jsx(_components.strong,{children:`Send`}),`”.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`You should now see the response including details about your GitHub account.`})]})}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":{"sidebarTitle":"Using auth tokens","title":"Using auth tokens","description":"Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.","href":"/documentation/getting-started/rest/auth-tokens"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Generating access token","slug":"generating-access-token","depth":2,"children":[]},{"title":"Storing auth token in a variable","slug":"storing-auth-token-in-a-variable","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"hoppscotch","siteName":"Hoppscotch Documentation","title":"Using auth tokens - Hoppscotch Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-11T04:39:27.756Z","originalFileLocation":"documentation/getting-started/rest/auth-tokens.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;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=\"system\"}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=\"Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Hoppscotch Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_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/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hoppscotch/0ihOcYjw6krFrYtR/_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/hoppscotch/0ihOcYjw6krFrYtR/_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/hoppscotch/0ihOcYjw6krFrYtR/_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/hoppscotch/0ihOcYjw6krFrYtR/_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/hoppscotch/0ihOcYjw6krFrYtR/_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/hoppscotch/0ihOcYjw6krFrYtR/_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/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Using auth tokens - Hoppscotch Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Hoppscotch Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://hoppscotch.mintlify.app/_mintlify/api/og/v2?division=RESTful+API\u0026amp;title=Using+auth+tokens\u0026amp;description=Authenticate+API+requests+in+Hoppscotch+using+bearer+tokens.+Follow+a+step-by-step+tutorial+with+the+GitHub+REST+API+as+an+example.\u0026amp;theme=4e522b26811728ab4595af2b\u0026amp;signature=42a902ef1b618b10e881e5b8b29baf4c3c80f68ef9536c24986a1183fa524db4\">\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=\"Using auth tokens - Hoppscotch Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://hoppscotch.mintlify.app/_mintlify/api/og/v2?division=RESTful+API\u0026amp;title=Using+auth+tokens\u0026amp;description=Authenticate+API+requests+in+Hoppscotch+using+bearer+tokens.+Follow+a+step-by-step+tutorial+with+the+GitHub+REST+API+as+an+example.\u0026amp;theme=4e522b26811728ab4595af2b\u0026amp;signature=42a902ef1b618b10e881e5b8b29baf4c3c80f68ef9536c24986a1183fa524db4\">\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/hoppscotch/0ihOcYjw6krFrYtR/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Hoppscotch Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/documentation/getting-started/rest/auth-tokens.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hoppscotch.io/#organization\",\"name\":\"Hoppscotch Documentation\",\"url\":\"https://docs.hoppscotch.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/hoppscotch/YzZ1u98z3f2mVgzZ/logo/light.svg?fit=max\u0026auto=format\u0026n=YzZ1u98z3f2mVgzZ\u0026q=85\u0026s=b61955a81bc00d70adfa5f8633848cd9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hoppscotch.io#website\",\"name\":\"Hoppscotch Documentation\",\"url\":\"https://docs.hoppscotch.io\",\"publisher\":{\"@id\":\"https://docs.hoppscotch.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens#webpage\",\"url\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens\",\"name\":\"Using auth tokens\",\"description\":\"Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.\",\"dateModified\":\"2026-04-11T04:39:27.756Z\",\"isPartOf\":{\"@id\":\"https://docs.hoppscotch.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting started\",\"item\":\"https://docs.hoppscotch.io/documentation/getting-started/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RESTful API\",\"item\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/creating-a-request\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Using auth tokens\",\"item\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens#article\",\"headline\":\"Using auth tokens\",\"name\":\"Using auth tokens\",\"description\":\"Authenticate API requests in Hoppscotch using bearer tokens. Follow a step-by-step tutorial with the GitHub REST API as an example.\",\"url\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hoppscotch.io/documentation/getting-started/rest/auth-tokens#webpage\"},\"dateModified\":\"2026-04-11T04:39:27.756Z\",\"publisher\":{\"@id\":\"https://docs.hoppscotch.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hoppscotch.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Hoppscotch Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Hoppscotch Documentation","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"lines-leaning","groups":[{"group":"Getting started","pages":[{"sidebarTitle":"Introduction","title":"Introduction to Hoppscotch","href":"/documentation/getting-started/introduction"},{"sidebarTitle":"Quick start","title":"Quick start","href":"/documentation/getting-started/quick-start"},{"sidebarTitle":"Clients","title":"Hoppscotch Clients","href":"/documentation/getting-started/clients"},{"sidebarTitle":"Setup","title":"Setup Hoppscotch","href":"/documentation/getting-started/setup"},{"sidebarTitle":"Troubleshooting","title":"Troubleshooting","href":"/documentation/getting-started/troubleshooting"},{"group":"RESTful API","pages":[{"sidebarTitle":"Creating a request","title":"Creating a request","href":"/documentation/getting-started/rest/creating-a-request"},{"sidebarTitle":"Response handling","title":"Response handling","href":"/documentation/getting-started/rest/response-handling"},{"sidebarTitle":"Request parameters","title":"Request parameters","href":"/documentation/getting-started/rest/request-parameters"},{"sidebarTitle":"Request headers","title":"Request headers","href":"/documentation/getting-started/rest/request-headers"},{"sidebarTitle":"Organizing requests","title":"Organizing requests","href":"/documentation/getting-started/rest/organizing-requests"},{"sidebarTitle":"Environment variables","title":"Environment variables","description":"Store and reuse values like base URLs and API keys with environment variables in Hoppscotch. Create environments and reference variables.","href":"/documentation/getting-started/rest/environment-variables"},{"sidebarTitle":"Using auth tokens","title":"Using auth tokens","href":"/documentation/getting-started/rest/auth-tokens"},{"sidebarTitle":"Uploading data","title":"Uploading data","description":"Upload files and encoded data to APIs in Hoppscotch using POST or PUT methods with multipart form data, JSON, or binary content types.","href":"/documentation/getting-started/rest/uploading-data"},{"sidebarTitle":"Pre-request scripts","title":"Pre-request scripts","href":"/documentation/getting-started/rest/pre-request-scripts"},{"sidebarTitle":"Tests","title":"Tests","href":"/documentation/getting-started/rest/tests"}]},{"group":"GraphQL API","pages":[{"sidebarTitle":"Running a simple query","title":"Running a simple query","href":"/documentation/getting-started/graphql/creating-a-query"},{"sidebarTitle":"Using variables","title":"Using variables in a GraphQL query","href":"/documentation/getting-started/graphql/using-variables"}]},{"group":"Realtime API","pages":[{"sidebarTitle":"Websocket","title":"Websocket","href":"/documentation/getting-started/realtime/websocket"},{"sidebarTitle":"Socket.IO","title":"Socket.IO","href":"/documentation/getting-started/realtime/socket-io"},{"sidebarTitle":"SSE","title":"Server-Sent Events","href":"/documentation/getting-started/realtime/sse"},{"sidebarTitle":"MQTT","title":"MQTT","href":"/documentation/getting-started/realtime/mqtt"}]}]},{"group":"Clients","pages":[{"group":"Desktop","pages":[{"sidebarTitle":"Overview","title":"Hoppscotch Desktop App","href":"/documentation/clients/desktop/overview"},{"sidebarTitle":"Setup","title":"Connect to Hoppscotch","href":"/documentation/clients/desktop/setup"}]},{"group":"Web","pages":[{"sidebarTitle":"Overview","title":"Hoppscotch Web App","href":"/documentation/clients/web/overview"},{"sidebarTitle":"Progressive Web App","title":"Hoppscotch Progressive Web App","href":"/documentation/clients/web/pwa"}]},{"group":"CLI","pages":[{"sidebarTitle":"Overview","title":"Hoppscotch CLI","href":"/documentation/clients/cli/overview"},{"sidebarTitle":"Troubleshooting","title":"Hoppscotch CLI Troubleshooting","href":"/documentation/clients/cli/troubleshooting"}]},{"group":"MCP server","pages":[{"sidebarTitle":"Overview","title":"Hoppscotch MCP Server","href":"/documentation/clients/mcp-server/overview"},{"sidebarTitle":"Tools","title":"Hoppscotch MCP Server Tools","href":"/documentation/clients/mcp-server/tools"},{"sidebarTitle":"Troubleshooting","title":"Hoppscotch MCP Server Troubleshooting","href":"/documentation/clients/mcp-server/troubleshooting"}]}]},{"group":"Protocols","pages":[{"sidebarTitle":"RESTful","title":"RESTful","href":"/documentation/protocols/rest"},{"sidebarTitle":"GraphQL","title":"GraphQL","href":"/documentation/protocols/graphql"},{"sidebarTitle":"Realtime","title":"Realtime","href":"/documentation/protocols/realtime"}]},{"group":"Features","pages":[{"sidebarTitle":"Workspaces","title":"Workspaces","href":"/documentation/features/workspaces"},{"sidebarTitle":"Collections","title":"Collections","href":"/documentation/features/collections"},{"sidebarTitle":"Runner","title":"Runner","href":"/documentation/features/runner"},{"sidebarTitle":"Variables","title":"Variables","href":"/documentation/features/variables"},{"sidebarTitle":"Environments","title":"Environments","href":"/documentation/features/environments"},{"sidebarTitle":"Personal Access Token","title":"Personal Access Token","href":"/documentation/features/pat"},{"sidebarTitle":"History","title":"History","href":"/documentation/features/history"},{"sidebarTitle":"Spotlight","title":"Spotlight","href":"/documentation/features/spotlight"},{"sidebarTitle":"Shortcuts","title":"Shortcuts","href":"/documentation/features/shortcuts"},{"sidebarTitle":"Scripts","title":"Scripts","href":"/documentation/features/scripts"},{"sidebarTitle":"Importer","title":"Importer","href":"/documentation/features/importer"},{"sidebarTitle":"Customization","title":"Customization","href":"/documentation/features/customization"},{"sidebarTitle":"Inspections","title":"Inspections","href":"/documentation/features/inspections"},{"sidebarTitle":"Cookies","title":"Cookies","href":"/documentation/features/cookies"},{"sidebarTitle":"Client Certificate","title":"Client Certificate","href":"/documentation/features/client-certificate"},{"sidebarTitle":"Code Snippets","title":"Code Snippets","href":"/documentation/features/snippets"},{"sidebarTitle":"Interceptor","title":"Interceptor","href":"/documentation/features/interceptor"},{"sidebarTitle":"Context Menu","title":"Context Menu","href":"/documentation/features/context-menu"},{"sidebarTitle":"Widgets","title":"Widgets","href":"/documentation/features/widgets"},{"sidebarTitle":"Authorization","title":"Authorization","href":"/documentation/features/authorization"},{"sidebarTitle":"AI Features","title":"AI Features","href":"/documentation/features/ai-features"},{"sidebarTitle":"Mock","title":"API Mocking","href":"/documentation/features/mock"},{"sidebarTitle":"Documentation","title":"API Documentation","href":"/documentation/features/documentation"},{"sidebarTitle":"RESTful API","title":"RESTful API Testing","href":"/documentation/features/rest-api-testing"},{"sidebarTitle":"GraphQL API","title":"GraphQL API Testing","href":"/documentation/features/graphql-api-testing"},{"sidebarTitle":"Realtime API","title":"Realtime API Testing","href":"/documentation/features/realtime-api-testing"}]},{"group":"Self-Host","pages":[{"sidebarTitle":"Getting started","title":"Getting started with self-hosting","href":"/documentation/self-host/getting-started"},{"group":"Community Edition","pages":[{"sidebarTitle":"Getting started","title":"Getting started with Community Edition","href":"/documentation/self-host/community-edition/getting-started"},{"sidebarTitle":"Prerequisites","title":"Community Edition prerequisites","href":"/documentation/self-host/community-edition/prerequisites"},{"sidebarTitle":"Install and build","title":"Install and build Community Edition","href":"/documentation/self-host/community-edition/install-and-build"},{"sidebarTitle":"Setup and access","title":"Set up and access Community Edition","href":"/documentation/self-host/community-edition/setup-and-access"},{"sidebarTitle":"Admin dashboard","title":"Community Edition admin dashboard","href":"/documentation/self-host/community-edition/admin-dashboard"},{"sidebarTitle":"Deploy and upgrade","title":"Deploy and upgrade Community Edition","href":"/documentation/self-host/community-edition/deploy-and-upgrade"},{"sidebarTitle":"Telemetry","title":"Community Edition telemetry","href":"/documentation/self-host/community-edition/telemetry"}]},{"group":"Enterprise Edition","pages":[{"sidebarTitle":"Getting started","title":"Getting started with Enterprise Edition","href":"/documentation/self-host/enterprise-edition/getting-started"},{"sidebarTitle":"Prerequisites","title":"Enterprise Edition prerequisites","href":"/documentation/self-host/enterprise-edition/prerequisites"},{"sidebarTitle":"Install and build","title":"Install and build Enterprise Edition","href":"/documentation/self-host/enterprise-edition/install-and-build"},{"sidebarTitle":"Setup and access","title":"Set up and access Enterprise Edition","href":"/documentation/self-host/enterprise-edition/setup-and-access"},{"sidebarTitle":"Admin dashboard","title":"Enterprise Edition admin dashboard","href":"/documentation/self-host/enterprise-edition/admin-dashboard"},{"sidebarTitle":"User provisioning","title":"SCIM Integration for User and Group Provisioning","href":"/documentation/self-host/enterprise-edition/user-provisioning"},{"sidebarTitle":"Activity logs","title":"Activity logs","href":"/documentation/self-host/enterprise-edition/activity-logs"},{"sidebarTitle":"User groups","title":"User groups","href":"/documentation/self-host/enterprise-edition/user-groups"},{"sidebarTitle":"AI Assistant","title":"AI Assistant","href":"/documentation/self-host/enterprise-edition/ai-assistant"},{"sidebarTitle":"Observability","title":"Observability","href":"/documentation/self-host/enterprise-edition/observability"},{"sidebarTitle":"Deploy and upgrade","title":"Deploy and upgrade Enterprise Edition","href":"/documentation/self-host/enterprise-edition/deploy-and-upgrade"},{"sidebarTitle":"Telemetry","title":"Enterprise Edition telemetry","href":"/documentation/self-host/enterprise-edition/telemetry"}]}]},{"group":"Resources","pages":[{"sidebarTitle":"Community","title":"Hoppscotch community","href":"/documentation/community"},{"sidebarTitle":"Contributors","title":"Contributors","href":"/documentation/contributors"},{"sidebarTitle":"Changelog","title":"Changelog","href":"/documentation/changelog"},{"sidebarTitle":"Develop","title":"Develop","href":"/documentation/develop"},{"sidebarTitle":"i18n","title":"i18n","href":"/documentation/i18n"}]}]},{"anchor":"Guides","icon":"check-double","pages":[{"title":"Guides","href":"/guides/getting-started/introduction"}]},{"anchor":"Support","icon":"question","pages":[{"title":"Support","href":"/support/getting-started/introduction"}]},{"anchor":"Download","icon":"angles-down","href":"https://hoppscotch.com/download"},{"anchor":"Blog","icon":"quote-left","href":"https://hoppscotch.com/blog"},{"anchor":"Changelog","icon":"shapes","href":"https://github.com/hoppscotch/hoppscotch/releases"}]},"title":"Using auth tokens - Hoppscotch Documentation","buildId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","deploymentId":"dpl_cadrRc5H9XQiJQbDFN5mcYRs2PAj","dynamics":[],"chunks":[]}