<@U04UQ68083H> How do I use the page_token when it...
# ory-copilot
p
@chilly-king-10285 How do I use the page_token when iterating over identities using the kratos API?
c
A message from kapa.ai
When using the Kratos API to iterate over identities, you can use the
page_token
query parameter to navigate through the pages of results. This replaces the deprecated
per_page
and
page
parameters. Here's how you can use it: 1. Make a GET request to the
/admin/identities
endpoint. If this is your first request, you don't need to provide a
page_token
. 2. The response will include a
Link
header. This header will contain the
page_token
for the next page of results. 3. For subsequent requests, include the
page_token
in your request as a query parameter. For example, if your
page_token
is 'abc123', your request would look like this:
GET /admin/identities?page_token=abc123
. 4. Repeat this process until you've retrieved all the pages of results you need. Remember, the
page_token
is not a sequential number, and some
page_token
values might return an empty list. The first page can be retrieved by omitting the
page_token
parameter. For more details, you can refer to the [Kratos API documentation](https://www.ory.sh/docs/kratos/reference/api).
p
@chilly-king-10285 I am using the Ory API and thus am not making REST API calls directly.
How do I do this using the ory API?
c
A message from kapa.ai
Hmm, I don't know enough to give you a confident answer yet. The provided knowledge sources do not contain specific information on how to use the
page_token
when iterating over identities using the Ory API. I recommend checking the [Ory API documentation](https://www.ory.sh/docs/reference/api) for more detailed information.