RabbitMQ - Grant user permissions using the REST API (curl)

This assumes you have created a RabbitMQ user with the administrator tag.

Refer to the RabbitMQ REST API documentation.

The curl command with the --user option can be used to make an API connection to RabbitMQ. In this example, John Doe is granted full access to virtual host vhost001. If the virtual host is / (just the forward slash), you will need to use %2F instead of /.

--user john.doe:itsasecret
--header "content-type:application/json"
--request PUT
--data '{"configure":".*","write":".*","read":".*"}'
--write-out "%{http_code}"
--url http://server001:15671/api/permissions/vhost001/john.doe


If the request is successful, HTTP response code 204 should be returned.



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter d9a55 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |