> For the complete documentation index, see [llms.txt](https://docs.graphlit.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.graphlit.dev/api-guides/use-cases/feeds/messaging/feed-create-microsoft-teams.md).

# Create Microsoft Teams Feed

## User Intent

"How do I sync messages from Microsoft Teams channels? Show me how to create a Teams feed with OAuth."

## Operation

**SDK Method**: `createFeed()` with FeedTypes.MicrosoftTeams\
**OAuth**: Required via Developer Portal

***

## Code Example (TypeScript)

```typescript
import { Graphlit } from 'graphlit-client';
import { FeedListingTypes, FeedTypes } from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

const feed = await graphlit.createFeed({
  name: 'Engineering Team',
  type: FeedTypes.MicrosoftTeams,
  microsoftTeams: {
    type: FeedListingTypes.Past,
    clientId: process.env.MICROSOFT_CLIENT_ID!,
    clientSecret: process.env.MICROSOFT_CLIENT_SECRET!,
    refreshToken: process.env.MICROSOFT_REFRESH_TOKEN!,
    teamId: 'team-id',
    channelId: 'channel-id',
    readLimit: 1000,
  },
  // Optional: add workflow for content processing
  // workflow: { id: workflow.createWorkflow.id }
});

console.log(`Created Teams feed: ${feed.createFeed.id}`);
```

***

## Configuration

**Channels**: Specify channels or leave empty for all\
**readLimit**: Messages per channel (default: 100)\
**includeAttachments**: Sync file attachments

***

## OAuth Setup

1. Developer Portal → Connectors → Messaging
2. Authorize Microsoft Teams
3. Copy OAuth token
4. Use in feed creation

***

## What Gets Synced

* Channel messages
* Mentions
* File attachments (if enabled)
* Message metadata (author, timestamp)

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.graphlit.dev/api-guides/use-cases/feeds/messaging/feed-create-microsoft-teams.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
