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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Matthew_Kursar
New Member

REST API PostWorkspaceInfo Relationships

27/06 Update: Added more specific details to question

 

Hello! I was wondering if there is any way to get the Dataset relationships via the REST API? On the ScanResult API page, it seems like there was intended to be a field for dataset relationships https://learn.microsoft.com/en-us/rest/api/power-bi/admin/workspace-info-get-scan-result 

Associated snippet:

"datasets": [
        {
          "id": "e7e8a355-e77b-4418-a7b8-ae5972fdaa03",
          "name": "ExportB",
          "tables": [
            {...}
          ],
          "relationships": [], # this field here
...insert rest of response

But from my own testing (and scouring some forum posts) it doesn't seem like relationship information is actually available via this API. 

 

I'm using calling PostWorkspaceInfo with the following parameters:

https://api.powerbi.com/v1.0/myorg/admin/workspaces/getInfo?lineage=True&datasourceDetails=True&datasetSchema=True&datasetExpressions=True&getArtifactUsers=True

And in my response there is no 'relationships' key (just completely missing, not returning nothing), but the rest of the data is there. 

 

If I'm mistaken, please let me know as I'm looking for a way to retrieve the relationship info of a dataset/report via an API call. I'm not sure how it's handled on the Microsoft side, but if it could just dump the info in a similar manner to how it's stored in the relationships.tmdl file of a PowerBI Project File report that would allow me (and many others I'm sure) to achieve my lofty goals of scanning reports and ensuring we're following best practice standards (like avoiding bad many-many relationships) across my org.

7 REPLIES 7
Deku
Community Champion
Community Champion

For PostWorkspaceInfo do you enhanced metadata enabled?


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Just to clarify, do you mean having the Enhanced Metadata preview feature enabled for all the reports I want to see the relationship data of?

I just tried re-publishing a report with enhanced metadata enabled and unfortunately there wasn't a change in the API response.

The tenant setting https://learn.microsoft.com/en-us/fabric/admin/metadata-scanning-setup#enable-tenant-settings-for-me... that enables some API flags 

 

POST https://api.powerbi.com/v1.0/myorg/admin/workspaces/getInfo?lineage={lineage}&datasourceDetails={dat...datasetSchema={datasetSchema}&datasetExpressions={datasetExpressions}&getArtifactUsers={getArtifactUsers}


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Yes, both detailed metadata and dax/mashup expressions are enabled in the tenant settings.

Matthew_Kursar_0-1751012435362.png

 

v-dineshya
Community Support
Community Support

Hi @Matthew_Kursar ,

Thank you for reaching out to the Microsoft Community Forum.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.


Regards,
Dinesh

I've updated the original question with more details 🙂

 

What I'm hoping to get from the API call is a response that includes the 'relationships' key similar to this example from the REST API GetScanResult documentation 

"datasets": [
        {
          "id": "e7e8a355-e77b-4418-a7b8-ae5972fdaa03",
          "name": "ExportB",
          "tables": [
            {...}
          ],
          "relationships": [], # this field here
...insert rest of response

However, my API responses have most of the data, just not this relationships key

Hi @Matthew_Kursar ,

 

1. The API supports several metadata flags including datasetSchema, datasetExpressions, lineage, and datasourceDetails.It does not explicitly guarantee that the relationships field will be populated even when you set datasetSchema=True .

 

2. The sample response in the documentation includes a relationships key, but this appears to be illustrative rather than guaranteed output. That metadata scanning must be fully enabled for schema and expression data to be returned.

 

Note: The relationships field is not reliably returned by the PostWorkspaceInfo API, even with all metadata flags enabled.

 

You may need to extract relationship data manually from .pbip project files or use XMLA endpoints with tools like SSMS or PowerShell for deeper model, especially if you are looking for  governance and performance validation.

 

Please refer Microsoft official document.

Admin - WorkspaceInfo PostWorkspaceInfo - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

 

If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.

Thank you

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.