# Create Outlook Calendar Feed

## User Intent

"How do I sync Outlook Calendar events? Show me Outlook Calendar feed configuration."

## Operation

**SDK Method**: `createFeed()` with FeedTypes.Calendar\
**OAuth**: Required

***

## Code Example (TypeScript)

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

const graphlit = new Graphlit();

// Enumerate Outlook calendars for the authorized account
const calendarsResponse = await graphlit.queryMicrosoftCalendars({
  clientId: process.env.MICROSOFT_CLIENT_ID!,
  clientSecret: process.env.MICROSOFT_CLIENT_SECRET!,
  refreshToken: process.env.MICROSOFT_REFRESH_TOKEN!,
});

const calendars = calendarsResponse.microsoftCalendars?.results ?? [];

if (calendars.length === 0) {
  throw new Error('No Outlook calendars available for the provided credentials');
}

const calendarId = calendars[0]?.calendarId!;
console.log(`Using Outlook calendar: ${calendars[0]?.calendarName} (${calendarId})`);

const feed = await graphlit.createFeed({
  name: 'Company Outlook Calendar',
  type: FeedTypes.Calendar,
  calendar: {
    type: FeedServiceTypes.MicrosoftCalendar,
    token: process.env.MICROSOFT_OAUTH_TOKEN!,
    calendarId,
    readLimit: 100,
  },
  // Optional: add workflow for content processing
  // workflow: { id: workflow.createWorkflow.id }
});

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

***


---

# Agent Instructions: 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:

```
GET https://docs.graphlit.dev/api-guides/use-cases/feeds/calendars/feed-create-outlook-calendar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
