Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
josiahsiegel avatar

Rest Api Automation

  • 73 installs
  • 50 repo stars
  • Updated June 18, 2026
  • josiahsiegel/claude-plugin-marketplace

Helps with backend & apis tasks.

About

rest-api-automation is a Claude Code skill for backend & apis. It helps solo builders move faster with AI-assisted development.

  • rest-api-automation
  • Backend & APIs
  • AI-coding skill

Rest Api Automation by the numbers

  • 73 all-time installs (skills.sh)
  • +4 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #3,071 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/josiahsiegel/claude-plugin-marketplace --skill rest-api-automation

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs73
repo stars50
Last updatedJune 18, 2026
Repositoryjosiahsiegel/claude-plugin-marketplace

What it does

Helps with backend & apis tasks.

Files

SKILL.mdMarkdownGitHub ↗

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:

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:

$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

GroupBase PathPurpose
Datasets/datasetsManage semantic models, refresh, parameters
Reports/reportsGet, clone, export, rebind reports
Dashboards/dashboardsGet dashboards and tiles
Groups (Workspaces)/groupsWorkspace CRUD, membership
Imports/importsUpload PBIX/XLSX files
Pipelines/pipelinesDeployment pipeline automation
Admin/adminTenant-wide operations (scanner, activity)
EmbedToken/GenerateTokenCreate embed tokens
Gateways/gatewaysGateway and data source management
Dataflows/dataflowsDataflow management
Apps/appsApp management
Capacities/capacitiesCapacity management
Goals/goalsScorecards and goals

Common API Operations

Refresh a Semantic Model

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):

{
  "type": "Full",
  "commitMode": "transactional",
  "objects": [
    { "table": "Sales", "partition": "Sales_Current" },
    { "table": "Products" }
  ]
}

Get Refresh History

GET https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes?$top=10

Import a PBIX File

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:

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

# 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

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

POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/Default.TakeOver

Update Data Source Credentials

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:

# 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

POST https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/reports/{reportId}/GenerateToken
{
  "accessLevel": "View",
  "identities": [
    {
      "username": "user@domain.com",
      "roles": ["RegionManager"],
      "datasets": ["{datasetId}"]
    }
  ]
}

Generate Token for Multiple Items

POST https://api.powerbi.com/v1.0/myorg/GenerateToken
{
  "datasets": [
    { "id": "{datasetId}" }
  ],
  "reports": [
    { "id": "{reportId}", "allowEdit": false }
  ],
  "targetWorkspaces": [
    { "id": "{workspaceId}" }
  ],
  "identities": [
    {
      "username": "user@domain.com",
      "roles": ["ViewerRole"],
      "datasets": ["{datasetId}"]
    }
  ]
}

JavaScript SDK Embedding

<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 = await fetchNewToken();  // Call your backend
    await report.setAccessToken(newToken);
  });

  // Event handlers
  report.on('loaded', () => console.log('Report loaded'));
  report.on('rendered', () => console.log('Report rendered'));
  report.on('error', (event) => console.error(event.detail));
</script>

Admin APIs

Scan Workspaces (Inventory)

# Initiate scan
POST https://api.powerbi.com/v1.0/myorg/admin/workspaces/getInfo
{
  "workspaces": ["{workspaceId1}", "{workspaceId2}"],
  "datasetExpressions": true,
  "datasetSchema": true,
  "datasourceDetails": true,
  "getArtifactUsers": true
}

# Get scan results
GET https://api.powerbi.com/v1.0/myorg/admin/workspaces/scanResult/{scanId}

Activity Events (Audit)

GET https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime='2026-04-01T00:00:00Z'&endDateTime='2026-04-02T00:00:00Z'&$filter=Activity eq 'ViewReport'

List All Datasets in Tenant

GET https://api.powerbi.com/v1.0/myorg/admin/datasets?$top=100

Additional Resources

Reference Files

  • `references/api-endpoints-complete.md` -- Complete API endpoint reference with all parameters, response schemas, and error codes

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.