Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

User role/group from API


Is there any way to get a user’s role or group from the API?


Hello Logan,

Thanks for your posting. Role or group details are currently not supported via the API. It would be supported to read this by accessing the database directly (which is supported for read-only queries) but I’m not sure if this would be an option for you (I’m happy to provide additional details in this case).




I would need the detail please.



Hello Alston,

Thanks for your posting! The roles and groups are stored in two separate tables, conveniently named roles and groups :slight_smile:

So to get all roles or groups via SQL, you can use:

SELECT * FROM roles;
SELECT * FROM groups;

The groups for a user are stored in group_users. To find out the groups for a user with ID 10, you can use:

SELECT * FROM group_users WHERE user_id = 10;

Important: please note that we only support accessing the database for read-only queries.

I hope this helps!



Dear Tobias

Thanks for the detail.



You are welcome, Alston, and please let me know in case you have any further questions!