Auth issue when trying to add a response to a queue via Power Automate


I’m trying to add an item to a queue using Microsoft Forms and Power Automate.
The issues starts when the flow is actually trying to send the response to the queue in Orchestrator.
Basically, I have tried 2 types of approach for authentication, and both of them retrive the access token successfully, which I need for the last API call to Orchestrator.
But when it executes the last HTTP Request, it says the following:

{ "message": "You are not authenticated!", "errorCode": 0, "result": null, "targetUrl": null, "success": false, "error": { "code": 0, "message": "You are not authenticated!", "details": "You should be authenticated (sign in) in order to perform this operation.", "validationErrors": null }, "unAuthorizedRequest": true, "__abp": true }

Flows are using the following for the authentication:

First flow:

  • URI
  • Headers:

    1. Content-Type : application/json
    2. X-UiPath-TenantName : DefaultTenant
  • Body:
    { "grant_type": "refresh_token", "client_id": "qwerty1234", "refresh_token": "abcdef9876" }

Second flow:

  • URI
  • Headers:

    1. Content-Type: application/x-www-form-urlencoded
  • Body:

The both variants work just fine, and in the Output I can see the Bearer (access token), as it follows:

  "access_token": "eyJhbGciOi....",
  "id_token": "eyJhbGciO...",
  "scope": "openid profile email offline_access",
  "expires_in": 86400,
  "token_type": "Bearer"

However, the error occurs at the last HTTP Request, as you can see in the snip below.:

Now, its worth mentioning that I have also set the External Application for Power Automate, using the application scopes ‘OR.Queues OR.Queues.Write’.

Do you have any advice/idea why this is happening? I was trying to figure it out for the last 3 days but I still don’t get it.
Any response will be appreciated! Thanks a lot!


In add queue item header did you add the authorization? With Bearer <token>

Also did you happen to add application scope only in external application?

And I hope you fid not add any redirect url as well


Hello Anil, yes, in the add queue item HTTP Req I have added the Authorization header, as you can see in the snip below:

Also, in the external application I’ve set only Application scope, without any User scopes.
And yes, the Redirect URL is empty.

Any ideas? Thanks a lot!

Check for reference these articles:

Hello Marian, that’s what I did step-by-step for the second flow, as I wrote in the initial post. It’s still getting me that ‘You are not authenticated!’ error…


Are you on classic?

it looks like wrong url and also you need to give org id

your url shoudl be the orch url + the odata/etc


First of all, the URL address is not correct. It should start with

Read carefully the articles.

It seems that you were both right, the URL was like Tenant_Name/Tenant_Name instead of Organization_Name/Tenant_name and also the Organization Unit ID header was missing. Now it’s woking just fine.

Thanks a million for this!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.