> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Teams Integration

> Connect Microsoft Teams so your team can ask CloudThinker questions in team channels and receive alerts and review summaries as cards.

Connect Microsoft Teams once and anyone in a mapped team can mention `@CloudThinker` in a channel to ask about your cloud, then keep talking in the thread. The same connection delivers [notifications](https://docs.cloudthinker.io/guide/notifications.md), such as alerts and code review summaries, as Adaptive Cards in the channels you choose.

## Prerequisites

* A CloudThinker organization **Owner** or **Admin**. Other roles can view the Teams page but can't connect or change it.
* A Team, Scale, or Enterprise plan. On the Free plan the Microsoft Teams card shows **Requires Team plan or above** and an **Upgrade Plan** button. See [pricing](https://docs.cloudthinker.io/guide/billing/pricing.md).
* A Microsoft 365 administrator who can grant admin consent in Microsoft Entra ID. CloudThinker publishes its bot to your organization's Teams app catalog, which needs admin consent. One person can hold both roles. If you aren't a Microsoft 365 admin, open the Teams page as a CloudThinker Owner or Admin, click **Connect with Microsoft** in step 2, and have the Microsoft admin sign in on that Microsoft screen while you work together. The permissions they consent to are listed under [Security and permissions](#security-and-permissions).
* CloudThinker hosted at app.cloudthinker.io. A self-hosted install shows **Not available on self-host** on the card.

Each Microsoft tenant can connect to one CloudThinker organization.

## Connect Microsoft Teams

**1. Open the Teams integration**

Go to **Admin Settings → Integrations**, find the **Microsoft Teams** card, and click **Go to configure**.

**2. Click Connect with Microsoft**

Sign in with the Microsoft admin account. On the permissions screen, check **Consent on behalf of your organization**, then click **Accept**.

**Success state:** you return to the Teams page with a **Teams connected successfully** message, and **Authenticate with Microsoft** shows your tenant name and ID.

**3. Add a team**

Under **Install bot and configure workspaces**, click **Add team**, search for the team, and select it. The search lists every team in your tenant whose name starts with what you type, not only teams you own, so coordinate with the team's owner first: every member of the team can see and mention the bot. CloudThinker installs the bot into that team, where it can read channel messages (the `ChannelMessage.Read.Group` permission) and post replies and cards.

**Success state:** a **CloudThinker bot installed to team** message appears and the team shows as a row. Click **Add another team** to repeat for more teams.

**4. Choose the workspace for each team**

Open **Select workspace** on the team's row and pick the CloudThinker workspace whose connections that team should use. Every channel in the team uses this workspace.

**Success state:** a **Workspace mapping updated** message appears.

**5. Send a test message**

In any standard channel of that team, mention the bot:

```text theme={null}
@CloudThinker What drove our cloud spend up last week?
```

**Success state:** CloudThinker replies in the thread. Reply in that thread to follow up. You don't need to mention the bot again.

> [!WARNING]
>
> Anyone who can post in a mapped team can ask CloudThinker to work with that workspace's connections. A person who linked a CloudThinker account runs requests as that user. Everyone else runs as one account: whoever created the workspace, or the organization **Owner** for a workspace the organization owns. Map only teams whose members should have that access.

### Link your CloudThinker account

A linked account makes your requests run as you, with your workspace role, instead of as that one account. You can't start linking on demand: CloudThinker posts a **Link Your CloudThinker Account** card only when it can't find an account that owns the workspace. Click **Link Account** on the card and sign in. The page shows **Account linked successfully!** when it's done. The Microsoft account that signed in during step 2 is linked automatically to the CloudThinker account that clicked **Connect with Microsoft**, so if two people did the setup together, that Microsoft admin's requests run as the CloudThinker admin. There's no per-user unlink; **Disconnect from Teams** removes every linked account.

## Ask CloudThinker in Teams

Start each new request with `@CloudThinker` in a team channel. After that, you write the same requests you'd type in the web app.

Talk to agents in plain language. The full pattern is:

```text theme={null}
@agent #connection your request
```

* **`@agent`** *(optional)* — leave it out and CloudThinker answers, or mention one of your workspace's [custom agents](https://docs.cloudthinker.io/guide/agents/overview.md#custom-agents).
* **`#connection`** *(optional)* — the connection to use, such as your AWS account or a Kubernetes cluster.
* **`/`** *(optional)* — run a skill or a command.
* **Your request** — what you need, in your own words. Add any context inline.

See [Commands](https://docs.cloudthinker.io/guide/commands.md) for the full list.

```text theme={null}
@CloudThinker Which EC2 instances ran under 10% CPU for the last 14 days?
@CloudThinker Summarize open critical security findings for production
@CloudThinker Why did checkout latency spike at 14:00 UTC today?
```

| You see | What it means |
| - | - |
| A typing indicator | CloudThinker is working on the request |
| A reply in the thread | The answer. The full conversation also appears in the CloudThinker web app |
| A **Permission Required** card with **View in CloudThinker** | The request needs an action that your [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md) setup holds for a person. Open the link and approve or decline it in the web app |
| A **Link Your CloudThinker Account** card | You haven't linked an account and CloudThinker couldn't find the account that owns the workspace, so the request didn't run. Click **Link Account** and sign in to CloudThinker |

CloudThinker works in team channels only. In a personal chat or a group chat it doesn't run requests, and it replies **I can only respond in team channels** when it can't find a team. It reads the text of your message, so paste the content you want it to read instead of attaching a file.

## Send notifications to Teams

**1. Open notification settings**

On the Teams page, under **Configure notifications**, click **Go to notification settings**. You can also go to **More → Workspace settings → Notifications**.

**2. Pick a default channel for the workspace**

Under **Delivery channels**, find the Teams card (it reads **Pick a channel** until one is set). Click its settings icon (**Change Teams channel**), then search for and select a channel under **Teams Notification Channel**. Only standard channels are listed. Private and shared channels can't receive bot notifications.

**3. Override per notification type (optional)**

Under **What to notify me about**, turn on the Teams cell for an event, then click the **→** channel chip next to it to send that event to a different channel. The **Alerts** and **Keepers** rows also have a severity picker. See [Notifications](https://docs.cloudthinker.io/guide/notifications.md) for the full list of types.

**Success state:** the next matching event posts as a card in the chosen channel.

## Code review notifications

When [Review](https://docs.cloudthinker.io/guide/code-review/overview.md) finishes a pull request or merge request on a connected repository, CloudThinker can post an Adaptive Card to Teams:

* A table of findings by severity
* Up to 5 unresolved findings, each with its title, severity, file path, and line number
* How many earlier findings are now resolved
* A **View Review** button that opens the review in CloudThinker
* **No issues found** when the review is clean

Choose the channel and severity threshold for reviews in [Notifications](https://docs.cloudthinker.io/guide/notifications.md).

## Security and permissions

| Question | Answer |
| - | - |
| Microsoft Graph permissions | Delegated, granted at sign-in. See the table below |
| Whose token CloudThinker keeps | The Microsoft admin who connected Teams. CloudThinker stores that admin's access and refresh tokens, encrypted, and uses them to list teams and channels and install the bot. If the tokens stop working, for example because the admin left, adding a team fails with **Teams connection token expired. An admin must reconnect Teams.** To revoke CloudThinker's access, remove its admin consent in Microsoft Entra ID under **Enterprise applications** |
| Bot permission in each team (application, resource-specific) | `ChannelMessage.Read.Group`, so the bot can read messages in that team's channels |
| What CloudThinker stores | Your requests and its replies, saved as a conversation in the mapped workspace, plus the team-to-workspace mappings and linked accounts |

| Graph permission | Why |
| - | - |
| `User.Read`, `openid`, `profile` | Sign in the Microsoft admin |
| `Organization.Read.All` | Read your tenant name for the Teams page |
| `Team.ReadBasic.All` | List teams in the **Add team** search |
| `Channel.ReadBasic.All` | List channels in the notification picker |
| `AppCatalog.ReadWrite.All` | Publish the CloudThinker bot to your organization's Teams app catalog |
| `TeamsAppInstallation.ReadWriteForTeam`, `TeamsAppInstallation.ReadWriteSelfForTeam` | Install the bot into the teams you add, and remove it when you remove a team |
| `TeamsAppInstallation.ReadWriteAndConsentForTeam` | Grant the bot its `ChannelMessage.Read.Group` permission in each team it joins |
| `offline_access` | Get a refresh token, so CloudThinker can keep calling Graph without a new sign-in |

## Manage the connection

| Task | How |
| - | - |
| Move a team to another workspace | Change **Select workspace** on its row |
| Stop using CloudThinker in a team | Remove the team's row on the Teams page. CloudThinker uninstalls the bot from that team and clears notification settings that pointed to its channels |
| Disconnect | Click **Disconnect from Teams** at the bottom of the Teams page. CloudThinker uninstalls the bot from every mapped team and deletes the team mappings, linked accounts, and Teams notification settings |

## Troubleshooting

> [accordion] Teams authorization denied
>
> The Microsoft sign-in was denied or cancelled. Click **Connect with Microsoft** again and accept the permissions.

> [accordion] Missing required permissions when adding a team
>
> The Microsoft account didn't grant admin consent. Sign in again as a Microsoft 365 administrator and check **Consent on behalf of your organization**, or grant admin consent for CloudThinker in Microsoft Entra ID.

> [accordion] The bot won't install into a team
>
> Your Teams admin settings may block custom apps. In the Teams admin center, go to **Teams apps → Manage apps** and search for **CloudThinker**, the custom app published to your organization by developer CloudThinker. If its status is blocked, set it to allowed, and check that your app permission policies don't block it. Then click **Add team** again.

> [accordion] This tenant is already connected
>
> Your Microsoft tenant is already connected to another CloudThinker organization. Disconnect it there first.

> [accordion] This team isn't linked to any workspace
>
> The team has no workspace mapping. On the Teams page, set **Select workspace** on the team's row, or click **Add team** if the team isn't listed.

> [accordion] The bot doesn't reply
>
> Check that you posted in a standard channel of a team you added, and that you mentioned `@CloudThinker` in a new message. A message without the mention gets a reply only inside a thread CloudThinker already started.

> [accordion] A channel doesn't appear in the notification picker
>
> Only standard channels are listed. Pick a standard channel in the same team, or check that the team appears on the Teams page.

## Next steps

> [card] [Commands and prompt syntax](https://docs.cloudthinker.io/guide/commands.md)
>
> Write sharper requests and save the ones your team repeats

> [card] [Notifications](https://docs.cloudthinker.io/guide/notifications.md)
>
> Choose which events reach Teams and at what severity

> [card] [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md)
>
> Decide which actions need a person before CloudThinker runs them

> [card] [Slack](https://docs.cloudthinker.io/guide/slack-integration.md)
>
> Set up the same workflow in Slack


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.