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

# Finish connecting Microsoft Teams

> Redeem the code and state Microsoft sent the browser back with.

Microsoft sends the browser back to the console with `code` and `state`, and the console sends them here. The state is spent on first use and must have been issued to the same person in the same organisation. **The Teams organisation connected is the one Microsoft names** in the ID token its token endpoint returns -- checked for this bot's app and Microsoft's issuer -- never anything the browser carries back.

Answers `409` when that Teams organisation is connected to another organisation, or yours is connected to a different one (remove that one first).

**code** `string` *required*

What Microsoft sent back as `code`.

**state** `string` *required*

What Microsoft sent back as `state`.

## Response

Returns `201` and `data`, as [Read the Microsoft Teams connection](https://docs.mithunai.com/api-reference/teams/get-teams.md) does.


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