Finish connecting Microsoft Teams
Redeem the code and state Microsoft sent the browser back with.
Finish connecting Microsoft Teams
curl --request POST \
--url https://app.mithunai.com/mithunai/api/v1/integrations/teams/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"state": "<string>"
}
'import requests
url = "https://app.mithunai.com/mithunai/api/v1/integrations/teams/complete"
payload = {
"code": "<string>",
"state": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', state: '<string>'})
};
fetch('https://app.mithunai.com/mithunai/api/v1/integrations/teams/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));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).
string
required
What Microsoft sent back as
code.string
required
What Microsoft sent back as
state.Response
Returns201 and data, as Read the Microsoft Teams connection does.Last modified on November 11, 2026
Finish connecting Microsoft Teams
curl --request POST \
--url https://app.mithunai.com/mithunai/api/v1/integrations/teams/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"state": "<string>"
}
'import requests
url = "https://app.mithunai.com/mithunai/api/v1/integrations/teams/complete"
payload = {
"code": "<string>",
"state": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>', state: '<string>'})
};
fetch('https://app.mithunai.com/mithunai/api/v1/integrations/teams/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));