<@U04UQ68083H> can I get ory identity based on ema...
# ory-copilot
w
@chilly-king-10285 can I get ory identity based on email wihtout iterating all of the project identities?
c
A message from kapa.ai
No, currently Ory does not provide a direct way to get an identity based on email without iterating through all the project identities. The
ory get identity
command requires the identity ID(s) as input. To get an identity by some selector like the recovery email address, you would need to use the
list
command in combination with
jq
to filter the identities. Here is an example command to get identities with the recovery email address at the domain "ory.sh":
Copy code
bash ory get identity $(ory ls identities --format json | jq -r 'map(select(.recovery_addresses[].value | endswith("@ory.sh"))) | .[].id')
This command lists all identities, formats the output as JSON, filters the identities where the recovery email address ends with "@ory.sh", and then gets the identity details for those identities. If you find this process cumbersome and you frequently need to get identities by email, you might consider opening an issue on the Ory GitHub page to request a feature for predefined selectors. Source: [Ory CLI Documentation](https://www.ory.sh/docs/cli/ory-get-identity#ory-get-identity)
a
Hey @worried-journalist-71921 I think you can use this
/admin/identities?credentials_identifier=<mailto:test@gmail.com|test@gmail.com>
👀 1
w
thanks, I'll try it!