Auth0 Home Blog Docs

Query on user identities count

Can we query on the number of identities for a user?
We are looking to query all the users having just 1 identity. Is it possible?

I tried identies.values.length: 1 and identites.length:1. Both returned HTTP 400

Hi @smajeti,

I am unable to find a query that will accomplish this.

A couple of ideas for a workaround:

  • Add number of identities to user metadata via a rule and management api script.
  • Export users and run a script outside of auth0

I think the first option would be the easiest if you need to do this query often. You would need to perform this action on all existing users with a management api script, and then you would write a rule that could maintain this data during user authentication events.

Hope this helps,