Script to run Export task

Hello All,
I just evaluating Nexus PRO 3.29.2-02 on Windows. My goal is to allow users to export repositories.
So created npm proxy repository and task of type Repository - Export assets.
When I am running this task from Nexus GUI page - everything is working and assets exported to local folder.
I created small PowerShell script:

$cred = Get-Credential
$export_req = Invoke-WebRequest -Uri -Method POST -Credential $cred -ContentType ‘application/json’

It is failed to run a task and here is Nexus log:
2021-02-16 11:10:39,460+0200 WARN [qtp1525599147-613] *UNKNOWN - (ID efa05190-8d99-4415-80b9-19627daf0648) Response: [403] (no entity/body); mapped from: org.apache.shiro.authz.AuthorizationException: User is not permitted: nexus:tasks:start

I tried similar with Python:

h = {‘Content-type’: ‘application/json’}
data = {‘username’:‘admin’, ‘password’:‘AAAAAA’}
r =‘’, data=json.dumps(data), verify=False, headers=h)
print(“Run task\n Response:”,r.text, "Headers: ",r.headers, “\n”)

But result is a same.
I tried to create different user, not admin and gave him different privileges.
Nothing helps…
Any idea?

You should grant your user the permission specified in the error message. Note, that is not a permission that should be granted to ordinary users.

Hello @mpiggott ,
I am using admin user in my script. Not sure what do you mean by “grant your user the permission”.
Can you explain, please?

This is what your message says