RabbitMQ - List users 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, every user will be returned.
curl --user john.doe:itsasecret http://server001:15671/api/users
Something like this should be returned.
[
{
"hashing_algorithm": "rabbit_password_hashing_sha256",
"limits": {},
"name": "john.doe",
"password_hash": "cER8LDfLm++IqrqIdMgLpJ0/ADih08ZaZHx3ja+kPXjqNVxL",
"tags": "administrator"
},
{
"hashing_algorithm": "rabbit_password_hashing_sha256",
"limits": {},
"name": "jane.doe",
"password_hash": "iBe4IDLdPbMi5cq+vbQWj+TZecchj42u7rjWwqGT0tIMpwQa",
"tags": "management"
}
]
Here is how to list an individual user.
curl --user john.doe:itsasecret http://server001:15671/api/users/john.doe
Which should return something like this.
[
{
"hashing_algorithm": "rabbit_password_hashing_sha256",
"limits": {},
"name": "john.doe",
"password_hash": "cER8LDfLm++IqrqIdMgLpJ0/ADih08ZaZHx3ja+kPXjqNVxL",
"tags": "administrator"
}
]
Did you find this article helpful?
If so, consider buying me a coffee over at