Auth0 Home Blog Docs

Is it possible to use the Management V2 /api/v2/users endpoint to query objects in an array

management-api
users
search
lucene
q

#1
Lets assume I have an app metadata structure like so : 
{
  "Tenants": 
    {
      "Name": "testCust",
      "permissions": {
        "groups": 
          "Owner",
          "User",
          "Tester"
        ]
      }
    },
    {
      "Name": "realCust",
      "permissions": {
        "groups": 
          "Owner",
          "Marketing",
          "Driver"
        ]
      }
    }
 }

Is there anyway for me to query this structure using the q parameter to find all Users containing a Tenant with name testCust and has the group Owner?

I already tried
app_metadata.Tenants.Name:testCust AND app_metadata.Tenants.permissions.groups: Owner

But that returns all users who have ANY tenant with the name testCust and ANY tenant with the permission Owner.


#2

To my knowledge, that is not possible; you may consider if doing additional filtering at the client application level is an acceptable workaround.

The query syntax supported is documented here and if you follow the additionally linked docs you’ll notice this syntax is in fact the Lucene Query Syntax which would not support that use case as that would require the ability to represent a query in a single nested object which the query string syntax does not support.

Additional information:


#3