Error: 500 post_dm failed with response in a Post Direct Message step for Microsoft Teams

Issue symptoms

When I run an Action Flow that includes a Post Direct Message step for Microsoft Teams, the step fails with the following error:

{

"http_status_code": 500,

"message": "intent: post_dm failed with response: "

}

The Post to Channel step works, but only direct messages fail.

Resolution steps

To send a direct message, the Zendesk MS Teams connector needs to look up the recipient's Microsoft user ID using their email address. It does this by calling the Microsoft Graph API:

GET https://graph.microsoft.com/v1.0/users?$filter=mail eq '{recipient-email}'

This API call requires the User.Read.All application permissions with admin consent granted in the Azure AD (Microsoft Entra ID) tenant. Without it, Microsoft returns a 403 Forbidden response, which surfaces as a 500 error in the Action Flow logs.

Deeper logs show:

h.PostDM()

h.GetUserByEmail()

failed to get user by email: 403 Forbidden

To grant admin consent for the Zendesk MS Teams connector:

Disconnect the existing MS Teams connection in Admin Center

Have a Microsoft 365 Global Administrator open the following URL in a browser to grant admin consent:

https://login.microsoftonline.com/{customer-tenant-id}/adminconsent?client_id=60e3ef2b-554e-4bbc-88f7-88fcb63f6586

Replace {customer-tenant-id} with the organization's Azure AD (Microsoft Entra ID) tenant ID where the MS Teams users exist. To find your tenant ID, see Find your Microsoft Entra tenant ID. The client_id value (60e3ef2b-554e-4bbc-88f7-88fcb63f6586) identifies the Zendesk MS Teams IAP Connector app; do not change this value. Using the tenant ID in the URL grants admin consent for this application to access user data within the organization.

When a consent pop-up appears listing the requested permissions, click Accept to grant admin consent

Reconnect the MS Teams connection in Admin Center

Test the Action Flow again

To verify that the permission was granted:

Go to the Microsoft Entra admin center

Navigate to Identity > Applications > Enterprise applications

Search for the Zendesk connector app (client ID: 60e3ef2b-554e-4bbc-88f7-88fcb63f6586)

Under Permissions, confirm that User.Read.All (Application type) shows as granted

For more details, see Grant tenant-wide admin consent to an application.

Note: The MS Teams connector doesn't support sending a direct message to the same user account used to authenticate the connection. Ensure the DM recipient is a different user than the one who set up the Teams connection in Support.

For more information, see:

Microsoft Graph permissions reference

List users - Microsoft Graph API

Configure the admin consent workflow