<@U04UQ68083H> How to get a list of identities by ...
# ory-copilot
p
@chilly-king-10285 How to get a list of identities by a list of identity IDs?
c
A message from kapa.ai
To get a list of identities by a list of identity IDs, you can use the
ory get identity
command. Provide the identity IDs as arguments to the command. Here's an example:
Copy code
ory get identity [id-1] [id-2] [id-n] [flags]
Replace
[id-1]
,
[id-2]
,
[id-n]
with the actual identity IDs you want to fetch. For more information, refer to the [documentation](https://www.ory.sh/docs/cli/ory-get-identity).
p
@chilly-king-10285 Is it possible to do this through the API?
c
A message from kapa.ai
Yes, you can get an identity by its ID using the Ory Kratos API. However, the API does not provide a direct way to fetch multiple identities by a list of IDs in a single request. You will need to make individual API calls for each identity ID. To get an identity by its ID, use the "Get an Identity" API endpoint:
Copy code
GET /identities/{id}
Replace
{id}
with the actual identity ID you want to fetch. For more information, refer to the [API documentation](https://www.ory.sh/docs/kratos/reference/api#operation/getIdentity). To fetch multiple identities by their IDs, you can make separate API calls for each ID and combine the results.
p
It seems that the SDK implementation also gets identities one-by-one when multiple keys are passed.