> For the complete documentation index, see [llms.txt](https://guides.mangoapps.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.mangoapps.com/ai-guide/bring-your-own-assistant/integration-with-microsoft-teams.md).

# Integration with Microsoft Teams

Connecting AI Assistants with Microsoft Teams via OpenAPI Schema

### Overview

This guide walks you through the process of integrating an AI Assistant (with OpenAPI access enabled) into Microsoft Teams via Microsoft Copilot Studio. The integration is achieved by creating a Power Apps custom connector, configuring it with the Assistant’s OpenAPI details, and then wiring it into a Copilot Studio Agent.

***

### High-Level Steps

1. Enable OpenAPI Access for your AI Assistant.
2. Create a Power Apps custom connector using the Assistant’s OpenAPI schema.
3. Create an Agent in Copilot Studio.
4. Add your custom connector as a tool in the Agent.
5. Enable and publish the Agent as an application.
6. Add the Agent application to Microsoft Teams.

***

### Detailed Walkthrough

#### 1. Enable OpenAPI Access

Locate the AI Assistant you want to connect.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FcRqN8MjNpcEc3orCMP3q%2Funnamed%20a.png?alt=media&amp;token=925f496c-8f97-4d90-aaed-ffcfa498aacd" alt="" width="563"><figcaption></figcaption></figure>

Toggle on **Enable OpenAPI Access.**

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2Fcr2xecnsR5C24JwJOpJG%2Funnamed%20(3).png?alt=media&amp;token=0aa264b0-781c-4813-8658-f846a1922d93" alt="" width="563"><figcaption></figcaption></figure>

Copy the OpenAPI JSON URL (you will need this for Power Apps).

***

#### 2. Create a Power Apps Custom Connector

Log in to your **Microsoft Power Apps dashboard** and navigate to **Custom Connectors**.

Click **+ New Custom Connector > Import an OpenAPI from URL**.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FW2V1HaTI6LszvxDlGbkG%2Funnamed%20(4).png?alt=media&amp;token=e0237c03-1d6a-447a-8654-f65d865fb23f" alt="" width="563"><figcaption></figcaption></figure>

Paste your AI Assistant’s **OpenAPI JSON URL** and provide a **name** for your connector.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FxocRVcAIz5K7AbyYfUX1%2Fehrtyrde.png?alt=media&amp;token=61bce900-d5e5-4f9a-8203-8561d063767d" alt="" width="506"><figcaption></figcaption></figure>

Configure the connector’s security settings:

* Client ID
* Client Secret
* Authorization URL
* Token URL
* Refresh URL

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2F4cr4LzaOmw1o0pKN9Px5%2Fsrnjs.png?alt=media&amp;token=3dfe91b8-4e6c-4505-8b17-0818c535af77" alt="" width="563"><figcaption></figcaption></figure>

Copy the connector’s Redirect URL (from the **Security tab**).

Return to your MangoApps AI Assistant’s OpenAPI Access settings and paste this Redirect URL into the Callback URL field.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2F6n3lLHF6vJgOeUn8QZE5%2Funnamed%20(3)a.png?alt=media&amp;token=fa104c5c-d1e1-42a1-8c39-da5213978204" alt="" width="563"><figcaption></figcaption></figure>

***

#### 3. Create an Agent in Copilot Studio

Open Copilot Studio and create a new Agent.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FTfZdXjZNOmxoBMK2L6hP%2Fareth.png?alt=media&amp;token=d268f009-fe79-4c96-9057-3024a4c846a8" alt="" width="563"><figcaption></figcaption></figure>

In the Agent’s settings, go to the **Tools** tab.

Add a new tool by searching for “Fetch assistant answer for user query.”

{% hint style="danger" %}
Ensure the byline matches the name of your Power Apps connector.
{% endhint %}

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2F4abjHaPDbn4kSQWecRsa%2Ferhgerthw.png?alt=media&amp;token=455ce92c-30e7-4b2a-96f2-2816c701bebc" alt="" width="563"><figcaption></figcaption></figure>

Add this tool to the Agent.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2Fgzjj85gD2DzoZHBJmOxU%2Ffrnhdtrtnf.png?alt=media&amp;token=a7a62928-22ba-489a-bccf-84cd35cace48" alt=""><figcaption></figcaption></figure>

***

#### 4. Configure Topics in Copilot Studio

Navigate to the Topics tab and create a new **Topic from Blank**.

Configure the Topic steps as follows:

1. Trigger: “A message is received.”
2. Step 1: Add a tool → Connector → select “Fetch assistant answer for user query.”
3. Step 2: Add a message → set it to output queryAnswer.message.
4. Step 3: Add an action → End all topics.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FKkDOsW4GwxsVLuJ3usSZ%2Fghrr.png?alt=media&amp;token=07d5103a-00f3-4e0f-82aa-15a8ae2edb85" alt="" width="563"><figcaption></figcaption></figure>

**Save** and **Publish** the Agent.

***

#### 5. Enable Teams Channel

Navigate to the Agent’s **Channels** tab.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FE3fZNU9qUMGFWEWFD968%2Frsh.png?alt=media&amp;token=d62476fe-cf3d-4639-a18f-eee379f4036b" alt="" width="563"><figcaption></figcaption></figure>

Select **Teams and Microsoft 365 Copilot** and add the channel.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FprFvWmrfdj7KGckwGVFB%2Fehrsthrth.png?alt=media&amp;token=329535f3-4152-4f87-aa0d-be9ae92c3008" alt="" width="563"><figcaption></figcaption></figure>

Under **Availability options**, select **Show to everyone in my org**.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2F1Ys7wj8fXBtL2FD8hCnc%2Fsrjytuyr.png?alt=media&amp;token=b6918f16-dd0c-4fd0-9c52-8d293ffb9728" alt="" width="563"><figcaption></figcaption></figure>

Submit for admin approval.

***

#### 6. Approve & Deploy in Microsoft Teams Admin Center

To approve and deploy the assistant, an Admin must go to the **Teams Admin Center**.

Navigate to **Teams apps > Manage apps**.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FOD1YeIoZ8teoFr78CMFR%2Frjtyjtr.png?alt=media&amp;token=47a0371f-5eed-437d-b653-2e4b5182a87c" alt="" width="563"><figcaption></figcaption></figure>

Under **All apps**, search for the **name** of your Copilot Agent.

Approve and publish the app.

{% hint style="warning" %}
It could take up to a couple of hours for the app to populate in the list once it has been created.
{% endhint %}

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FTmafXp2iUVOZjltMmmA4%2Frjtryjtrjr.png?alt=media&amp;token=15b7d358-e586-42bc-92cb-0c29481f1555" alt="" width="563"><figcaption></figcaption></figure>

***

#### 7. Add the App in Microsoft Teams

Open Microsoft Teams and navigate to **Apps > Built** for your org.

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2FLyQcHzQ94WeF1V3gZKi1%2Frsjrtyjtr.png?alt=media&amp;token=ebccfde5-8f6a-4d7c-bd5a-5542e614dd50" alt="" width="563"><figcaption></figcaption></figure>

Find your newly created Agent app and add it.

Your AI Assistant is now available to employees directly within Microsoft Teams!

<figure><img src="https://3253353518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fler8efF6dRPhC6skcFIU%2Fuploads%2Fcf229dF4XH15or7n4bYN%2Frethrstherther.png?alt=media&amp;token=46476a1c-2ce1-466d-b7ad-46887d43da5e" alt="" width="563"><figcaption></figcaption></figure>
