I am trying to pass the email body and subject to a published MS Foundry agent to have it make a decision on whether the email is an order or not, but am unable to get to the agent via API and have no clue whether there is another method that would be more suited to my needs
Describe the problem/error/question
Consistently getting a 401 error which I have narrowed down to either the API key or the endpoint
What is the error message (if any)?
Please share your workflow
Share the output returned by the last node
[
{
“body”:
{
“error”:
{
“code”:
“401”,
“message”:
“Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.”
}
},
“headers”:
{
“content-length”:
“224”,
“connection”:
“close”,
“content-type”:
“application/json”,
“date”:
“Wed, 11 Mar 2026 01:30:24 GMT”,
“apim-request-id”:
“98025f0b-c5c4-4d23-ad4d-48f375db4ceb”
},
“statusCode”:
401,
“statusMessage”:
“PermissionDenied”
}
]
Information on your n8n setup
- n8n version: 1.123.22
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Cloud
- Operating system: Win 11
