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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.