| name | teams |
| description | Use when: building or debugging Microsoft Teams connector flows in a Power Apps Code App, including teams, channels, chats, mentions, tags, notifications, cards, meetings, transcripts, recordings, schedules, or the Teams HttpRequest helper. |
Microsoft Teams Connector Guide
Use this skill when an app needs Microsoft Teams data or actions through the generated Teams wrapper.
Do not use CLI setup commands from chat for Teams setup. Use the built-in Auth, Sync Connections, and Deploy buttons instead.
Core Rule
The repo-local source of truth is codeApp/dist/connectors/teams.js.
Important updates from the current generated wrapper:
- the wrapper is autogenerated and exports a large PascalCase helper surface, plus
MicrosoftTeamsService as the default export
- the runtime data-source name is fixed to
teams
- calls go through
getClient(dataSourcesInfo) and client.executeAsync(...)
- errors are normalized to
Connector <operationName> failed: ...
- there is no public
callTeamsOperation(...) helper in the generated file
- there are no handwritten alias retries such as
Teams, microsoftteams, or MicrosoftTeams
Treat the named exports that actually exist in teams.js as the public contract. Do not invent friendly wrapper names.
First Questions To Ask
Ask only what is needed to choose the correct helper and write working code:
- Is the app working with Teams, channels, chats, notifications, adaptive cards, tags, meetings, recordings, transcripts, or schedules?
- Do you already have the required identifiers such as
teamId, groupId, channelId, chatId, messageId, meetingId, or tagId?
- Are you posting to a channel, a chat, a conversation location object, or to yourself?
- Do you need a dedicated helper or only the generic
HttpRequest(...) escape hatch?
- Does the current
power.config.json already expose a Teams connection whose dataSources array contains teams?
- Are you building UI actions only, or do you also need webhook or subscription helpers?
power.config.json
Always read the current power.config.json before editing it.
Prefer a connection reference whose exposed data source is teams.
{
"connectionReferences": {
"teams": {
"id": "/providers/Microsoft.PowerApps/apis/shared_teams",
"displayName": "Microsoft Teams",
"dataSources": ["teams"]
}
}
}
Rules for editing power.config.json:
- preserve existing connection metadata such as
sharedConnectionId, authenticationType, and working environment-specific keys
- the top-level connection-reference key does not need to be literally
teams, but the runtime-exposed data source should still be teams
- do not change the wrapper to chase alternate connector names; the generated code uses
tableName: 'teams'
Core App Rules
- In app code, import exact generated helpers from the local Teams wrapper output, typically
./connectors/teams.js.
- Use the generated PascalCase export names exactly as defined.
- Keep request payloads as plain objects for helpers that take
body, item, request, or other object inputs.
- Do not assume every team-scoped helper uses
teamId; many channel and tag helpers use groupId.
- Prefer dedicated helpers over
HttpRequest(...) when the wrapper already exposes the operation.
- Surface connector error messages directly in the UI instead of swallowing them.
- Do not document or call old handwritten helpers such as
listTeams(...), listChannels(...), getUserMentionToken(...), sendTeamsGraphHttpRequest(...), or callTeamsOperation(...).
Public Helper Surface
The generated wrapper exports named helpers plus MicrosoftTeamsService. The highest-value operations are grouped below.
Team And Channel Helpers
GetAllTeams()
GetTeam(teamId)
GetTeamwork()
CreateATeam(body)
GetTeamsAsyncResult()
CreateChannel(body, groupId)
GetChannel(groupId, channelId)
ArchiveChannel(groupId, channelId, body)
GetMessagesFromChannel(groupId, channelId)
ListRepliesToMessage(groupId, channelId, messageId, $top)
PostMessageToChannel(body, groupId, channelId)
PostMessageToChannelV2(body, groupId, channelId)
PostMessageToChannelV3(body, groupId, channelId)
PostReplyToMessage(body, groupId, channelId, messageId)
PostReplyToMessageV2(body, groupId, channelId, messageId)
Chat And Conversation Helpers
GetChats(chatType, topic)
CreateChat(item)
GetMessagesFromChat(chatId, $filter, $orderby, $top)
PostMessageToSelf(body)
PostMessageToConversation(body, poster, location, customizationModifiedTime)
ReplyWithMessageToConversation(body, poster, location, customizationModifiedTime)
PostCardToConversation(body, poster, location, customizationModifiedTime)
PostCardAndWaitForResponse(body, poster, location, customizationModifiedTime)
ReplyWithCardToConversation(body, poster, location, customizationModifiedTime)
UpdateCardInConversation(body, poster, location, customizationModifiedTime)
GetMessageLocations(messageType, poster)
Membership And Mention Helpers
ListTeamMembers(teamId, $filter, $top)
AddMemberToTeam(body, teamId)
RemoveMemberFromTeam(membershipId, teamId)
AddMemberToChannel(body, groupId, channelId)
RemoveMemberFromChannel(membershipId, groupId, channelId)
AddMemberToChat(body, chatId)
ListMembers(body, threadType, $filter)
AtMentionUser(userId)
AtMentionTag(groupId, tagId)
AtMentionBot(botMention)
Notification And Adaptive Card Helpers
PostFeedNotification(body, poster, notificationType)
PostUserNotification(PostNotificationRequest)
PostChannelNotification(PostNotificationRequest, groupId)
PostUserAdaptiveCard(PostAdaptiveCardRequest)
PostChannelAdaptiveCard(PostAdaptiveCardRequest, groupId)
GetUnifiedActionSchema(actionType, poster, recipientType)
GetPostToConversationResponseSchema(actionType, poster, recipientType)
GetAdaptiveCardInputMetadata(recipientType)
GetNotificationInputMetadata(recipientType)
GetFeedNotificationInputSchema(poster, notificationType)
GetVirtualAgentBots()
Meeting, Transcript, Recording, And Insight Helpers
CreateTeamsMeeting(calendarid, item)
GetSupportedTimeZones()
GetOnlineMeeting(lookupType, lookupValue)
ListMeetingTranscripts(meetingId)
GetMeetingTranscript(meetingId, transcriptId)
GetMeetingTranscriptContent(meetingId, transcriptId)
ListMeetingRecordings(meetingId)
GetMeetingRecording(meetingId, recordingId)
GetMeetingRecordingContent(meetingId, recordingId)
ListCallRecordings(callId)
GetCallRecording(callId, recordingId)
GetCallRecordingContent(callId, recordingId)
ListCallTranscripts(callId)
GetCallTranscript(callId, transcriptId)
GetCallTranscriptContent(callId, transcriptId)
GetAllAdhocCallRecordings(startDateTime, endDateTime, $top, $skiptoken, $deltatoken)
GetAllAdhocCallTranscripts(startDateTime, endDateTime, $top, $skiptoken, $deltatoken)
ListAiInsights(meetingId)
GetAiInsight(meetingId, aiInsightId)
Tag, Section, And Schedule Helpers
GetTags(groupId)
CreateTag(body, groupId)
GetTag(groupId, tagId)
UpdateTag(body, groupId, tagId)
DeleteTag(groupId, tagId)
AddMemberToTag(body, groupId, tagId)
GetTagMembers(groupId, tagId)
DeleteTagMember(tagMemberId, groupId, tagId)
ListSections()
CreateSection(body, IfMatch)
GetSection(sectionId)
UpdateSection(body, sectionId, IfMatch)
DeleteSection(sectionId, IfMatch)
ListSectionItems(sectionId)
AddSectionItem(body, sectionId, IfMatch)
RemoveSectionItem(sectionId, sectionItemId, IfMatch)
MoveSectionItem(body, sectionId, sectionItemId, IfMatch)
ListTimeOffReasons(teamId, $top)
GetShift(shiftId, teamId)
DeleteShift(shiftId, teamId)
CreateOpenShift(request, teamId)
GetOpenShift(openShiftId, teamId)
UpdateOpenShift(openShiftId, request, teamId)
DeleteOpenShift(openShiftId, teamId)
GetSchedulingGroup(schedulingGroupId, teamId)
GetSchedule(teamId)
Trigger, Subscription, And Agent Helpers
OnNewChannelMessage(groupId, channelId, $top)
OnNewChannelMessageMentioningMe(groupId, channelId, $top)
WebhookAtMentionTrigger(threadType, requestBody)
WebhookMessageReactionTrigger(reactionKey, frequency, runningPolicy, threadType, requestBody)
WebhookChatMessageTrigger(ChatMessageSubscriptionRequest)
WebhookKeywordTrigger($search, threadType, requestBody)
WebhookNewMessageTrigger(threadType, requestBody)
CallEventTrigger(scopeType, body)
TranscriptTrigger(scopeType, body)
RecordingTrigger(scopeType, body)
DeleteWorkflowsMiddleTierSubscriptions(subscriptionIds)
RenewWorkflowsMiddleTierSubscriptions(subscriptionIds, renewEncryptionCert, body)
DeleteWorkflowSubscription(subscriptionIds)
RenewWorkflowSubscription(subscriptionIds, renewEncryptionCert, body)
DeleteWebHookSubscription(subscriptionIds)
RenewWebHookSubscription(subscriptionIds, body)
SubscribeUserMessageWithOptions(UserMessageWithOptionsSubscriptionRequest)
SubscribeUserFlowContinuation(UserFlowContinuationSubscriptionRequest)
SubscribeChannelFlowContinuation(ChannelFlowContinuationSubscriptionRequest, groupId)
UnsubscribeMessageWithOptions(subscriptionId, recipientType)
UnsubscribeFlowContinuation(subscriptionId, recipientType)
InvokeChannelAgent(input)
GetChannelAgentOperation(operationId)
WebhookResponse()
WebhookLifecycleNotification()
Metadata And Schema Helpers
GetMessageDetails(body, messageId, threadType)
GetMessageDetailsInputSchema(threadType)
GetMessageDetailsResponseSchema(threadType)
ListMembersInputSchema(threadType)
GetWebhookTriggerRequestSchema(threadType)
GetWebhookTriggerResponseSchema(triggerType, threadType)
GetSubscriptionScopeSchema(scopeType)
GetMessageWithOptionsInputMetadata(recipientType)
GetFlowContinuationInputMetadata(recipientType)
GetMessageWithOptionsSubscriptionInputMetadata(recipientType)
GetFlowContinuationSubscriptionInputMetadata(recipientType)
GetMessageWithOptionsSubscriptionOutputMetadata(recipientType)
GetFlowContinuationSubscriptionOutputMetadata(body, recipientType)
GetFlowContinuationSubscriptionWithPosterOutputMetadata(body, poster, recipientType)
GetSelectedMessageTriggerOutputsMetadata(body)
GetComposeMessageTriggerOutputsMetadata(body)
GetCardResponseTriggerOutputsMetadata(body)
Important Wrapper Behavior
- The wrapper sends all operations with
tableName: 'teams'. If power.config.json exposes a different data-source name, calls will fail before reaching Teams.
- The wrapper returns
result.data when present, otherwise the raw result object.
- The wrapper normalizes many error shapes and throws
Connector <operationName> failed: ....
- The generated file exports
MicrosoftTeamsService and named helpers. Prefer direct named imports for app code.
- Not every schema operation is necessarily surfaced as a generated helper. If an operation appears in connector metadata but not as an export, do not document it as callable until the generated file exposes it.
PostFeedNotification(...) is now a direct helper with explicit body, poster, and notificationType arguments. It does not choose between channel and user notifications for you.
- Mention helpers are now
AtMentionUser(...), AtMentionTag(...), and AtMentionBot(...), not the old token-wrapper names.
- Many write operations place the payload object first, followed by ids. Follow the exact parameter order from the generated helper.
Recommended Usage Patterns
Team Discovery And Posting
import {
GetAllTeams,
GetMessagesFromChannel,
PostMessageToChannelV3,
} from './connectors/teams.js';
const oTeams = await GetAllTeams();
const aMessages = await GetMessagesFromChannel(groupId, channelId);
await PostMessageToChannelV3({
body: {
contentType: 'html',
content: '<p>Hello from Code App</p>',
},
}, groupId, channelId);
Chat And Member Management
import {
CreateChat,
GetMessagesFromChat,
AddMemberToChat,
} from './connectors/teams.js';
const oChat = await CreateChat({
chatType: 'group',
members: aMembers,
});
const aChatMessages = await GetMessagesFromChat(oChat.id, undefined, undefined, 50);
await AddMemberToChat({
'@odata.type': '#microsoft.graph.aadUserConversationMember',
roles: [],
'user@odata.bind': sUserBind,
}, oChat.id);
Mentions, Cards, And Notifications
import {
AtMentionUser,
PostCardToConversation,
PostChannelNotification,
} from './connectors/teams.js';
const oMention = await AtMentionUser(userId);
await PostCardToConversation(cardBody, poster, location, customizationModifiedTime);
await PostChannelNotification(notificationBody, groupId);
HttpRequest
The generated wrapper exposes the connector escape hatch directly as:
HttpRequest(Uri, Method, Body, ContentType, CustomHeader1, CustomHeader2, CustomHeader3, CustomHeader4, CustomHeader5)
Rules:
- use
HttpRequest(...) only when no dedicated Teams helper already exists
- pass connector-style positional arguments, not a fetch-style options object
- this still runs through the Teams connector
HttpRequest action, not a direct browser fetch
Debugging Checklist
- If app code imports old camelCase helper names, replace them with the exact generated PascalCase exports.
- If a team or channel operation fails, verify whether the helper expects
teamId or groupId.
- If a write operation fails, confirm the payload is a plain object and is passed in the documented argument position.
- If connection lookup fails, confirm
power.config.json exposes teams in the connection reference dataSources array.
- If
HttpRequest(...) fails, confirm you are passing positional connector arguments and not an options object.
- If you need an operation that appears in the metadata block but not in the generated exports, do not invent a
callTeamsOperation(...) helper in app code. Regenerate or extend the wrapper deliberately.
- Show the wrapped connector error text directly in the UI so users can see the underlying Teams failure.
Summary Rules
- Treat
codeApp/dist/connectors/teams.js as the source of truth for this repo.
- Use the exact generated PascalCase exports.
- Keep the Teams data-source name aligned to
teams in power.config.json.
- Prefer dedicated helpers over
HttpRequest(...).
- Follow exact parameter order from the generated wrapper, especially for
body-first write operations.
- Surface
Connector <operationName> failed: ... errors directly.