Auth0 Home Blog Docs

Can I make group api calls with group names instead of id (guid)


My flow involves creating groups with fixed names and assigning users to a subset of them when they sign in for the first time. At this time, I know the name of the group but not the guid. When I call an api, eg add user to groups, it throws an error saying:
{ statusCode: 400,error: ‘Bad Request’,message: ‘“0” must be a valid GUID’,validation: { source: ‘payload’, errors: [Array] } } }

All the group apis seem to require the id (guids) and I cannot find an easy way to map from group name to group id either. What is the recommended way to use these apis if I have the group name?


Found the solution to this. The get groups call does allow for a query param “?q=” and a “field” param that I set to “name” to get the group ids.


Can you share the full request that you are sending?
i am trying to call:
and get an error: Cannot read property 'toLowerCase' of undefined