Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
matiaslopezd
New Member

Error using realtime data stream Rest API

Hi, we're receiving random errors when sending data via Rest API using the following endpoint:

 

https://api.powerbi.com/beta/:ID/datasets/:ID/rows?key=SECRET

 The errors:

 

Status code: 401

Status name: Unauthorized

 

{
  "error": {
    "code": "UnableToFindKeyInDBorCacheException",
    "pbi.error": {
      "code": "UnableToFindKeyInDBorCacheException",
      "parameters": {},
      "details": [],
      "exceptionCulprit": 1
    }
  }
}

 

{
  "error": {
    "code": "KeyFoundInDeletedResourceKeyCacheException",
    "pbi.error": {
      "code": "KeyFoundInDeletedResourceKeyCacheException",
      "parameters": {},
      "details": [],
      "exceptionCulprit": 1
    }
  }
} 

 

~10% of requests return those errors, inclusive of if we send exactly the same payload on requests.

 

Any reason why this is happening?

4 REPLIES 4
Anonymous
Not applicable

Hi @matiaslopezd ,

Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @matiaslopezd ,

What is your role in the workspace?  After which step did you start reporting errors?

 

As far as I know, the permissions of Power BI are all based on the users. So an App can't act as a user. Please refer to developer/power-bi-permissions where all the descriptions have "user". 

Regarding "Tenant.ReadWrite.All", the documentation above also has a description. Actually, these permissions only can retrieve the profiles rather than data. Please refer to admin/reports_getreportsasadmin.

One simple proof we can see is that even an admin can't access all the App workspaces. 

 

I have also found a similar post, please refer to it to see if it helps you.\

Unauthorized (401) Embedded using the samples Node and .NET 

The problem was in Step 7 - Enable workspace access that states Sign in to Power BI service > workspace you want to enable > Workspace access > Access pane, > copy the service principal to the Enter email address text box.

Because the email of the global admin was already filled out, I overlooked the actual requirement of entering the service principal ("Enter email address" was confusing).

 

If it still does not help, please provide more details.

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I don't understand why I need to set permissions to use the Rest API stream to push data when provides me an API key.

matiaslopezd_0-1659066877660.png

I think is because the current state of API is in beta.

 

Anonymous
Not applicable

Hello 🙂 did you get a solution? I have the same problem.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors