home / skills / openclaw / skills / microsoft-teams

microsoft-teams skill

/skills/mrgoodb/microsoft-teams

This skill helps automate Microsoft Teams tasks by posting messages, listing channels, and scheduling meetings via Graph API and webhooks.

npx playbooks add skill openclaw/skills --skill microsoft-teams

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.1 KB
---
name: microsoft-teams
description: Send messages, manage channels, and automate workflows via Microsoft Teams API. Post to channels, create meetings, and manage team memberships.
metadata: {"clawdbot":{"emoji":"šŸ‘„","requires":{"env":["TEAMS_WEBHOOK_URL"]}}}
---

# Microsoft Teams

Team collaboration and messaging.

## Webhook (Simplest - No Auth)

```bash
# Post to channel via incoming webhook
curl -X POST "$TEAMS_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from automation!"}'
```

## Adaptive Card via Webhook

```bash
curl -X POST "$TEAMS_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "message",
    "attachments": [{
      "contentType": "application/vnd.microsoft.card.adaptive",
      "content": {
        "type": "AdaptiveCard",
        "body": [{"type": "TextBlock", "text": "Alert!", "weight": "bolder"}],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.2"
      }
    }]
  }'
```

## Graph API (Full Access)

Requires Azure AD app registration with Microsoft Graph permissions.

```bash
export TEAMS_ACCESS_TOKEN="xxxxxxxxxx"

# List joined teams
curl "https://graph.microsoft.com/v1.0/me/joinedTeams" \
  -H "Authorization: Bearer $TEAMS_ACCESS_TOKEN"

# List channels
curl "https://graph.microsoft.com/v1.0/teams/{team-id}/channels" \
  -H "Authorization: Bearer $TEAMS_ACCESS_TOKEN"

# Send message to channel
curl -X POST "https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/messages" \
  -H "Authorization: Bearer $TEAMS_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"body": {"content": "Hello Teams!"}}'

# Create online meeting
curl -X POST "https://graph.microsoft.com/v1.0/me/onlineMeetings" \
  -H "Authorization: Bearer $TEAMS_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startDateTime": "2024-01-30T10:00:00Z", "endDateTime": "2024-01-30T11:00:00Z", "subject": "Quick Sync"}'
```

## Links
- Admin: https://admin.teams.microsoft.com
- Docs: https://docs.microsoft.com/en-us/graph/api/resources/teams-api-overview

Overview

This skill integrates with Microsoft Teams to send messages, manage channels and members, and automate meeting workflows using either simple incoming webhooks or the Microsoft Graph API. It supports posting plain text, Adaptive Cards, creating online meetings, and listing or modifying team resources. The skill is designed for automation, alerts, and routine team management tasks.

How this skill works

Use incoming webhooks for the simplest no-auth posts to a channel or to deliver Adaptive Cards as rich notifications. For full control—listing teams, creating channels, managing membership, and scheduling meetings—authenticate an Azure AD app and call Microsoft Graph endpoints with a valid access token. The skill posts JSON payloads for messages and Adaptive Cards, and uses standard Graph REST calls for resource management and meeting creation.

When to use it

  • Send automated alerts or notifications to a channel without complex auth via incoming webhooks.
  • Deliver rich, actionable messages using Adaptive Cards in channel posts.
  • Perform admin or user-level actions (list teams, manage channels, add members) using Microsoft Graph.
  • Create or schedule online meetings and retrieve join links programmatically.
  • Automate recurring reminders, backups, or channel archiving as part of workflows.

Best practices

  • Prefer least-privilege Graph permissions and use delegated or application tokens appropriate to the task.
  • Secure incoming webhook URLs and rotate Graph credentials regularly.
  • Rate-limit requests and implement retries with exponential backoff to handle Graph throttling.
  • Validate and sanitize content before posting; test Adaptive Card JSON with the Adaptive Card designer.
  • Use ISO 8601 datetimes and explicit time zones when scheduling meetings.

Example use cases

  • Post CI/CD build results or production alerts to a team channel using a webhook or Adaptive Card.
  • Automatically create a meeting and post the join link to a channel when a support ticket is escalated.
  • List all channels in a team and archive or clean up unused channels as part of a maintenance job.
  • Add or remove team members in bulk when onboarding or offboarding employees.
  • Send daily reminders or standup prompts to a channel with interactive Adaptive Cards.

FAQ

When should I use a webhook versus Microsoft Graph?

Use incoming webhooks for simple, unauthenticated channel posts and lightweight notifications. Use Microsoft Graph when you need full access to Teams resources, user context, member management, or meeting creation.

What authentication is required for Graph API calls?

Register an Azure AD app and obtain OAuth tokens with the necessary Graph permissions (delegated or application). Protect and rotate these credentials and request only the scopes your automation needs.