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

# Microsoft Teams

> Open-Source Microsoft Teams Connector

<Card title="Microsoft Teams" icon={<svg width="24" height="24" viewBox="0 0 62 62" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none"><g clip-path="url(#B)"><g fill="#5059c9"><path d="M39.69 26.35h11.365c1.074 0 1.944.87 1.944 1.944v10.352c0 3.946-3.199 7.145-7.145 7.145h-.034c-3.946.001-7.146-3.198-7.146-7.144V27.366c0-.561.455-1.016 1.016-1.016zm7.682-2.048c2.543 0 4.605-2.062 4.605-4.605s-2.061-4.605-4.605-4.605-4.605 2.061-4.605 4.605 2.062 4.605 4.605 4.605z"/></g><g fill="#7b83eb"><path d="M33.046 24.302c3.673 0 6.651-2.978 6.651-6.651a6.65 6.65 0 1 0-13.302 0c0 3.673 2.978 6.651 6.651 6.651zm8.869 2.048h-18.76c-1.061.026-1.9.907-1.876 1.968v11.807c-.148 6.367 4.889 11.651 11.256 11.806 6.367-.156 11.404-5.439 11.256-11.806V28.317c.025-1.061-.815-1.941-1.876-1.968z"/></g><g fill="#000"><path opacity=".1" d="M33.558 26.35v16.546c-.005.759-.465 1.44-1.167 1.729a1.81 1.81 0 0 1-.706.143h-9.506l-.358-1.023c-.358-1.174-.541-2.395-.542-3.622V28.314a1.92 1.92 0 0 1 1.872-1.965h10.407z"/><path opacity=".2" d="M32.535 26.35v17.569a1.81 1.81 0 0 1-.143.706c-.289.702-.971 1.161-1.729 1.166H22.66l-.481-1.023c-.143-.348-.256-.675-.358-1.023-.358-1.174-.541-2.395-.542-3.622V28.314a1.92 1.92 0 0 1 1.872-1.965h9.383z"/><path opacity=".2" d="M32.535 26.35v15.523c-.008 1.031-.842 1.865-1.873 1.873h-8.841c-.358-1.174-.541-2.395-.542-3.622V28.314a1.92 1.92 0 0 1 1.872-1.965h9.383z"/><path opacity=".2" d="M31.512 26.35v15.523c-.008 1.031-.842 1.865-1.873 1.873h-7.818c-.358-1.174-.541-2.395-.542-3.622V28.314a1.92 1.92 0 0 1 1.872-1.965h8.36z"/><path opacity=".1" d="M33.558 21.059v3.223l-.512.021c-.174 0-.338-.01-.512-.021-.345-.023-.688-.078-1.023-.164a6.65 6.65 0 0 1-4.605-3.909c-.141-.33-.251-.673-.327-1.023h5.106a1.88 1.88 0 0 1 1.873 1.873z"/><use xlink:href="#C" opacity=".2"/><use xlink:href="#C" opacity=".2"/><path opacity=".2" d="M31.512 22.084v2.036a6.65 6.65 0 0 1-4.605-3.909h2.732a1.88 1.88 0 0 1 1.873 1.873z"/></g><path d="M10.876 20.211h18.76c1.036 0 1.876.84 1.876 1.876v18.76c0 1.036-.84 1.876-1.876 1.876h-18.76C9.84 42.723 9 41.883 9 40.847v-18.76c0-1.036.84-1.876 1.876-1.876z" fill="url(#A)"/><path d="M25.192 27.347h-3.75v10.212h-2.389V27.347H15.32v-1.981h9.872v1.981z" fill="#fff"/></g><defs><linearGradient id="A" x1="12.911" y1="18.745" x2="27.601" y2="44.188" gradientUnits="userSpaceOnUse"><stop stop-color="#5a62c3"/><stop offset=".5" stop-color="#4d55bd"/><stop offset="1" stop-color="#3940ab"/></linearGradient><clipPath id="B"><path fill="#fff" transform="translate(9 11)" d="M0 0h44v40.93H0z"/></clipPath><path id="C" d="M32.535 22.084v2.2c-.345-.023-.688-.078-1.023-.164a6.65 6.65 0 0 1-4.605-3.909h3.755a1.88 1.88 0 0 1 1.873 1.873z"/></defs></svg>}>
  The Microsoft Teams connector enables easy and secure data synchronization between your application and your customers' Microsoft Teams accounts through unified data models.
</Card>

## Authorization

<Accordion title="OAuth" defaultOpen={false} icon="key-skeleton" iconType="duotone">
  The Microsoft Teams connector uses OAuth for secure authentication. When creating a connection, the required OAuth scopes are automatically configured based on your specific operations needs (e.g. `genericContact::create`, `genericUser::list`).<br /><br />
  ✓ Automatic token refresh handling<br />
  ✓ Proactive insufficient permissions detection<br /><br />

  [View our step-by-step integration guide](./../api-reference/intro)

  **Whitelabel**

  <Check>
    **Supported** <br />
    You can choose to provide your own set of `clientId` and `clientSecret` for this
    connector from the Morph Cloud dashboard; allowing a fully whitelabled experience
    for your end-customers.
  </Check>
</Accordion>

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { Morph } from "@runmorph/cloud";

  const morph = Morph({ publicKey: "pk_demo_xxxxxxxxxxxxxxx", secretKey: "sk_demo_xxxxxxxxxxxxxxx"}); 

  // create a new connection
  const connection = morph.connections({ connectorId: "microsoft-teams", ownerId: "demo" });
  await connection.create({ operations:[ "genericContact::list" ]});

  // auhtorize the connection
  const { auhtorizationUrl } = await connection.authorize();

  // redirect the user to the auhtorizationUrl
  ```

  ```tsx React theme={null}
  import { Morph, Connect } from "@runmorph/atoms";

  // generate sessionToken from server →  morph.sessions().create(...);

  export default function ConnectionPage({ sessionToken }) {
    return (
      <Morph.Provider>
        <Connect
          sessionToken={sessionToken}
          connectionCallbacks={{
            onError: (error) => alert(error.message)
          }}
        />
      </Morph.Provider>
    );
  }
  ```

  ```python Python theme={null}
  morph = Morph(api_key="pk_demo_xxxxxxxxxxxxxxx", api_secret="sk_demo_xxxxxxxxxxxxxxx")

  # create a new connection
  connection = morph.connections(connector_id="microsoft-teams", owner_id="demo")
  connection.create(operations=[ "genericContact::list" ])

  # authorize the connection
  auth_result = connection.authorize()
  authorization_url = auth_result["authorization_url"]

  # redirect the user to the authorization_url
  ```

  ```ruby Ruby theme={null}
  morph = Morph.new(api_key: "pk_demo_xxxxxxxxxxxxxxx", api_secret: "sk_demo_xxxxxxxxxxxxxxx")

  # create a new connection
  connection = morph.connections(connector_id: "microsoft-teams", owner_id: "demo")
  connection.create(operations: [ "genericContact::list" ])

  # authorize the connection
  auth_result = connection.authorize
  authorization_url = auth_result[:authorization_url]

  # redirect the user to the authorization_url
  ```

  ```php PHP theme={null}
  $morph = new Morph([
    'api_key' => 'pk_demo_xxxxxxxxxxxxxxx',
    'api_secret' => 'sk_demo_xxxxxxxxxxxxxxx'
  ]);

  // create a new connection
  $connection = $morph->connections([
    'connector_id' => 'microsoft-teams',
    'owner_id' => 'demo'
  ]);
  $connection->create(['operations' => ['genericContact::create','genericUser::list']]);

  // auhtorize the connection
  $authResult = $connection->authorize();
  $authorizationUrl = $authResult['authorization_url'];

  // redirect the user to the auhtorizationUrl
  ```

  ```go Go theme={null}
  morph := morph.New(&morph.Config{
      publicKey:    "pk_demo_xxxxxxxxxxxxxxx",
      secretKey: "sk_demo_xxxxxxxxxxxxxxx",
  })

  // create a new connection
  connection := morph.Connections(&morph.ConnectionConfig{
      ConnectorId: "microsoft-teams",
      OwnerId:    "demo",
  })
  connection.Create(&morph.CreateConfig{
      Operations: []string{"genericContact::create", "genericUser::list"},
  })

  // authorize the connection
  authResult, _ := connection.Authorize()
  authorizationUrl := authResult.AuthorizationUrl

  // redirect the user to the authorization URL
  ```
</CodeGroup>

<br />

<Accordion title="Try a live demo of Microsoft Teams connection ✨">
  <Check>
    **Live Demo** <br />
    Select a connector below to experience our seamless authentication flow and see
    how easy it is to connect third-party services.
  </Check>

  <iframe src="https://atoms-playground.vercel.app/temp/connectors/microsoft-teams?theme=light" width="100%" height="370px" className="block dark:hidden" />

  <iframe src="https://atoms-playground.vercel.app/temp/connectors/microsoft-teams?theme=dark" width="100%" height="370px" className="hidden dark:block" />
</Accordion>

## Models

### Generic

<AccordionGroup>
  <Accordion title="User" defaultOpen={false} icon="users-medical">
    <p>
      The Microsoft Teams connector seamlessly integrates with our unified `genericUser` model, enabling you to manage Users with rich data including `firstName`, `lastName`, `email` and other key details <br />
    </p>

    **API Reference**

    <table className="mt-0">
      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md leading-tight font-bold bg-green-400/20 text-green-700 dark:bg-green-400/20 dark:text-green-400">GET</span>
        </td>

        <td className="py-1 px-2">`/resources/genericUser`</td>
        <td className="py-1 px-2">[List and Search Microsoft Teams Users](./../api-reference/models/user/list-user)</td>
      </tr>

      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md  leading-tight font-bold bg-green-400/20 text-green-700 dark:bg-green-400/20 dark:text-green-400">GET</span>
        </td>

        <td className="py-1 px-2">`/resources/genericUser/:id`</td>
        <td className="py-1 px-2">[Retrieve a Microsoft Teams User](./../api-reference/models/user/retrieve-user)</td>
      </tr>

      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md  leading-tight font-bold bg-blue-400/20 text-blue-700 dark:bg-blue-400/20 dark:text-blue-400">POST</span>
        </td>

        <td className="py-1 px-2">`/resources/genericUser`</td>
        <td className="py-1 px-2">[Create a Microsoft Teams User](./../api-reference/models/user/create-user)</td>
      </tr>

      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md leading-tight font-bold bg-orange-400/20 text-orange-700 dark:bg-orange-400/20 dark:text-orange-400">PATCH</span>
        </td>

        <td className="py-1 px-2">`/resources/genericUser/:id`</td>
        <td className="py-1 px-2">[Update a Microsoft Teams User](./../api-reference/models/user/update-user)</td>
      </tr>

      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md leading-tight font-bold bg-red-400/20 text-red-700 dark:bg-red-400/20 dark:text-red-400">DEL</span>
        </td>

        <td className="py-1 px-2">`/resources/genericUser/:id`</td>
        <td className="py-1 px-2">[Delete a Microsoft Teams User](./../api-reference/models/user/delete-user)</td>
      </tr>
    </table>

    **Custom Fields**

    <Check>
      **Supported** <br />
      The Microsoft Teams connector supports our `Field Mapping` feature, enabling you or your customers to seamlessly map Microsoft Teams User custom fields to the unified user model. This allows for flexible data synchronization while maintaining data consistency across all connectors.
    </Check>

    <br />

    [view User model details](./../models/genericUser)
  </Accordion>

  <Accordion title="Workspace" defaultOpen={false} icon="network-wired">
    <p>
      The Microsoft Teams connector seamlessly integrates with our unified `genericWorkspace` model, enabling you to manage Workspaces with rich data including `name` and other key details <br />
    </p>

    **API Reference**

    <table className="mt-0">
      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md leading-tight font-bold bg-green-400/20 text-green-700 dark:bg-green-400/20 dark:text-green-400">GET</span>
        </td>

        <td className="py-1 px-2">`/resources/genericWorkspace`</td>
        <td className="py-1 px-2">[List and Search Microsoft Teams Workspaces](./../api-reference/models/workspace/list-workspace)</td>
      </tr>

      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md  leading-tight font-bold bg-green-400/20 text-green-700 dark:bg-green-400/20 dark:text-green-400">GET</span>
        </td>

        <td className="py-1 px-2">`/resources/genericWorkspace/:id`</td>
        <td className="py-1 px-2">[Retrieve a Microsoft Teams Workspace](./../api-reference/models/workspace/retrieve-workspace)</td>
      </tr>

      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md  leading-tight font-bold bg-blue-400/20 text-blue-700 dark:bg-blue-400/20 dark:text-blue-400">POST</span>
        </td>

        <td className="py-1 px-2">`/resources/genericWorkspace`</td>
        <td className="py-1 px-2">[Create a Microsoft Teams Workspace](./../api-reference/models/workspace/create-workspace)</td>
      </tr>

      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md leading-tight font-bold bg-orange-400/20 text-orange-700 dark:bg-orange-400/20 dark:text-orange-400">PATCH</span>
        </td>

        <td className="py-1 px-2">`/resources/genericWorkspace/:id`</td>
        <td className="py-1 px-2">[Update a Microsoft Teams Workspace](./../api-reference/models/workspace/update-workspace)</td>
      </tr>

      <tr>
        <td className="py-1 px-2">
          <span className="px-1 py-0.5 rounded-md leading-tight font-bold bg-red-400/20 text-red-700 dark:bg-red-400/20 dark:text-red-400">DEL</span>
        </td>

        <td className="py-1 px-2">`/resources/genericWorkspace/:id`</td>
        <td className="py-1 px-2">[Delete a Microsoft Teams Workspace](./../api-reference/models/workspace/delete-workspace)</td>
      </tr>
    </table>

    **Custom Fields**

    <Check>
      **Supported** <br />
      The Microsoft Teams connector supports our `Field Mapping` feature, enabling you or your customers to seamlessly map Microsoft Teams Workspace custom fields to the unified workspace model. This allows for flexible data synchronization while maintaining data consistency across all connectors.
    </Check>

    <br />

    [view Workspace model details](./../models/genericWorkspace)
  </Accordion>
</AccordionGroup>

## Custom

<Check>
  **Supported** <br />
  Can't find the unified model you need? The Microsoft Teams connector supports your own custom model.
</Check>

## Webhooks

<Accordion title="Events Subscription" defaultOpen={false} icon="webhook" iconType="duotone">
  The Microsoft Teams connector supports real-time event subscriptions, allowing you to
  receive instant notifications when records are created, updated, or deleted.
  Below are the supported models and their corresponding triggers.

  <table className="mt-0">
    <tr>
      <th className="py-1 px-2">Models</th>
      <th className="py-1 px-2">Created</th>
      <th className="py-1 px-2">Updated</th>
      <th className="py-1 px-2">Deleted</th>
      <th className="py-1 px-6">API Reference</th>
    </tr>

    <tr>
      <td className="">`genericUser`</td>

      <td className=" text-center">
        <Icon icon="circle-check" iconType="duotone" />
      </td>

      <td className=" text-center">
        <Icon icon="circle-check" iconType="duotone" />
      </td>

      <td className=" text-center">
        <Icon icon="circle-check" iconType="duotone" />
      </td>

      <td className=" text-center">
        [view event](./../api-reference/models/user/event)
      </td>
    </tr>

    <tr>
      <td className="">`genericWorkspace`</td>

      <td className=" text-center">
        <Icon icon="circle-x" iconType="duotone" color="gray" />
      </td>

      <td className=" text-center">
        <Icon icon="circle-x" iconType="duotone" color="gray" />
      </td>

      <td className=" text-center">
        <Icon icon="circle-x" iconType="duotone" color="gray" />
      </td>

      <td className=" text-center">
        [view event](./../api-reference/models/workspace/event)
      </td>
    </tr>
  </table>
</Accordion>

## Proxy

<Check>
  **Supported** <br />
  The Microsoft Teams connector supports our `Proxy Request` feature, allowing you to directly
  call any endpoints from Microsoft Teams's public API without needing to handle authentication.
  Your customer's token will be automatically set and refreshed as needed, enabling
  quick implementation of custom connector behaviors. [View API Reference](./../api-reference/proxy/proxy-request-to-connector).
</Check>
