What we do
Tools
Industries
Department
How we workLet's talk →
Home/MS Teams
Microsoft Teams

The Microsoft Teams API Is Microsoft Graph, Plus a Bot When It Needs to Talk

You've been asked to make Teams do something without a person clicking: open a team for each new client, post when an order stalls, or copy channel decisions into another system. There's no separate Teams API to sign up for. Managing and reading Teams goes through Microsoft Graph, and anything that holds a conversation is a bot. The hard part is picking the permission model, because it decides what IT has to approve.

Where MS Teams stops

Chat, meetings and files live here, but the rest of the business doesn't.

Stuck on MS Teams? Let's solve it →
Which part of the Teams API does the job

Create and manage teams, channels, tabs and members: Microsoft Graph, under /teams and /teams/{id}/channels. A team can be created from a template, have apps installed into it, and be archived when the work ends.

Read channel or chat messages: Graph's chatMessage resource. Reading across the whole tenant with app permissions is a protected API that needs Microsoft's approval first. Reading only where your app is installed uses resource-specific consent instead.

Post messages from a service: a bot, or a Workflows webhook for one-way alerts. Graph's send-message call works for a signed-in user. Its application permission is only for migrating old messages in.

Hear about changes as they happen: Graph change notifications, a subscription that calls your HTTPS endpoint when a message, channel, team or membership changes.

Choose the permission model before you write code

Every Graph call for Teams runs under one of these. It's the first thing an IT or security reviewer will ask about.

Your app needs to Permission model What it takes
Act as the person using it: post for them, list their teams Delegated permissions, such as ChannelMessage.Send for posting to a channel. The user signs in through Microsoft Entra ID, and the app can only reach what that person can.
Run unattended: a new team for each project, membership clean-up Application permissions, consented by a tenant admin. The app can reach every team in the tenant, so expect a security review and keep the list of permissions short.
Read messages in a few teams or chats only Resource-specific consent, such as ChannelMessage.Read.Group or ChatMessage.Read.Chat, declared in the Teams app manifest. Granted when the app is installed in that team or chat, within admin policy. It covers the team's standard channels, and private or shared channels only once the app is added to them.
Read every message across the tenant: compliance, archiving, analytics Application permissions such as ChannelMessage.Read.All on Microsoft's protected APIs. Microsoft has to approve your request form first. Until then calls return 403, with an error saying the API needs protected access when you're not using resource-specific consent.

Change notifications: what your endpoint has to handle

Polling Teams for new messages is slow and burns requests. Subscriptions push the change to you, with a few conditions attached.

  • Answer the validation request

    When you create a subscription, Graph calls your URL with a validation token and expects it echoed back as plain text. No echo, no subscription.

  • Renew it on a timer

    Teams message, chat and channel subscriptions last up to three days, and any set longer than an hour must also give Graph a lifecycle notification URL. Renewing them before they expire is part of the build, not an extra.

  • Decide whether you want the content

    With resource data, the message arrives encrypted and you need a certificate to decrypt it. Without, you get IDs and call back for the content, and that call returns the message as it is now, edits included.

  • Pick the narrowest path

    One channel (/teams/{id}/channels/{id}/messages) or one chat is a small, easy approval. /teams/getAllMessages covers every channel in the tenant and falls under the protected APIs.

  • Check clientState on every call

    You set a secret value when subscribing, and every notification carries it back. Drop anything that doesn't match.

When Teams has to answer back

Graph is for managing and reading Teams. The moment someone needs to click Approve, ask a question or get a reply, you're building a bot. Bots post Adaptive Cards with buttons and inputs, and the click comes back to your code, so an approval in the chat can update the purchase order, leave request or invoice it belongs to. Our Teams bots page covers which Microsoft tool to build one with. For one-way alerts, the Workflows app is simpler, covered on Teams workflows.

Teams already shares calendars with Outlook, and a channel's files live in the SharePoint site behind its team. What it can't do alone is act on them elsewhere: a meeting outcome or a file dropped in a channel has to be picked up through Graph before your CRM or ERP hears about it.

The same API sits behind setup and reporting work: creating channels to a set pattern, starting teams from Teams templates, pulling usage into Teams reporting, and getting call records out of the Teams phone system. n-frames builds these Graph integrations for companies that run on Microsoft 365, with the permission requests written up for IT to approve.

What this looks like in practice

Multi-Department Construction Firm

Teams for coordination, spend in an ERP.

The problem Department heads found out a budget had been blown only when finance emailed them after the month closed.

As soon as a department's spend crosses its threshold in the ERP, a message with the figures appears in that department's Teams channel, early enough to change course.

Questions people ask

What is Microsoft Teams?

Microsoft's business communication app, part of Microsoft 365: ongoing chat organized into teams and channels, video meetings, calling and file sharing.

Where do I log into Microsoft Teams?

At teams.microsoft.com in a browser, or in the desktop or mobile app, with the Microsoft 365 work account your organization gave you.

Is there a separate Microsoft Teams API?

Not really. Teams data and settings are reached through Microsoft Graph, the same API behind the Teams admin center and Teams PowerShell. Conversations in chat are handled by a bot built on the Teams developer platform, which can call Graph too.

Does Microsoft Teams connect to Outlook and SharePoint on its own?

Yes. Teams meetings appear in Outlook calendars and the other way round, and files shared in a channel are stored in the team's SharePoint site. What it doesn't do on its own is trigger something in a different system, like your CRM or accounting software, when a meeting ends or a file lands.

Can you build a custom bot or approval workflow inside Teams?

Yes. Approvals are Adaptive Cards posted by a bot, with each click sent back to update the system the request came from. n-frames builds them around one business workflow at a time, such as purchase approvals or leave requests.

Why does Graph return 403 when my app reads Teams channel messages?

Usually because the app is using application permissions to read messages tenant-wide, which Microsoft treats as a protected API. Either submit Microsoft's request form for protected API access, or switch to resource-specific consent so the app reads only the teams or chats it's installed in.

Can an app post to a Teams channel through Microsoft Graph without a user?

Not for everyday posting. Graph's send-message call takes delegated permission for a signed-in user, and its application permission is meant for migrating old messages. Unattended posts usually go through a bot or a Workflows webhook.

Who builds Microsoft Graph integrations for Teams?

Most companies hand it to someone who has handled the consent and renewal work before. n-frames builds them end to end: the app registration, the permission request for IT, change-notification receivers that renew themselves, and the link into your CRM, ERP or ticketing system.

Let's talk

Tell us the one thing your team does manually that eats up time. We read every message and reply within a day.