PowerPlatform API

The PowerPlatform API provides direct access to Power Platform service endpoints from tool webviews.

For the Microsoft reference, see Power Platform REST API documentation.

Overview

Use the API through window.powerplatformAPI. The surface is organized into service namespaces, and each namespace exposes the same shared HTTP client methods.

Shared Client Methods

Every namespace on window.powerplatformAPI exposes the same method shape.

Get(path?, connectionTarget?, headers?)

Make a GET request to the namespace endpoint.

Post(path?, body?, connectionTarget?, headers?)

Make a POST request to the namespace endpoint.

Put(path?, body?, connectionTarget?, headers?)

Make a PUT request to the namespace endpoint.

Patch(path?, body?, connectionTarget?, headers?)

Make a PATCH request to the namespace endpoint.

Delete(path?, connectionTarget?, headers?, body?)

Make a DELETE request to the namespace endpoint. A request body is supported when the API requires payload deletion.

Common parameters:

  • path?: string - Relative path after the namespace base URL, including query string when needed
  • body?: unknown - Optional request payload for write operations
  • connectionTarget?: 'primary' | 'secondary' - Optional connection target, defaults to primary
  • headers?: Record<string, string> - Optional custom request headers

Returns: Promise<PowerPlatformResponse>

const powerplatform = window.powerplatformAPI

const response = await powerplatform.EnvironmentManagement.Get(
  'environments?api-version=2024-10-01',
)

console.log(response)

Namespace Catalog

The type file currently exposes these namespaces. Each one uses the same shared client methods, so the usage pattern stays consistent.

NamespaceExample Usage
Analyticsawait powerplatform.Analytics.Get('reports?api-version=2024-10-01')
AppManagementawait powerplatform.AppManagement.Get('apps?api-version=2024-10-01')
Authorizationawait powerplatform.Authorization.Get('roles?api-version=2024-10-01')
Connectivityawait powerplatform.Connectivity.Get('connections?api-version=2024-10-01')
CopilotStudioawait powerplatform.CopilotStudio.Get('environments?api-version=2024-10-01')
Dynamicsawait powerplatform.Dynamics.Get('environments?api-version=2024-10-01')
EnvironmentManagementawait powerplatform.EnvironmentManagement.Get('environments?api-version=2024-10-01')
Governanceawait powerplatform.Governance.Get('policies?api-version=2024-10-01')
Licensingawait powerplatform.Licensing.Get('subscriptions?api-version=2024-10-01')
PowerAppsawait powerplatform.PowerApps.Get('environments/{environmentId}/apps/{app}?api-version=2024-10-01')
PowerAutomateawait powerplatform.PowerAutomate.Get('flows?api-version=2024-10-01')
PowerPagesawait powerplatform.PowerPages.Get('sites?api-version=2024-10-01')
ResourceQueryawait powerplatform.ResourceQuery.Get('queries?api-version=2024-10-01')
UserManagementawait powerplatform.UserManagement.Get('users?api-version=2024-10-01')
WorkflowAgentsawait powerplatform.WorkflowAgents.Get('agents?api-version=2024-10-01')

These examples show the naming pattern from the type file and the style of relative paths each namespace accepts. The actual operation path depends on the specific Power Platform API you are calling.

Was this page helpful?