← Back to documentation

Microsoft Teams Webhooks

Create a Teams webhook workflow, register it as a relay target, and validate delivery.

6 min read

Use this guide to route endpoint traffic into a Microsoft Teams channel.

Purpose

This workflow helps you:

  • Create a Teams incoming webhook URL.
  • Register Microsoft Teams as a relay target.
  • Attach the target to an endpoint output.
  • Validate with a test delivery.

Prerequisites and permissions

  • Microsoft Teams workspace with access to Workflows / Power Automate, or permission to manage legacy channel connectors.
  • Access to Relay targets and Endpoints in PayloadRelay.

Payload format

PayloadRelay sends Teams deliveries as a MessageCard JSON envelope. This works with legacy Incoming Webhook connector URLs and is accepted by the Teams workflow webhook trigger. For Workflows, the webhook trigger receives the PayloadRelay request; configure the workflow's next step to post the received message/card into the Teams chat or channel.

Code Example
{
  "@type": "MessageCard",
  "@context": "https://schema.org/extensions",
  "themeColor": "0078D4",
  "summary": "PayloadRelay webhook event",
  "title": "PayloadRelay webhook event",
  "text": "```json\n{ ...original payload... }\n```"
}

Microsoft documents a Teams webhook message size limit of 28 KB. PayloadRelay checks the final serialized JSON request body before delivery; if the generated Teams message exceeds that limit, PayloadRelay does not send it and records a failed delivery in the activity log with:

Microsoft Teams message exceeds the supported 28 KB limit.

Teams MessageCard text supports basic Markdown. HTML markup is treated as plain text, so PayloadRelay does not use HTML tags for Teams formatting.

When message templates include the "View in PayloadRelay" link, PayloadRelay sends it as a MessageCard OpenUri action. Legacy Incoming Webhook connector cards render this as an action button. Teams Workflows may accept the action in the request body but ignore the button when posting the message.

Step-by-step workflow

1. Create a webhook URL in Teams

Option A — Workflows / Power Automate (recommended)

  1. In Teams, select Workflows from the Apps section (or go to Power Automate directly).
  2. Create a new flow triggered by When a Teams webhook request is received.
  3. Add a Teams action that posts the received message/card to the target chat or channel.
  4. Copy the HTTP POST URL from the trigger step.

Microsoft notes that Microsoft 365 Connectors are nearing deprecation and recommends Workflows for new webhook integrations.

Option B — Incoming Webhook connector (legacy)

  1. In the target Teams channel, open the channel menu and select Connectors.
  2. Search for Incoming Webhook and click Configure.
  3. Give the connector a name (e.g., "PayloadRelay"), optionally upload an icon, then click Create.
  4. Copy the generated webhook URL (https://<tenant>.webhook.office.com/webhookb2/...).
  5. Click Done.

2. Add a Microsoft Teams relay target

  1. Open Relay targets in PayloadRelay.
  2. Select Add target.
  3. Choose Microsoft Teams as the type.
  4. Paste the webhook URL into the Target value field.
    • Accepted hosts: *.webhook.office.com and *.logic.azure.com (Power Automate).
  5. Optionally add a name and description, then save.

No email confirmation is required — the target is ready immediately.

3. Attach the target to an endpoint

  1. Open the endpoint create/edit page.
  2. In Target destinations, select your Microsoft Teams target.
  3. Save the endpoint.

4. Validate delivery

  1. On the Relay targets page, find your Teams target and select Send test.
  2. A test MessageCard will be sent to the channel.
  3. Confirm the message appears in Teams.

Retry behavior

Failed deliveries use PayloadRelay's standard automatic retry schedule capped by your plan. Microsoft Teams may rate-limit sustained bursts; if that happens, reduce delivery frequency or let retries recover temporary failures.

PayloadRelay does not retry messages that exceed the Teams 28 KB message size limit because Teams will reject them until the generated message is made smaller. Use a message template with shorter fields or add routing/transformation rules that reduce the data sent to Teams.

Troubleshooting

SymptomLikely causeFix
400 Bad RequestMalformed MessageCard JSONCheck the activity log for size or formatting errors.
Activity log says the message exceeds 28 KBGenerated MessageCard is larger than Teams supportsShorten the message template or reduce the payload fields delivered to Teams.
404 Not FoundWebhook URL was deleted in TeamsRecreate the connector and update the target URL.
429 Too Many RequestsTeams rate limitRetries are automatic; reduce delivery frequency if the problem persists.
Message not appearingBot was removed from the channelRe-add the Incoming Webhook connector to the channel.

Microsoft references