{"templateId":"markdown","versions":[],"sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab"]},"type":"markdown"},"seo":{"title":"OAuth 2.0","description":"Trackonomy Documentation for External APIs","image":"/assets/trackonomy-logo-black.b2d7af6f03349283c4fbc842022899d45af5159861bee6e5c188670150afc0b4.db81178d.png","meta":[{"name":"og:title","content":"Trackonomy Documentation Portal"},{"name":"og:description","content":"Trackonomy Documentation for External APIs"},{"name":"twitter:description","content":"Trackonomy Documentation for External APIs"}]},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"oauth-20","__idx":0},"children":["OAuth 2.0"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In order to acquire the Bearer Token, OAuth's Password Flow must be used."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For that, you have to send the following POST request to the provided OAuth URL, using credentials from the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Fact Sheet"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["NB! Note different audience for different endpoints."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-requests","__idx":1},"children":["Example requests"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"cURL","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"curl","header":{"controls":{"copy":{}}},"source":"curl --request POST \\\n  --url 'https://{OAuth_URL}' \\\n  --header 'content-type: application/x-www-form-urlencoded' \\\n  --data grant_type=password \\\n  --data client_id=CLIENT_ID \\\n  --data audience=AUDIENCE \\\n  --data username=USERNAME \\\n  --data password=PASSWORD\n","lang":"curl"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Node.JS","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"var axios = require(\"axios\").default;\n\nvar options = {\n  method: 'POST',\n  url: 'https://{OAuth_URL}',\n  headers: {'content-type': 'application/x-www-form-urlencoded'},\n  data: new URLSearchParams({\n    grant_type: 'password',\n    client_id: 'CLIENT_ID',\n    audience: 'AUDIENCE',\n    username: 'USERNAME'\n    password: 'PASSWORD'\n  })\n};\n\naxios.request(options).then(function (response) {\n  console.log(response.data);\n}).catch(function (error) {\n  console.error(error);\n});\n","lang":"javascript"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"response","__idx":2},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A successful response would return the following JSON with token"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"access_token\":\"eyJz93a...k4laUWw\",\n  \"token_type\":\"Bearer\",\n  \"expires_in\":86400\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issued Bearer ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["tokens are valid for 24 hours"]},", after which you would need to request a new token."]}]},"headings":[{"value":"OAuth 2.0","id":"oauth-20","depth":1},{"value":"Example requests","id":"example-requests","depth":3},{"value":"Response","id":"response","depth":3}],"frontmatter":{"rbac":{"admin":"admin","external_developers":"read","anonymous":"read"},"seo":{"title":"OAuth 2.0"}},"lastModified":"2026-03-24T14:51:20.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/external-api/v1.6/authentication/oauth-20","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}