简介
基于Microsoft官方Graph API与Webhook技术的企业级Teams自动化方案,支持消息推送、频道管理与会议创建,助力团队实现高效协同与workflow自动化。
原始描述
Microsoft Teams API integration with managed OAuth. Manage teams, channels, messages, and meetings via Microsoft Graph API. Use this skill when users want to...
通过你的 Agent 添加
安装目录:microsoft-teams/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Microsoft Teams Skill 提供了三层级的企业协作自动化能力。基础层通过 Incoming Webhook 实现零认证的消息推送,仅需配置 TEAMS_WEBHOOK_URL 环境变量即可向指定频道发送文本通知或 Adaptive Card 富媒体卡片,适合告警通知、CI/CD 状态播报等场景。进阶层利用 Microsoft Graph API 实现全功能管理,包括获取用户加入的团队列表、枚举频道、发送富文本消息、创建在线会议等,需配合 Azure AD 应用注册获取 TEAMS_ACCESS_TOKEN 访问令牌。
显著优点
该 Skill 的最大优势在于架构的渐进性——用户可从最简单的 Webhook 开始,逐步迁移到完整的 Graph API 集成,无需重构现有工作流。作为纯文档型资产,它零代码侵入,仅提供经过验证的 curl 命令示例,避免了执行不可信脚本的安全风险。所有敏感配置均通过环境变量管理,符合十二要素应用规范。此外,直接调用 Microsoft 官方 API 确保了功能的前瞻性和兼容性,Adaptive Card 支持让消息呈现具备丰富的交互能力。
潜在缺点与局限性
首先,配置门槛差异大:Webhook 虽简单但功能受限,Graph API 功能强大却需要 Azure AD 管理员权限和复杂的 OAuth 流程,对非企业用户不够友好。其次,来源可信度为 T3 级(个人开发者维护),缺乏 Microsoft 官方背书,长期维护存在不确定性。功能上,该 Skill 仅提供 API 调用示例,不包含错误重试、令牌刷新、速率限制处理等生产级特性,需要用户自行封装。此外,必须依赖 Microsoft 365 商业订阅和公网访问能力,内网环境或免费版 Teams 用户无法使用。
适合的目标群体
本 Skill 主要面向三类用户:企业 DevOps 工程师(用于构建部署通知流水线)、IT 系统管理员(自动化频道管理和会议创建)、以及集成开发者(将 Teams 能力嵌入现有业务系统)。特别适合已采用 Microsoft 365 生态的中大型企业,或需要将监控告警、审批流程与 Teams 集成的技术团队。
使用风险与注意事项
凭据泄露风险是首要关注点:Webhook URL 一旦泄露,攻击者可向频道发送钓鱼信息;Graph API 的 Access Token 泄露则可能导致整个组织的数据暴露。建议严格遵循最小权限原则,定期轮换令牌,并将环境变量排除在版本控制外。网络依赖性方面,所有功能均需要稳定访问 Microsoft 云服务,跨国企业需注意网络延迟和合规性要求。此外,由于作者为个人开发者,建议在使用前审计代码示例,并准备替代方案以防 Skill 停止维护。
技能正文
name: microsoft-teams
description: |
Microsoft Teams API integration with managed OAuth. Manage teams, channels, messages, and meetings via Microsoft Graph API.
Use this skill when users want to list teams, create channels, send messages, schedule meetings, or access meeting recordings and transcripts.
For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
compatibility: Requires network access and valid Maton API key
metadata:
author: maton
version: "1.0"
clawdbot:
emoji: 🧠
homepage: "https://maton.ai"
requires:
env:
- MATON_API_KEY
Microsoft Teams
Access the Microsoft Teams API with managed OAuth authentication via Microsoft Graph. Manage teams, channels, messages, meetings, and access recordings and transcripts.
Quick Start
# List user's joined teams
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/microsoft-teams/v1.0/me/joinedTeams')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Base URL
https://gateway.maton.ai/microsoft-teams/{native-api-path}
# List user's joined teams
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/microsoft-teams/v1.0/me/joinedTeams')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
https://gateway.maton.ai/microsoft-teams/{native-api-path}
Replace {native-api-path} with the actual Microsoft Graph API endpoint path. The gateway proxies requests to graph.microsoft.com and automatically injects your OAuth token.
Authentication
All requests require the Maton API key in the Authorization header:
Authorization: Bearer $MATON_API_KEY
Environment Variable: Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Getting Your API Key
- Sign in or create an account at maton.ai
- Go to maton.ai/settings
- Copy your API key
Connection Management
Manage your Microsoft Teams OAuth connections at https://ctrl.maton.ai.
List Connections
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=microsoft-teams&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Create Connection
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'microsoft-teams'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=microsoft-teams&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'microsoft-teams'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"connection": {
"connection_id": "fb0fdc4a-0b5a-40cf-8b92-3bdae848cde3",
"status": "ACTIVE",
"creation_time": "2026-02-17T09:51:21.074601Z",
"last_updated_time": "2026-02-17T09:51:34.323814Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "microsoft-teams",
"metadata": {}
}
}
Open the returned url in a browser to complete OAuth authorization.
Delete Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Specifying Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple Microsoft Teams connections, specify which one to use with the Maton-Connection header:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/microsoft-teams/v1.0/me/joinedTeams')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', 'fb0fdc4a-0b5a-40cf-8b92-3bdae848cde3')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If omitted, the gateway uses the default (oldest) active connection.
API Reference
Teams
List Joined Teams
GET /microsoft-teams/v1.0/me/joinedTeams
GET /microsoft-teams/v1.0/me/joinedTeams
Response:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams",
"@odata.count": 1,
"value": [
{
"id": "b643f103-870d-4f98-a23d-e6f164fae33e",
"displayName": "carvedai.com",
"description": null,
"isArchived": false,
"tenantId": "cb83c3f9-6d16-4cf3-bd8c-ab16b37932f9"
}
]
}
Get Team
GET /microsoft-teams/v1.0/teams/{team-id}
Channels
List Channels
GET /microsoft-teams/v1.0/teams/{team-id}/channels
GET /microsoft-teams/v1.0/teams/{team-id}
List Channels
GET /microsoft-teams/v1.0/teams/{team-id}/channels
Response:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('...')/channels",
"@odata.count": 1,
"value": [
{
"id": "19:9fwtZjo3IM0D8bLdQqR-_oMFw1eUDlzWjPfIhNGhVd41@thread.tacv2",
"createdDateTime": "2026-02-16T20:09:27.254Z",
"displayName": "General",
"description": null,
"email": "carvedai.com473@carvedai.com",
"membershipType": "standard",
"isArchived": false
}
]
}
List Private Channels
GET /microsoft-teams/v1.0/teams/{team-id}/channels?$filter=membershipType eq 'private'
Get Channel
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
Create Channel
POST /microsoft-teams/v1.0/teams/{team-id}/channels
Content-Type: application/json
{
"displayName": "New Channel",
"description": "Channel description",
"membershipType": "standard"
}
GET /microsoft-teams/v1.0/teams/{team-id}/channels?$filter=membershipType eq 'private'
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
Create Channel
POST /microsoft-teams/v1.0/teams/{team-id}/channels
Content-Type: application/json
{
"displayName": "New Channel",
"description": "Channel description",
"membershipType": "standard"
}
POST /microsoft-teams/v1.0/teams/{team-id}/channels
Content-Type: application/json
{
"displayName": "New Channel",
"description": "Channel description",
"membershipType": "standard"
}
Response:
{
"id": "19:3b3361df822044558a062bb1a4ac8357@thread.tacv2",
"createdDateTime": "2026-02-17T20:24:33.9284462Z",
"displayName": "Maton Test Channel",
"description": "Channel created by Maton integration test",
"membershipType": "standard",
"isArchived": false
}
Update Channel
PATCH /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
Content-Type: application/json
{
"description": "Updated description"
}
PATCH /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
Content-Type: application/json
{
"description": "Updated description"
}
Returns 204 No Content on success. Note: The default "General" channel cannot be updated.
Delete Channel
DELETE /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
DELETE /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}
Returns 204 No Content on success.
Channel Members
List Channel Members
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/members
Response:
{
"@odata.count": 1,
"value": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"id": "MCMjMiMj...",
"roles": ["owner"],
"displayName": "Kevin Kim",
"userId": "5f56d55b-2ffb-448d-982a-b52547431f71",
"email": "richard@carvedai.com"
}
]
}
Messages
List Channel Messages
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages
Send Message to Channel
POST /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages
Content-Type: application/json
{
"body": {
"content": "Hello World"
}
}
POST /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages
Content-Type: application/json
{
"body": {
"content": "Hello World"
}
}
Response:
{
"id": "1771359569239",
"replyToId": null,
"messageType": "message",
"createdDateTime": "2026-02-17T20:19:29.239Z",
"importance": "normal",
"locale": "en-us",
"from": {
"user": {
"id": "5f56d55b-2ffb-448d-982a-b52547431f71",
"displayName": "Kevin Kim",
"userIdentityType": "aadUser",
"tenantId": "cb83c3f9-6d16-4cf3-bd8c-ab16b37932f9"
}
},
"body": {
"contentType": "text",
"content": "Hello World"
},
"channelIdentity": {
"teamId": "b643f103-870d-4f98-a23d-e6f164fae33e",
"channelId": "19:9fwtZjo3IM0D8bLdQqR-_oMFw1eUDlzWjPfIhNGhVd41@thread.tacv2"
}
}
Send HTML Message
POST /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages
Content-Type: application/json
{
"body": {
"contentType": "html",
"content": "<h1>Hello</h1><p>This is <strong>formatted</strong> content.</p>"
}
}
Reply to Message
POST /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages/{message-id}/replies
Content-Type: application/json
{
"body": {
"content": "This is a reply"
}
}
List Message Replies
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages/{message-id}/replies
Edit Message
PATCH /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages/{message-id}
Content-Type: application/json
{
"body": {
"content": "Updated message content"
}
}
POST /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages
Content-Type: application/json
{
"body": {
"contentType": "html",
"content": "<h1>Hello</h1><p>This is <strong>formatted</strong> content.</p>"
}
}
POST /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages/{message-id}/replies
Content-Type: application/json
{
"body": {
"content": "This is a reply"
}
}
List Message Replies
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages/{message-id}/replies
Edit Message
PATCH /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages/{message-id}
Content-Type: application/json
{
"body": {
"content": "Updated message content"
}
}
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages/{message-id}/replies
PATCH /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/messages/{message-id}
Content-Type: application/json
{
"body": {
"content": "Updated message content"
}
}
Returns 204 No Content on success.
Team Members
List Team Members
GET /microsoft-teams/v1.0/teams/{team-id}/members
Response:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('...')/members",
"@odata.count": 1,
"value": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"id": "MCMjMSMj...",
"roles": ["owner"],
"displayName": "Kevin Kim",
"userId": "5f56d55b-2ffb-448d-982a-b52547431f71",
"email": "richard@carvedai.com",
"tenantId": "cb83c3f9-6d16-4cf3-bd8c-ab16b37932f9"
}
]
}
Presence
Get User Presence
GET /microsoft-teams/v1.0/me/presence
Response:
{
"id": "5f56d55b-2ffb-448d-982a-b52547431f71",
"availability": "Offline",
"activity": "Offline",
"outOfOfficeSettings": {
"message": null,
"isOutOfOffice": false
}
}
Availability values: Available, Busy, DoNotDisturb, Away, Offline
Get User Presence by ID
GET /microsoft-teams/v1.0/users/{user-id}/presence
GET /microsoft-teams/v1.0/users/{user-id}/presence
Returns presence information for a specific user by their ID.
Tabs
List Channel Tabs
GET /microsoft-teams/v1.0/teams/{team-id}/channels/{channel-id}/tabs
Response:
{
"@odata.count": 2,
"value": [
{
"id": "ee0b3e8b-dfc8-4945-a45d-28ceaf787d92",
"displayName": "Notes",
"webUrl": "https://teams.microsoft.com/l/entity/..."
},
{
"id": "3ed5b337-c2c9-4d5d-b7b4-84ff09a8fc1c",
"displayName": "Files",
"webUrl": "https://teams.microsoft.com/l/entity/..."
}
]
}
Apps
List Installed Apps
GET /microsoft-teams/v1.0/teams/{team-id}/installedApps
Online Meetings
Create Meeting
POST /microsoft-teams/v1.0/me/onlineMeetings
Content-Type: application/json
{
"subject": "Team Sync",
"startDateTime": "2026-02-18T10:00:00Z",
"endDateTime": "2026-02-18T11:00:00Z"
}
Response:
{
"id": "MSo1ZjU2ZDU1Yi0yZmZi...",
"subject": "Team Sync",
"startDateTime": "2026-02-18T10:00:00Z",
"endDateTime": "2026-02-18T11:00:00Z",
"joinUrl": "https://teams.microsoft.com/l/meetup-join/...",
"joinWebUrl": "https://teams.microsoft.com/l/meetup-join/...",
"meetingCode": "28636743235745",
"joinMeetingIdSettings": {
"joinMeetingId": "28636743235745",
"passcode": "qh37NK9V",
"isPasscodeRequired": true
},
"participants": {
"organizer": {
"upn": "richard@carvedai.com",
"role": "presenter"
}
}
}
The joinUrl can be shared with attendees to join the meeting.
Get Meeting
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}
Find Meeting by Join URL
GET /microsoft-teams/v1.0/me/onlineMeetings?$filter=JoinWebUrl eq '{encoded-join-url}'
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}
GET /microsoft-teams/v1.0/me/onlineMeetings?$filter=JoinWebUrl eq '{encoded-join-url}'
Note: Microsoft Graph requires a filter to query meetings. You cannot list all meetings without filtering by JoinWebUrl.
List Calendar Events (includes scheduled meetings)
GET /microsoft-teams/v1.0/me/calendar/events?$top=10
GET /microsoft-teams/v1.0/me/calendar/events?$top=10
Scheduled Teams meetings appear as calendar events with isOnlineMeeting: true.
Delete Meeting
DELETE /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}
DELETE /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}
Returns 204 No Content on success.
Create Meeting with Attendees
POST /microsoft-teams/v1.0/me/onlineMeetings
Content-Type: application/json
{
"subject": "Project Review",
"startDateTime": "2026-02-18T14:00:00Z",
"endDateTime": "2026-02-18T15:00:00Z",
"participants": {
"attendees": [
{
"upn": "attendee@example.com",
"role": "attendee"
}
]
}
}
List Meeting Recordings
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/recordings
POST /microsoft-teams/v1.0/me/onlineMeetings
Content-Type: application/json
{
"subject": "Project Review",
"startDateTime": "2026-02-18T14:00:00Z",
"endDateTime": "2026-02-18T15:00:00Z",
"participants": {
"attendees": [
{
"upn": "attendee@example.com",
"role": "attendee"
}
]
}
}
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/recordings
Returns a list of recordings for a meeting (available after the meeting has ended and recording was enabled).
Get Meeting Recording
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/recordings/{recording-id}
List Meeting Transcripts
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/transcripts
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/recordings/{recording-id}
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/transcripts
Returns a list of transcripts for a meeting (available after the meeting has ended and transcription was enabled).
Get Meeting Transcript
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/transcripts/{transcript-id}
List Attendance Reports
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/attendanceReports
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/transcripts/{transcript-id}
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/attendanceReports
Returns attendance reports for a meeting (available after the meeting has ended).
Get Attendance Report
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/attendanceReports/{report-id}
Chats
List User Chats
GET /microsoft-teams/v1.0/me/chats
Get Chat
GET /microsoft-teams/v1.0/chats/{chat-id}
List Chat Messages
GET /microsoft-teams/v1.0/chats/{chat-id}/messages
Send Chat Message
POST /microsoft-teams/v1.0/chats/{chat-id}/messages
Content-Type: application/json
{
"body": {
"content": "Hello in chat"
}
}
Pagination
GET /microsoft-teams/v1.0/me/onlineMeetings/{meeting-id}/attendanceReports/{report-id}
List User Chats
GET /microsoft-teams/v1.0/me/chats
GET /microsoft-teams/v1.0/chats/{chat-id}
List Chat Messages
GET /microsoft-teams/v1.0/chats/{chat-id}/messages
Send Chat Message
POST /microsoft-teams/v1.0/chats/{chat-id}/messages
Content-Type: application/json
{
"body": {
"content": "Hello in chat"
}
}
Pagination
GET /microsoft-teams/v1.0/chats/{chat-id}/messages
POST /microsoft-teams/v1.0/chats/{chat-id}/messages
Content-Type: application/json
{
"body": {
"content": "Hello in chat"
}
}
Pagination
Microsoft Graph uses OData-style pagination with @odata.nextLink:
GET /microsoft-teams/v1.0/me/joinedTeams?$top=10
Response includes pagination link when more results exist:
{
"value": [...],
"@odata.nextLink": "https://graph.microsoft.com/v1.0/me/joinedTeams?$skiptoken=..."
}
Use the $top parameter to limit results per page.
OData Query Parameters
$top=10 - Limit results
$skip=20 - Skip results
$select=id,displayName - Select specific fields
$filter=membershipType eq 'private' - Filter results
$orderby=displayName - Sort results
Code Examples
JavaScript
const response = await fetch(
'https://gateway.maton.ai/microsoft-teams/v1.0/me/joinedTeams',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const data = await response.json();
Python
$top=10 - Limit results$skip=20 - Skip results$select=id,displayName - Select specific fields$filter=membershipType eq 'private' - Filter results$orderby=displayName - Sort resultsJavaScript
const response = await fetch(
'https://gateway.maton.ai/microsoft-teams/v1.0/me/joinedTeams',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const data = await response.json();
import os
import requests
response = requests.get(
"https://gateway.maton.ai/microsoft-teams/v1.0/me/joinedTeams",
headers={"Authorization": f"Bearer {os.environ['MATON_API_KEY']}"},
)
data = response.json()
Send Message Example (Python)
import os
import requests
team_id = "your-team-id"
channel_id = "your-channel-id"
response = requests.post(
f"https://gateway.maton.ai/microsoft-teams/v1.0/teams/{team_id}/channels/{channel_id}/messages",
headers={
"Authorization": f"Bearer {os.environ['MATON_API_KEY']}",
"Content-Type": "application/json",
},
json={"body": {"content": "Hello from Maton!"}},
)
data = response.json()
Notes
- Uses Microsoft Graph API v1.0
- Messages are sent as the authenticated user (not as a bot) - the
from.user field shows the actual user identity
- Team IDs are GUIDs (e.g.,
b643f103-870d-4f98-a23d-e6f164fae33e)
- Channel IDs include thread suffix (e.g.,
19:9fwtZjo3IM0D8bLdQqR-_oMFw1eUDlzWjPfIhNGhVd41@thread.tacv2)
- Message IDs are timestamps (e.g.,
1771359569239)
- Message body content types:
text (default) or html
- Channel membership types:
standard, private, shared
- The default "General" channel cannot be updated or deleted
- Only
me endpoint is supported for listing joined teams (not arbitrary user IDs)
- IMPORTANT: When using curl commands, use
curl -g when URLs contain brackets to disable glob parsing
- IMPORTANT: When piping curl output to
jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Missing Microsoft Teams connection or invalid request
401
Invalid or missing Maton API key
403
Insufficient permissions for the requested resource
404
Team, channel, or message not found
429
Rate limited (Microsoft Graph throttling)
4xx/5xx
Passthrough error from Microsoft Graph API
Resources
import os
import requests
team_id = "your-team-id"
channel_id = "your-channel-id"
response = requests.post(
f"https://gateway.maton.ai/microsoft-teams/v1.0/teams/{team_id}/channels/{channel_id}/messages",
headers={
"Authorization": f"Bearer {os.environ['MATON_API_KEY']}",
"Content-Type": "application/json",
},
json={"body": {"content": "Hello from Maton!"}},
)
data = response.json()
- Uses Microsoft Graph API v1.0
- Messages are sent as the authenticated user (not as a bot) - the
from.userfield shows the actual user identity - Team IDs are GUIDs (e.g.,
b643f103-870d-4f98-a23d-e6f164fae33e) - Channel IDs include thread suffix (e.g.,
19:9fwtZjo3IM0D8bLdQqR-_oMFw1eUDlzWjPfIhNGhVd41@thread.tacv2) - Message IDs are timestamps (e.g.,
1771359569239) - Message body content types:
text(default) orhtml - Channel membership types:
standard,private,shared - The default "General" channel cannot be updated or deleted
- Only
meendpoint is supported for listing joined teams (not arbitrary user IDs) - IMPORTANT: When using curl commands, use
curl -gwhen URLs contain brackets to disable glob parsing - IMPORTANT: When piping curl output to
jqor other commands, environment variables like$MATON_API_KEYmay not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Missing Microsoft Teams connection or invalid request
401
Invalid or missing Maton API key
403
Insufficient permissions for the requested resource
404
Team, channel, or message not found
429
Rate limited (Microsoft Graph throttling)
4xx/5xx
Passthrough error from Microsoft Graph API
Resources
| Status | Meaning |
|---|---|
| 400 | Missing Microsoft Teams connection or invalid request |
| 401 | Invalid or missing Maton API key |
| 403 | Insufficient permissions for the requested resource |
| 404 | Team, channel, or message not found |
| 429 | Rate limited (Microsoft Graph throttling) |
| 4xx/5xx | Passthrough error from Microsoft Graph API |