RabbitMQ - Grant user permissions using the REST API

by
Jeremy Canfield |
Updated: December 29 2022
| RabbitMQ articles
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 /.
curl
--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.
204
Did you find this article helpful?
If so, consider buying me a coffee over at