Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I built a report using the KnowBe4 reporting API. Everything is working OK and refreshes OK when I hit refresh in my report.
Aim
To publish the report and for the data to be refreshed on a schedule
Problem
When I edit the semantic model setting and try and set the refresh interval it prompts me to login to the KnowBe4 URL, it does not seem to provide the option to use the Authorization header option where I would then type "Bearer" followed by a space and then my API token.
Can someone let me know where I am going wrong and how to solve,
Many thanks
Solved! Go to Solution.
Hi @foxyox ,
Its because you can set the token directly in your query, but the Power BI Service doesn’t support custom Authorization headers (like “Bearer {token}”) when scheduling a refresh.
When you publish to the Service, it only allows certain built-in authentication methods, and there’s no way to manually enter or refresh a Bearer token for the schedule. If your API token is static and never expires, you can sometimes hard-code it in your query, but this isn’t secure or recommended. Most APIs use tokens that expire, which means refresh will break unless your code can automatically get a new token each time.
Best ways to handle this:
Custom connector: The most robust fix is building a custom Power Query connector that handles the authentication flow for you. This requires some coding but is fully supported.
Azure Data Factory or Logic Apps: Another popular workaround is using an Azure service to pull the API data (with the right authentication), save it to a database or storage, then connect Power BI to that.
API keys: If your API supports static API keys, those are much easier to use with scheduled refresh.
Power BI Service can’t schedule refreshes for APIs that need dynamic Bearer tokens unless you build a connector or stage the data elsewhere.
Hi @foxyox I am agree with @lbendlin you can manage this authentication in power query. Try this to fix in power query https://stackoverflow.com/questions/40753188/google-oauth-refresh-tokens-in-power-query
Hi @foxyox ,
Its because you can set the token directly in your query, but the Power BI Service doesn’t support custom Authorization headers (like “Bearer {token}”) when scheduling a refresh.
When you publish to the Service, it only allows certain built-in authentication methods, and there’s no way to manually enter or refresh a Bearer token for the schedule. If your API token is static and never expires, you can sometimes hard-code it in your query, but this isn’t secure or recommended. Most APIs use tokens that expire, which means refresh will break unless your code can automatically get a new token each time.
Best ways to handle this:
Custom connector: The most robust fix is building a custom Power Query connector that handles the authentication flow for you. This requires some coding but is fully supported.
Azure Data Factory or Logic Apps: Another popular workaround is using an Azure service to pull the API data (with the right authentication), save it to a database or storage, then connect Power BI to that.
API keys: If your API supports static API keys, those are much easier to use with scheduled refresh.
Power BI Service can’t schedule refreshes for APIs that need dynamic Bearer tokens unless you build a connector or stage the data elsewhere.
Your Power Query code is supposed to include the step where you acquire the bearer token, and then the step where you use the token to query the API.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!