rest-api-automation
Power BI REST API and Fabric REST API automation. PROACTIVELY activate for: (1) calling Power BI REST APIs, (2) embed-token generation (App Owns Data, User Owns Data), (3) service-principal authentication for Power BI, (4) dataset refresh API and refresh status polling, (5) push datasets and streaming, (6) Admin API (workspace/dataset enumeration), (7) Power BI Embedded and the JavaScript SDK (powerbi-client), (8) export-to-file API (PDF/PPTX/PNG), (9) Power BI automation via PowerShell (MicrosoftPowerBIMgmt), (10) Scanner API for tenant inventory, (11) app registration in Microsoft Entra ID. Provides: REST endpoint reference, OAuth/MSAL token recipes, embed-token patterns, refresh automation scripts, JavaScript SDK examples, and PowerShell module recipes.
What this skill does
# Power BI REST API and Automation
## Overview
The Power BI REST API provides programmatic access for embedding, administration, dataset management, and automation. The base URL is `https://api.powerbi.com/v1.0/myorg/` for user context or `https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/` for workspace context.
## Authentication
### Service Principal (Recommended for Automation)
1. **Register app in Azure AD:** Azure Portal > App registrations > New registration
2. **Create client secret:** Certificates & secrets > New client secret
3. **Grant Power BI permissions:** API permissions > Add > Power BI Service
4. **Enable in Power BI Admin:** Tenant settings > Allow service principals to use APIs > add security group
5. **Add SP to workspace:** Workspace > Access > Add the app as Member or Contributor
**Get access token:**
```bash
curl -X POST "https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id={clientId}&client_secret={secret}&scope=https://analysis.windows.net/powerbi/api/.default"
```
**PowerShell:**
```powershell
$body = @{
grant_type = "client_credentials"
client_id = $clientId
client_secret = $clientSecret
scope = "https://analysis.windows.net/powerbi/api/.default"
}
$token = (Invoke-RestMethod -Uri "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token" `
-Method Post -Body $body).access_token
```
### Master User (Legacy, Not Recommended)
Uses a real user account with username/password grant. Requires Pro/PPU license. Subject to MFA and Conditional Access issues. Avoid for production.
## API Operation Groups
| Group | Base Path | Purpose |
|-------|-----------|---------|
| Datasets | `/datasets` | Manage semantic models, refresh, parameters |
| Reports | `/reports` | Get, clone, export, rebind reports |
| Dashboards | `/dashboards` | Get dashboards and tiles |
| Groups (Workspaces) | `/groups` | Workspace CRUD, membership |
| Imports | `/imports` | Upload PBIX/XLSX files |
| Pipelines | `/pipelines` | Deployment pipeline automation |
| Admin | `/admin` | Tenant-wide operations (scanner, activity) |
| EmbedToken | `/GenerateToken` | Create embed tokens |
| Gateways | `/gateways` | Gateway and data source management |
| Dataflows | `/dataflows` | Dataflow management |
| Apps | `/apps` | App management |
| Capacities | `/capacities` | Capacity management |
| Goals | `/goals` | Scorecards and goals |
## Common API Operations
### Refresh a Semantic Model
```bash
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes
Authorization: Bearer {token}
Content-Type: application/json
{
"notifyOption": "MailOnFailure",
"retryCount": 2,
"type": "Full",
"commitMode": "transactional",
"applyRefreshPolicy": true
}
```
**Enhanced refresh (selective tables/partitions):**
```json
{
"type": "Full",
"commitMode": "transactional",
"objects": [
{ "table": "Sales", "partition": "Sales_Current" },
{ "table": "Products" }
]
}
```
### Get Refresh History
```bash
GET https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes?$top=10
```
### Import a PBIX File
```bash
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/imports?datasetDisplayName=SalesReport&nameConflict=CreateOrOverwrite
Authorization: Bearer {token}
Content-Type: multipart/form-data
[PBIX file as form data]
```
**Python:**
```python
import requests
url = f"https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/imports"
params = {"datasetDisplayName": "SalesReport", "nameConflict": "CreateOrOverwrite"}
headers = {"Authorization": f"Bearer {token}"}
with open("SalesReport.pbix", "rb") as f:
response = requests.post(url, params=params, headers=headers,
files={"file": ("SalesReport.pbix", f, "application/octet-stream")})
```
### Export Report to File
```bash
# Initiate export
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/reports/{reportId}/ExportTo
{
"format": "PDF",
"powerBIReportConfiguration": {
"pages": [
{ "pageName": "ReportSection1" }
],
"defaultBookmark": { "name": "BookmarkName" }
}
}
# Poll for completion
GET https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/reports/{reportId}/exports/{exportId}
# Download when status is "Succeeded"
GET https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/reports/{reportId}/exports/{exportId}/file
```
**Supported formats:** PDF, PPTX, PNG, XLSX, CSV, XML, MHTML, IMAGE, ACCESSIBLEPDF
### Update Dataset Parameters
```bash
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/Default.UpdateParameters
{
"updateDetails": [
{ "name": "ServerName", "newValue": "prod-server.database.windows.net" },
{ "name": "DatabaseName", "newValue": "ProdDB" }
]
}
```
### Take Over a Dataset
```bash
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/Default.TakeOver
```
### Update Data Source Credentials
```bash
PATCH https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}
{
"credentialDetails": {
"credentialType": "OAuth2",
"credentials": "{\"credentialData\":[{\"name\":\"accessToken\",\"value\":\"...\"}]}",
"encryptedConnection": "Encrypted",
"encryptionAlgorithm": "None",
"privacyLevel": "Organizational"
}
}
```
## Push Datasets (Real-Time)
Create and push data to datasets via API for real-time dashboards:
```bash
# Create push dataset
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets
{
"name": "RealTimeMetrics",
"defaultMode": "Push",
"tables": [
{
"name": "Metrics",
"columns": [
{ "name": "Timestamp", "dataType": "DateTime" },
{ "name": "Sensor", "dataType": "String" },
{ "name": "Value", "dataType": "Double" },
{ "name": "Status", "dataType": "String" }
]
}
]
}
# Push rows
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/tables/Metrics/rows
{
"rows": [
{ "Timestamp": "2026-04-03T10:30:00Z", "Sensor": "Temp-01", "Value": 23.5, "Status": "Normal" },
{ "Timestamp": "2026-04-03T10:30:00Z", "Sensor": "Temp-02", "Value": 45.2, "Status": "Warning" }
]
}
# Clear table
DELETE https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/tables/Metrics/rows
```
## Embed Tokens (Power BI Embedded)
### Generate Embed Token for Report
```bash
POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/reports/{reportId}/GenerateToken
{
"accessLevel": "View",
"identities": [
{
"username": "[email protected]",
"roles": ["RegionManager"],
"datasets": ["{datasetId}"]
}
]
}
```
### Generate Token for Multiple Items
```bash
POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
"datasets": [
{ "id": "{datasetId}" }
],
"reports": [
{ "id": "{reportId}", "allowEdit": false }
],
"targetWorkspaces": [
{ "id": "{workspaceId}" }
],
"identities": [
{
"username": "[email protected]",
"roles": ["ViewerRole"],
"datasets": ["{datasetId}"]
}
]
}
```
### JavaScript SDK Embedding
```html
<div id="reportContainer" style="height:600px;"></div>
<script src="https://cdn.jsdelivr.net/npm/powerbi-client/dist/powerbi.min.js"></script>
<script>
const embedConfig = {
type: 'report',
id: reportId,
embedUrl: embedUrl,
accessToken: embedToken,
tokenType: models.TokenType.Embed, // Use Embed for app-owns-data
settings: {
panes: {
filters: { visible: false },
pageNavigation: { visible: true }
},
bars: { statusBar: { visible: false } }
}
};
const container = document.getElementById('reportContainer');
const report = powerbi.embed(container, embedConfig);
// Token refresh handler
report.on('tokenExpired', async () => {
const newToken = Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.