### Get Apps Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/apps Retrieves a list of all installed apps for the current user or tenant. ```APIDOC ## GET /apps ### Description Returns a list of installed apps. ### Method GET ### Endpoint /apps ### Response #### Success Response (200) - **value** (array) - A list of app objects. - **id** (string) - The unique identifier of the app. - **displayName** (string) - The display name of the app. #### Response Example ```json { "value": [ { "id": "app-123", "displayName": "Sales Dashboard" }, { "id": "app-456", "displayName": "Marketing Campaign Report" } ] } ``` ``` -------------------------------- ### Sample Request to Get Pipeline Stages Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/get-pipeline-stages An example of an HTTP GET request to retrieve the stages for a deployment pipeline with a specific pipeline ID. ```HTTP GET https://api.powerbi.com/v1.0/myorg/pipelines/a5ded933-57b7-41f4-b072-ed4c1f9d5824/stages ``` -------------------------------- ### Example Request: Get Test Stage Artifacts Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/get-pipeline-stage-artifacts An example of an HTTP GET request to retrieve artifacts from the 'Test' stage (stageOrder: 1) of a Power BI deployment pipeline, identified by a specific pipeline ID. ```HTTP GET https://api.powerbi.com/v1.0/myorg/pipelines/a5ded933-57b7-41f4-b072-ed4c1f9d5824/stages/1/artifacts ``` -------------------------------- ### Apps - Get App Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/apps/get-app Retrieves the details of a specified installed app in Power BI. ```APIDOC ## GET /v1.0/myorg/apps/{appId} ### Description Returns the specified installed app. ### Method GET ### Endpoint /v1.0/myorg/apps/{appId} ### Parameters #### Path Parameters - **appId** (string (uuid)) - Required - The app ID #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "GET https://api.powerbi.com/v1.0/myorg/apps/f089354e-8366-4e18-aea3-4cb4a3a50b48" } ``` ### Response #### Success Response (200) - **id** (string (uuid)) - The app ID - **description** (string) - The app description - **name** (string) - The app name - **publishedBy** (string) - The app publisher - **lastUpdate** (string (date-time)) - The date and time the app was last updated #### Response Example ```json { "id": "f089354e-8366-4e18-aea3-4cb4a3a50b48", "description": "The finance app", "name": "Finance", "publishedBy": "Bill", "lastUpdate": "2019-01-13T09:46:53.094+02:00" } ``` ### Definitions #### App Object A Power BI installed app - **description** (string) - The app description - **id** (string (uuid)) - The app ID - **lastUpdate** (string (date-time)) - The date and time the app was last updated - **name** (string) - The app name - **publishedBy** (string) - The app publisher ### Required Scope App.Read.All ### Limitations Service principal authentication isn't supported. ``` -------------------------------- ### Get Pipeline Operations Sample Request Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/get-pipeline-operations An example of the HTTP GET request to fetch pipeline operations, including a placeholder for the pipeline ID. ```http GET https://api.powerbi.com/v1.0/myorg/pipelines/a5ded933-57b7-41f4-b072-ed4c1f9d5824/operations ``` -------------------------------- ### Get App Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/apps Retrieves the details of a specific installed app within Power BI. ```APIDOC ## GET /apps/{appId} ### Description Returns the specified installed app. ### Method GET ### Endpoint /apps/{appId} ### Parameters #### Path Parameters - **appId** (string) - Required - The ID of the app to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the app. - **displayName** (string) - The display name of the app. - **description** (string) - The description of the app. #### Response Example ```json { "id": "app-123", "displayName": "Sales Dashboard", "description": "Key sales metrics and performance indicators." } ``` ``` -------------------------------- ### Get Salesforce Datasource Example Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/get-datasources Shows a sample JSON response for a Salesforce datasource in Power BI, including connection details like login server and class information. ```json { "value": [ { "datasourceType": "Salesforce", "datasourceId": "e8a6e0f5-b244-402a-ba5a-4d578609ede3", "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674", "connectionDetails": { "classInfo": "report-detail", "loginServer": "https://login.salesforce.com/" } } ] } ``` -------------------------------- ### Sample Request for Power BI Gateway Datasources Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/gateways/get-datasources An example of a GET request to the Power BI REST API to retrieve datasources for a gateway with a specific ID. This demonstrates the structure of a valid request. ```HTTP GET https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources ``` -------------------------------- ### Get Datasource Users - Sample Request Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/gateways/get-datasource-users An example of a GET request to the Power BI REST API to fetch users associated with a data source. This includes placeholder UUIDs for gatewayId and datasourceId. ```HTTP GET https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources/252b9de8-d915-4788-aaeb-ec8c2395f970/users ``` -------------------------------- ### Get SQL Datasource Example Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/get-datasources Shows a sample JSON response for a SQL datasource in Power BI, specifying the server and database for the SQL connection. ```json { "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources", "value": [ { "datasourceType": "Sql", "connectionDetails": { "server": "My-As-Server", "database": "My-As-Database" }, "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5", "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1" } ] } ``` -------------------------------- ### Sample Request to Get Gateway Datasources - Power BI REST API Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/get-gateway-datasources An example of an HTTP GET request to the Power BI REST API for fetching gateway data sources. This sample uses a specific dataset ID. ```http GET https://api.powerbi.com/v1.0/myorg/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/Default.GetBoundGatewayDatasources ``` -------------------------------- ### Get SharePoint Datasource Example Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/get-datasources Displays a sample JSON response for a SharePoint List datasource in Power BI, including the URL for the SharePoint site. ```json { "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources", "value": [ { "datasourceType": "SharePointList", "connectionDetails": { "url": "https://microsoft.sharepoint.com/hello/myproj/" }, "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5", "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1" } ] } ``` -------------------------------- ### Extension Datasource Example (Power BI) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/get-datasources Provides an example of retrieving an extension datasource from Power BI. The response includes datasourceType 'Extension', datasourceId, gatewayId, and connectionDetails specifying the kind and path. ```HTTP GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources ``` ```JSON { "value": [ { "datasourceType": "Extension", "datasourceId": "70540d95-4c8e-41ae-88c6-27a103b12841", "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674", "connectionDetails": { "kind": "AzureDataExplorer", "path": "https://myserver.kusto.windows.net" } } ] } ``` -------------------------------- ### Get Datasource Sample Request - Power BI REST API Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/gateways/get-datasource An example of a GET request to the Power BI REST API for retrieving a data source. It demonstrates how to include specific gateway and data source IDs in the URL. ```http GET https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources/252b9de8-d915-4788-aaeb-ec8c2395f970 ``` -------------------------------- ### Failed Power BI Install Ticket Response - Invalid Configuration Error (400) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/template-apps/create-install-ticket This snippet demonstrates a bad request response (HTTP 400) due to invalid configuration when creating a Power BI install ticket. It highlights issues with the provided parameters or setup. ```json { "error": { "code": "ServiceAppInstallTicketInvalidConfiguration", "pbi.error": { "code": "ServiceAppInstallTicketInvalidConfiguration", "parameters": {}, "details": [], "exceptionCulprit": 1 } } } ``` -------------------------------- ### Sample Response for Get Refreshable (Power BI REST API) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/admin/get-refreshable-for-capacity Provides an example of a successful HTTP 200 OK response when retrieving refreshable details, including its refresh history, schedule, and configuration. ```JSON { "value": [ { "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "name": "SalesMarketing", "kind": "Dataset", "startTime": "2017-06-13T09:25:43.153Z", "endTime": "2017-06-19T11:22:32.445Z", "refreshCount": 22, "refreshFailures": 0, "averageDuration": 289.3814, "medianDuration": 268.6245, "refreshesPerDay": 11, "lastRefresh": { "refreshType": "ViaApi", "startTime": "2017-06-13T09:25:43.153Z", "endTime": "2017-06-13T09:31:43.153Z", "status": "Completed", "requestId": "9399bb89-25d1-44f8-8576-136d7e9014b1" }, "refreshSchedule": { "days": [ "Sunday", "Friday", "Saturday" ], "times": [ "05:00", "11:30", "17:30", "23:00" ], "enabled": true, "localTimeZoneId": "UTC", "notifyOption": "MailOnFailure" }, "configuredBy": [ "john@contoso.com" ] } ] } ``` -------------------------------- ### Sample Power BI Dashboard Tile Request Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/dashboards/get-tile An example HTTP GET request to retrieve a specific tile from a Power BI dashboard, including placeholder dashboard and tile IDs. ```HTTP GET https://api.powerbi.com/v1.0/myorg/dashboards/69ffaa6c-b36d-4d01-96f5-1ed67c64d4af/tiles/312fbfe9-2eda-44e0-9ed0-ab5dc571bb4b ``` -------------------------------- ### Sample App Response (Power BI REST API) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/apps/get-app This snippet provides a sample JSON response for a successful GET request to retrieve an installed app. It includes details like the app's ID, name, description, publisher, and last update time. ```JSON { "id": "f089354e-8366-4e18-aea3-4cb4a3a50b48", "description": "The finance app", "name": "Finance", "publishedBy": "Bill", "lastUpdate": "2019-01-13T09:46:53.094+02:00" } ``` -------------------------------- ### Get Installed App Request (Power BI REST API) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/apps/get-app This snippet shows the HTTP GET request to retrieve a specific installed app from Power BI. It requires the app's unique identifier in the URL. ```HTTP GET https://api.powerbi.com/v1.0/myorg/apps/{appId} ``` -------------------------------- ### POST /v1.0/myorg/CreateTemplateAppInstallTicket Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/template-apps/create-install-ticket Generates an installation ticket for the automated install flow of a specified Power BI template app. The caller must use service principal for authentication. The tenant making this API call must own the specified template app. ```APIDOC ## POST /v1.0/myorg/CreateTemplateAppInstallTicket ### Description Generates an installation ticket for the automated install flow of the specified template app. The caller must use service principal for authentication. The tenant making this API call must own the specified template app. ### Method POST ### Endpoint https://api.powerbi.com/v1.0/myorg/CreateTemplateAppInstallTicket ### Parameters #### Request Body - **installDetails** (TemplateAppInstallDetails[]) - Required - List of install details ### Request Example ```json { "installDetails": [ { "appId": "91ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", "packageKey": "g632bb64...OfsoqT56xEM=", "ownerTenantId": "d43e3248-3d83-44aa-a94d-c836bd7f9b79", "config": { "configuration": { "param1": "value1", "param2": "value2" } } } ] } ``` ### Response #### Success Response (200 OK) - **ticket** (string) - Install ticket - **ticketId** (string (uuid)) - The unique ID of an install ticket. Audit logs can be used to correlate operations that use this ticket with the generate ticket operation. - **expiration** (string (date-time)) - The expiration date and time (UTC) of the ticket #### Response Example ```json { "ticket": "H4sI....AAA=", "ticketId": "4b76f5ed-5a06-4150-8d1b-60f8e4c186f4", "expiration": "2020-07-29T17:58:19Z" } ``` #### Error Responses - **401 Unauthorized** ```json { "error": { "code": "ServiceAppApplicationOwnershipValidationFailed", "pbi.error": { "code": "ServiceAppApplicationOwnershipValidationFailed", "parameters": {}, "details": [], "exceptionCulprit": 1 } } } ``` - **400 Bad Request** ```json { "error": { "code": "ServiceAppInstallTicketInvalidConfiguration", "pbi.error": { "code": "ServiceAppInstallTicketInvalidConfiguration", "parameters": {}, "details": [], "exceptionCulprit": 1 } } } ``` ### Definitions #### TemplateAppInstallDetails Object The install details for a Power BI template app - **appId** (string (uuid)) - The unique ID of the Power BI template app - **config** (TemplateAppConfigurationRequest) - The automated install configuration - **ownerTenantId** (string (uuid)) - The tenant ID of the Power BI template app owner - **packageKey** (string) - The secure key for the Power BI template app version #### TemplateAppConfigurationRequest Object An automated install configuration for a Power BI template app (dictionary of name-value pairs) - **configuration** (object) - ``` -------------------------------- ### Get Refreshables - Filtered Example Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/admin/get-refreshables-for-capacity An example of retrieving refreshables with a filter applied to show only those with an average refresh duration greater than 30 minutes. ```APIDOC ## GET /v1.0/myorg/admin/capacities/{capacityId}/refreshables?$filter=averageDuration gt 1800 ### Description This example demonstrates how to retrieve refreshables, filtering for an average refresh duration of greater than 30 minutes (1800 seconds). ### Method GET ### Endpoint /v1.0/myorg/admin/capacities/{capacityId}/refreshables ### Query Parameters - **$filter** (string) - Required - Odata filter query parameter condition. Example: `averageDuration gt 1800` ### Request Example ```json { "example": "GET https://api.powerbi.com/v1.0/myorg/admin/capacities/{capacityId}/refreshables?$filter=averageDuration gt 1800" } ``` ``` -------------------------------- ### Create Install Ticket for Template App Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/template-apps Generates an installation ticket for the automated install flow of a specified template app. ```APIDOC ## POST /templateApps/{templateAppName}/Installs ### Description Generates an installation ticket for the automated install flow of the specified template app. ### Method POST ### Endpoint /templateApps/{templateAppName}/Installs ### Parameters #### Path Parameters - **templateAppName** (string) - Required - The name of the template app for which to generate an installation ticket. #### Query Parameters None #### Request Body None ### Request Example (No request body for this operation) ### Response #### Success Response (200) - **installationTicket** (string) - The generated installation ticket. #### Response Example ```json { "installationTicket": "string" } ``` ``` -------------------------------- ### Create Deployment Pipeline Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines Creates a new deployment pipeline. ```APIDOC ## POST /pipelines ### Description Creates a new deployment pipeline. ### Method POST ### Endpoint /pipelines ### Parameters #### Request Body - **displayName** (string) - Required - The display name of the pipeline. - **description** (string) - Optional - The description of the pipeline. ### Request Example ```json { "displayName": "My New Pipeline", "description": "Pipeline for production deployment" } ``` ### Response #### Success Response (200) - **pipelineId** (string) - The ID of the newly created pipeline. - **displayName** (string) - The display name of the pipeline. #### Response Example ```json { "pipelineId": "generated_pipeline_id", "displayName": "My New Pipeline" } ``` ``` -------------------------------- ### Get Power BI Refreshables (Filtered Example) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/admin/get-refreshables An example of how to retrieve refreshables, specifically filtering for those with an average refresh duration greater than 30 minutes (1800 seconds). ```HTTP GET https://api.powerbi.com/v1.0/myorg/admin/capacities/refreshables?$filter=averageDuration gt 1800 ``` -------------------------------- ### Create Power BI Install Ticket Request (POST) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/template-apps/create-install-ticket This snippet demonstrates the POST request to create an install ticket for a Power BI template app. It includes the API endpoint and a sample JSON payload specifying app details and configuration. ```http POST https://api.powerbi.com/v1.0/myorg/CreateTemplateAppInstallTicket ``` ```json { "appId": "91ce06d1-d81b-4ea0-bc6d-2ce3dd2f8e87", "packageKey": "g632bb64...OfsoqT56xEM=", "ownerTenantId": "d43e3248-3d83-44aa-a94d-c836bd7f9b79", "config": { "configuration": { "param1": "value1", "param2": "value2" } } } ``` -------------------------------- ### Sample Request for Get Pipeline Operation Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/get-pipeline-operation An example of an HTTP GET request to retrieve the status of a pipeline operation, including placeholder IDs for the pipeline and operation. ```HTTP GET https://api.powerbi.com/v1.0/myorg/pipelines/a5ded933-57b7-41f4-b072-ed4c1f9d5824/operations/1065e6a3-a020-4c0c-ada7-92b5fe99eec5 ``` -------------------------------- ### Post Import Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/imports Creates new content in 'My workspace'. ```APIDOC ## POST /PostImport ### Description Creates new content in My workspace. ### Method POST ### Endpoint /PostImport ### Parameters #### Query Parameters - **name** (string) - Required - The name of the import. - **வதால்** (string) - Required - The unique identifier for the upload. #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **id** (string) - The ID of the import. - **name** (string) - The name of the import. - **importState** (string) - The state of the import (e.g., 'InProgress', 'Completed'). #### Response Example ```json { "id": "import-id-121", "name": "MyNewReport", "importState": "InProgress" } ``` ``` -------------------------------- ### Sample Response: Basic Deployment Pipelines Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/admin/pipelines-get-pipelines-as-admin A sample JSON response for a basic request to get deployment pipelines. It lists pipelines with their IDs, display names, and descriptions. ```JSON { "value": [ { "id": "a5ded933-57b7-41f4-b072-ed4c1f9d5824", "displayName": "Marketing Deployment Pipeline", "description": "Power BI deployment pipeline to manage marketing reports" }, { "id": "183dcf10-47b8-48c4-84aa-f0bf9d5f8fcf", "displayName": "Financing Deployment Pipeline", "description": "Power BI deployment pipeline to manage financing reports" } ] } ``` -------------------------------- ### Sample Response: In-Progress Dataset Refresh (Power BI REST API) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/get-refresh-history-in-group Example JSON response for a dataset refresh that is currently in progress in Power BI. This response typically includes the start time and a status indicating that the refresh is ongoing. ```json { "value": [ { "refreshType": "ViaApi", "startTime": "2017-06-13T09:25:43.153Z", "status": "Unknown", "requestId": "9399bb89-25d1-44f8-8576-136d7e9014b1" } ] } ``` -------------------------------- ### Sample Request and Response for GetUserSubscriptionsAsAdmin Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/admin/users-get-user-subscriptions-as-admin Demonstrates a sample HTTP GET request to retrieve user subscriptions and a corresponding 200 OK JSON response containing subscription details and continuation information. ```HTTP GET https://api.powerbi.com/v1.0/myorg/admin/users/f089354e-8366-4e18-aea3-4cb4a3a50b48/subscriptions ``` ```JSON { "subscriptionEntities": [ { "id": "9225d0bc-9f5e-4819-a637-799c0c4fh3f1", "title": "Team Scorecard-test", "artifactId": "0b50f0bf-b22b-4685-83b9-b6d17f7f4e46", "artifactDisplayName": "Customer Profitability Sample", "subArtifactDisplayName": "Team Scorecard", "artifactType": "Report", "isEnabled": false, "frequency": "Daily", "startDate": "8/10/2021 12:00:00 AM", "endDate": "8/10/2022 12:00:00 AM", "linkToContent": false, "previewImage": true, "attachmentFormat": "PNG", "users": [] } ], "continuationUri": "https://api.powerbi.com/v1.0/myorg/admin/users/f089354e-8366-4e18-aea3-4cb4a3a50b48/subscriptions?continuationToken='LDEsMTAwMDAwLDA%3D'", "continuationToken": "LDEsMTAwMDAwLDA%3D" } ``` -------------------------------- ### Deploy All Power BI Items (Development Stage) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/deploy-all This example demonstrates how to deploy all Power BI items, such as reports and dashboards, from the 'Development' stage of a deployment pipeline using the Power BI REST API. It includes the POST request to the `deployAll` endpoint and a sample JSON request body specifying the source stage order and deployment options. ```HTTP POST https://api.powerbi.com/v1.0/myorg/pipelines/{pipelineId}/deployAll ``` ```JSON { "sourceStageOrder": 0, "options": { "allowOverwriteArtifact": true, "allowCreateArtifact": true }, "note": "Deploying business ready items" } ``` -------------------------------- ### GET /admin/activityevents Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/admin/get-activity-events Retrieves a list of audit activity events for a tenant. You must provide either a continuation token or both a start and end date time. The start and end date times must be within the same UTC day and enclosed in single quotes. ```APIDOC ## GET /admin/activityevents ### Description Retrieves a list of audit activity events for a tenant. This endpoint allows filtering by date range, activity type, and user ID. ### Method GET ### Endpoint https://api.powerbi.com/v1.0/myorg/admin/activityevents ### Parameters #### Query Parameters - **startDateTime** (string) - Optional - The start date and time for the audit event results. Must be in ISO 8601 compliant UTC format and enclosed in single quotes. - **endDateTime** (string) - Optional - The end date and time for the audit event results. Must be in ISO 8601 compliant UTC format and enclosed in single quotes. - **continuationToken** (string) - Optional - A token required to retrieve the next chunk of the result set. - **$filter** (string) - Optional - Filters the results based on a boolean condition, using 'Activity', 'UserId', or both properties. Supports only 'eq' and 'and' operators. ### Request Example ``` GET https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime='2019-08-13T07:55:00.000Z'&endDateTime='2019-08-13T08:55:00.000Z'&$filter=Activity eq 'viewreport' and UserId eq 'john@contoso.com' ``` ### Response #### Success Response (200) - **ActivityEventResponse** - An object containing a list of activity events. ``` -------------------------------- ### Datasets PostDataset Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/push-datasets Creates a new dataset on My workspace. ```APIDOC ## POST /datasets ### Description Creates a new dataset on My workspace. ### Method POST ### Endpoint /datasets ### Parameters #### Request Body - **name** (string) - Required - The name of the dataset. - **tables** (array) - Required - An array of table objects. - **name** (string) - Required - The name of the table. - **columns** (array) - Required - An array of column objects. - **name** (string) - Required - The name of the column. - **dataType** (string) - Required - The data type of the column (e.g., 'String', 'Int64', 'DateTime'). ### Request Example ```json { "name": "NewDataset", "tables": [ { "name": "Customers", "columns": [ { "name": "CustomerID", "dataType": "Int64" }, { "name": "CustomerName", "dataType": "String" } ] } ] } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the created dataset. - **name** (string) - The name of the created dataset. - **tables** (array) - An array of table objects within the dataset. ### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "NewDataset", "tables": [ { "name": "Customers", "columns": [ { "name": "CustomerID", "dataType": "Int64" }, { "name": "CustomerName", "dataType": "String" } ] } ] } ``` ``` -------------------------------- ### Get Dashboard Tiles - Sample Request Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/dashboards/get-tiles-in-group An example of a GET request to the Power BI REST API to fetch tiles from a dashboard. It includes placeholder IDs for the group and dashboard. ```http GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/dashboards/69ffaa6c-b36d-4d01-96f5-1ed67c64d4af/tiles ``` -------------------------------- ### Deploy All Items Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines Deploys all supported items from the source stage of the specified deployment pipeline. ```APIDOC ## POST /pipelines/{pipelineId}/deploy-all ### Description Deploys all supported items from the source stage of the specified deployment pipeline. ### Method POST ### Endpoint /pipelines/{pipelineId}/deploy-all ### Parameters #### Path Parameters - **pipelineId** (string) - Required - The pipeline ID. #### Request Body - **sourceStageId** (string) - Required - The ID of the source stage. - **targetStageId** (string) - Required - The ID of the target stage. ### Request Example ```json { "sourceStageId": "source_stage_id", "targetStageId": "target_stage_id" } ``` ### Response #### Success Response (200) - **operationId** (string) - The ID of the deployment operation. #### Response Example ```json { "operationId": "deployment_operation_id" } ``` ``` -------------------------------- ### Sample Request to Get Dashboard - Power BI REST API Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/dashboards/get-dashboard An example of an HTTP GET request to retrieve a Power BI dashboard, including a sample dashboard ID. ```http GET https://api.powerbi.com/v1.0/myorg/dashboards/69ffaa6c-b36d-4d01-96f5-1ed67c64d4af ``` -------------------------------- ### Get Power BI Dataset In Group (Sample Request) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/get-dataset-in-group An example of a GET request to the Power BI REST API to fetch a dataset. Replace '{groupId}' and '{datasetId}' with actual IDs. ```http GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229 ``` -------------------------------- ### Create Datasource Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/gateways Creates a new data source on the specified on-premises gateway. ```APIDOC ## POST /gateways/{gatewayId}/datasources ### Description Creates a new data source on the specified on-premises gateway. ### Method POST ### Endpoint /gateways/{gatewayId}/datasources ### Parameters #### Path Parameters - **gatewayId** (string) - Required - The gateway ID. #### Request Body - **dataSourceType** (string) - Required - The type of the data source. - **dataSourceName** (string) - Required - The name of the data source. - **connectionDetails** (object) - Required - The connection details for the data source. ### Request Example ```json { "dataSourceType": "SQL", "dataSourceName": "MyDataSource", "connectionDetails": { "server": "myserver.database.windows.net", "database": "mydatabase" } } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the created data source. - **dataSourceType** (string) - The type of the data source. - **dataSourceName** (string) - The name of the data source. #### Response Example ```json { "id": "datasource-123", "dataSourceType": "SQL", "dataSourceName": "MyDataSource" } ``` ``` -------------------------------- ### Sample Response for Get Pipelines Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/get-pipelines This is a sample JSON response for the 'Get Pipelines' API call, indicating a successful retrieval (200 OK) of deployment pipelines. It includes the ID, display name, and description for each pipeline. ```JSON { "value": [ { "id": "a5ded933-57b7-41f4-b072-ed4c1f9d5824", "displayName": "Marketing Deployment Pipeline", "description": "Power BI deployment pipeline to manage marketing reports" } ] } ``` -------------------------------- ### Sample Request - Get Datasources As Admin Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/admin/datasets-get-datasources-as-admin An example of a GET request to the Power BI REST API to fetch data sources associated with a dataset, identified by its unique ID. ```HTTP GET https://api.powerbi.com/v1.0/myorg/admin/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources ``` -------------------------------- ### Sample Response for Deploy All Power BI Items Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/deploy-all This example shows a successful response (HTTP 200 Accepted) when deploying all Power BI items using the `deployAll` endpoint. The response includes details about the deployment operation, such as its ID, type, status, timing, and the source and target stages. ```JSON { "value": [ { "id": "1065e6a3-a020-4c0c-ada7-92b5fe99eec5", "type": "Deploy", "status": "NotStarted", "lastUpdatedTime": "2020-12-13T09:26:43.153", "executionStartTime": "2020-12-13T09:25:43.153Z", "executionEndTime": "2020-12-13T09:26:43.153Z", "sourceStageOrder": 0, "targetStageOrder": 1 } ] } ``` -------------------------------- ### Get Reports from App - Sample Request (HTTP) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/apps/get-reports An example of an HTTP GET request to the Power BI REST API for fetching reports from an app. This sample uses a placeholder appId. ```HTTP GET https://api.powerbi.com/v1.0/myorg/apps/3d9b93c6-7b6d-4801-a491-1738910904fd/reports ``` -------------------------------- ### Get All Deployment Pipelines Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines Returns a list of deployment pipelines that the user has access to. ```APIDOC ## GET /pipelines ### Description Returns a list of deployment pipelines that the user has access to. ### Method GET ### Endpoint /pipelines ### Response #### Success Response (200) - **value** (array) - A list of deployment pipelines. #### Response Example ```json { "value": [ { "pipelineId": "pipeline_id_1", "displayName": "Pipeline 1" }, { "pipelineId": "pipeline_id_2", "displayName": "Pipeline 2" } ] } ``` ``` -------------------------------- ### Get refreshables with 'capacity' and 'group' expanded Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/capacities/get-refreshables Example of how to use the $expand query parameter to include 'capacity' and 'group' details in the response. ```APIDOC ## GET /v1.0/myorg/capacities/refreshables?$expand=capacity,group ### Description This example shows how to retrieve refreshables and expand the 'capacity' and 'group' related data directly within the response. ### Method GET ### Endpoint https://api.powerbi.com/v1.0/myorg/capacities/refreshables?$expand=capacity,group ### Response #### Success Response (200) - **value** (Refreshables) - OK #### Response Example *(Note: The exact structure for expanded 'capacity' and 'group' would depend on the Power BI API's specific schema for these related resources. This is a conceptual example.)* ```APIDOC { "value": [ { "id": "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "name": "SalesMarketing", "kind": "Dataset", "startTime": "2017-06-13T09:25:43.153Z", "endTime": "2017-06-19T11:22:32.445Z", "refreshCount": 22, "refreshFailures": 0, "averageDuration": 289.3814, "medianDuration": 268.6245, "refreshesPerDay": 11, "lastRefresh": { "refreshType": "ViaApi", "startTime": "2017-06-13T09:25:43.153Z", "endTime": "2017-06-13T09:31:43.153Z", "status": "Completed", "requestId": "9399bb89-25d1-44f8-8576-136d7e9014b1" }, "refreshSchedule": { "days": [ "Sunday", "Friday", "Saturday" ], "times": [ "05:00", "11:30", "17:30", "23:00" ], "enabled": true, "localTimeZoneId": "UTC", "notifyOption": "MailOnFailure" }, "configuredBy": [ "john@contoso.com" ], "capacity": { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "displayName": "My Capacity", "capacityType": "Premium" }, "group": { "id": "f0e9d8c7-b6a5-4321-fedc-ba9876543210", "displayName": "Sales Team Workspaces" } } ] } ``` ``` -------------------------------- ### Sample Request for Discover Gateways Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/discover-gateways-in-group An example of a GET request to the Power BI REST API to discover gateways, demonstrating the structure with placeholder IDs for the group and dataset. ```HTTP GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/Default.DiscoverGateways ``` -------------------------------- ### PreDeploymentDiffInformation Object Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/deploy-all Details on differences between source and target stages before deployment. ```APIDOC ## PreDeploymentDiffInformation Object ### Description The amount of new, different and identical deployed items before deployment. ### Properties - **differentArtifactsCount** (integer) - The number of deployed items with differences between source and target stages, before deployment. - **newArtifactsCount** (integer) - The number of new items deployed to the target stage. - **noDifferenceArtifactsCount** (integer) - The number of identical deployed items in the source and target stages, before deployment. ``` -------------------------------- ### Sample Request for Get Dashboards In Group - Power BI REST API Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/dashboards/get-dashboards-in-group An example of a sample HTTP GET request to the Power BI REST API to fetch dashboards, including a placeholder for the workspace ID. ```HTTP GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/dashboards ``` -------------------------------- ### DeploymentExecutionStep Object Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/deploy-all Details of a single step within a deployment execution plan. ```APIDOC ## DeploymentExecutionStep Object ### Description A deployment execution step. ### Properties - **error** (DeploymentError) - Optional - The error details. Only applicable if the pipeline operation failed. - **index** (integer) - Required - The step index. - **preDeploymentDiffState** (DeploymentExecutionStepPreDeploymentDiffState) - Optional - Is an item new, different or identical to items in the target stage before deployment. - **sourceAndTarget** (DeploymentSourceAndTarget) - Optional - The source and target items of the step. - **status** (PipelineOperationStatus) - Optional - The status of the pipeline operation. - **type** (DeploymentStepType) - Optional - The type of deployment step. ``` -------------------------------- ### Sample Response: Get Power BI Deployment Pipeline with Stages Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/pipelines/get-pipeline An example JSON response for retrieving a Power BI deployment pipeline with its stages expanded. Includes pipeline ID, display name, description, and stage details like order and workspace information. ```JSON { "id": "a5ded933-57b7-41f4-b072-ed4c1f9d5824", "displayName": "My Deployment Pipeline", "description": "My deployment pipeline", "stages": [ { "order": 0, "workspaceId": "4de5bcc4-2c88-4efe-b827-4ee7b289b496", "workspaceName": "Workspace-Development" }, { "order": 1, "workspaceId": "44b499cf-1eeb-45e2-9ada-63b6ec9d516e" }, { "order": 2 } ] } ``` -------------------------------- ### Completed Dataset Refresh Execution Details Example (Power BI REST API) Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/get-refresh-execution-details-in-group An example of an HTTP GET request to retrieve the details of a completed dataset refresh operation in Power BI. This includes sample UUIDs for the group, dataset, and refresh. ```HTTP GET https://api.powerbi.com/v1.0/myorg/groups/fdb91b8f-0a9b-44c1-b6c0-0cb185c6ebfb/datasets/f7fc6510-e151-42a3-850b-d0805a391db0/refreshes/87f31ef7-1e3a-4006-9b0b-191693e79e9e ``` -------------------------------- ### Sample API Request to Discover Gateways Source: https://learn.microsoft.com/en-nz/rest/api/power-bi/datasets/discover-gateways An example of a GET request to the Power BI REST API to discover gateways for a specific dataset. This demonstrates how to format the URL with a dataset ID. ```http GET https://api.powerbi.com/v1.0/myorg/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/Default.DiscoverGateways ```