When I try to curl the REST API I get "login-required" error

Hi there guys, I am trying to do this simple curl in ubuntu

curl -X POST --unix-socket /run/snapd.socket http://localhost/v2/snaps/hello-world

And it is giving me this error:

{“type”:“error”,“status-code”:401,“status”:“Unauthorized”,“result”:{“message”:“access denied”,“kind”:“login-required”}}

Am I missing something in my request?

Have you tried with sudo?