‎n8n microsoft teams node can't create a message in a teams channel‎ through Graph API

Sérgio Domingues 0 Reputation points
2025-02-25T10:25:41.15+00:00

I created a app registration with my microsoft 365 licenced user and granted the necessary permissions with the tenant admin user. In n8n I'm using "microsoft teams create message in channel" node to create a message in a specific channel but I get the error: 403 "errorMessage": "Failed to get license information for the user. Ensure user has a valid Office365 license assigned to.

Note that:

  • The user does have a microsoft 365 licence
  • I did create an app secret and provided to the n8n authentication credential
  • The n8n connection to the microsof account succeeds
  • If I query https://graph.microsoft.com/v1.0/me/licenseDetails in the microsoft graph explorer, if returns a 200 OK code with the licence details
  • The app created in azure portal does have the necessary permissions

Here's the full error log:

{

"errorMessage": "Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them.",

"errorDetails": {

"rawErrorMessage": [

  "Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them."

],

"httpCode": "403"

},

"n8nDetails": {

"nodeName": "Microsoft Teams1",

"nodeType": "n8n-nodes-base.microsoftTeams",

"nodeVersion": 2,

"resource": "channelMessage",

"operation": "create",

"time": "25/02/2025, 09:22:29",

"n8nVersion": "1.79.3 (Self Hosted)",

"binaryDataMode": "default",

"stackTrace": [

  "NodeApiError: Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them.",

  "    at ExecuteContext.microsoftApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Teams/v2/transport/index.js:37:15)",

  "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",

  "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Teams/v2/actions/channelMessage/create.operation.js:89:16)",

  "    at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Teams/v2/actions/router.js:69:36)",

  "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Teams/v2/MicrosoftTeamsV2.node.js:19:16)",

  "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:627:19)",

  "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:878:51",

  "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1211:20"

]

}

}

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-02-26T01:49:02.3733333+00:00

    Hello Sérgio Domingues,

    Thank you for reaching out to Microsoft Support!

    According to the error information, you are advised to check that the user has a valid Microsoft 365 license in Azure AD and confirm whether the license is activated, as shown in the following figure:

    User's image

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.