Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 38 ยท Connectors and Integration

Custom Connectors and OpenAPI

Build a Power Apps custom connector for your own REST API: describe it with OpenAPI, choose authentication, define actions and test it. Includes a checker stand-in.

When the API you need has no ready-made connector, you create a custom connector. It is a description of a REST API that Power Apps, Power Automate and Logic Apps can reuse. You describe the API once, and then every maker in the environment gets friendly actions with typed inputs instead of raw HTTP calls.

What a custom connector contains

  1. General: the host (for example api.contoso.example), base URL (/v1), scheme (HTTPS), name, icon and description.
  2. Security: how callers authenticate: No authentication, Basic, API key, OAuth 2.0 (including Microsoft Entra ID).
  3. Definition: actions (an operation you call) and triggers (webhook or polling, for flows). Each has a verb, a path, parameters, a request body and a response schema.
  4. Code (optional): a small C# script to modify requests or responses.
  5. Test: a pane that calls your API from the portal.

You find it in the maker portal under Custom connectors (or More, then Discover all) and choose New custom connector, then one of: Create from blank, Import an OpenAPI file, Import an OpenAPI from URL or Import a Postman collection. Importing an OpenAPI definition fills in most of the form for you.

OpenAPI in one minute

OpenAPI (formerly Swagger) is a standard JSON or YAML description of a REST API. Custom connectors accept OpenAPI 2.0 (Swagger) files. A minimal example for an equipment API:

YAML
swagger: "2.0"
info:
  title: Equipment API
  version: "1.0"
host: api.contoso.example
basePath: /v1
schemes: [https]
paths:
  /items:
    get:
      operationId: ListItems
      summary: List equipment items
      parameters:
        - name: status
          in: query
          type: string
      responses:
        "200":
          description: OK
          schema:
            type: array
            items:
              $ref: "#/definitions/Item"
definitions:
  Item:
    type: object
    properties:
      id: { type: integer }
      name: { type: string }

The operationId becomes the action name that makers see, and summary becomes its label. Good names matter: ListItems reads better than get_items_v1.

Build a custom connector

Describe OpenAPI file
Secure Pick authentication
Define Actions and triggers
Test Call it in the portal
1 / 2

Checking a definition: a stand-in

Poor definitions are a common cause of confusing connectors. This stand-in checks a small spec for the issues makers hit most: missing operationId, missing summary, and missing response schema. The real connector wizard shows warnings in a similar spirit; this is our own checker.

JS Stand-in: lint an OpenAPI-style definition

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Authentication choices

  • API key: simplest. You choose where it goes (header or query) and users enter the key when they create a connection. Fine for low-risk APIs.
  • Basic: username and password. Avoid unless you must.
  • OAuth 2.0: the safe choice for user-level access. You supply the authorization URL, token URL, client ID, client secret and scopes, and add the connector's redirect URL (shown in the portal) to your identity provider's list of allowed redirects. For Microsoft Entra ID there is a built-in provider.

Never put secrets in the OpenAPI file or in a canvas app. Store client secrets only in the connector's security settings, and use environment variables (Environment Variables and Connection References) for per-environment values like base URLs.

Using the connector in an app

After you save (Create connector) and test it, add it in a canvas app with Data, Add data, search by name, and create a connection. Then call actions like functions:

TEXT
ClearCollect(colItems, EquipmentAPI.ListItems({ status: "active" }))

The result is a table whose columns come from your response schema. If the schema is missing, the formula bar cannot help you with column names, which is why response schemas are important.

Mapping a response: a stand-in

JS Stand-in: from response schema to table columns

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Practical tips

  • Start from the API's own OpenAPI file and trim it; hand-writing every path is slow.
  • Use dynamic values (a lookup action) so makers pick a value from a list instead of typing an ID.
  • Hide parameters makers should not set by marking them Internal visibility.
  • Always include the connector in a solution so it deploys with the app.
  • Document throttling limits of your API; connectors inherit them.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the operationId in an OpenAPI file become in the connector?

    operationId names the action; summary gives its label.
  2. 2. Which authentication type is the safest for user-level access?

    OAuth 2.0 delegates sign-in to an identity provider and avoids sharing passwords.
  3. 3. Why include a response schema?

    Without a schema the formula bar cannot suggest output columns.
  4. 4. Where should a custom connector live so it moves between environments?

    Solutions carry custom connectors to test and production environments.

Summary

  • A custom connector describes your REST API so makers get named, typed actions.
  • Import OpenAPI, choose authentication (prefer OAuth 2.0), define actions, test, then create it.
  • Good operationIds, summaries and response schemas make connectors pleasant to use.
  • Keep secrets out of apps and put the connector in a solution.

Next: Calling Power Automate Flows from Apps