# Paginate Okta via link headers

**URL:** <https://devforum.okta.com/t/paginate-okta-via-link-headers/31248>\
**Category:** Templates\
**Created:** [November 18, 2024, 7:38pm UTC](https://devforum.okta.com/t/paginate-okta-via-link-headers/31248 "2024-11-18T19:38:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel.sroka](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/gabriel.sroka/32/1292_2.png) [@gabriel.sroka](https://devforum.okta.com/u/gabriel.sroka)\
**Post date:** [November 18, 2024, 7:38pm UTC](https://devforum.okta.com/t/paginate-okta-via-link-headers/31248/1 "2024-11-18T19:38:21Z")

</div>

paginate Okta using recursion. it uses the `link` header. this applies to some other APIs, too. start it by passing in a relative url, eg

`/api/v1/users`

or, to test a little

`/api/v1/users?limit=4&filter=profile.lastName eq "Doe"`

 ![paginateOkta](https://global.discourse-cdn.com/oktadev/original/2X/3/3bdb69b9f1364c42516955998c95eb58c61a7096.png)

[paginateOkta.flow](https://devforum.okta.com/uploads/short-url/g4GAL3hzSbVolCdaE5rCq4dpCEa.flow) (24.2 KB)

---

<div class="post-metadata">

**Author:** ![Sk0909](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@Sk0909](https://devforum.okta.com/u/Sk0909)\
**Post date:** [April 11, 2025, 1:28pm UTC](https://devforum.okta.com/t/paginate-okta-via-link-headers/31248/2 "2025-04-11T13:28:13Z")

</div>

Hi @gabriel.sroka

the number of times a flow can call itself is 250. How to overcome this, in the above example? consider you have 100k users and record per page are 100(limit).

---

<div class="post-metadata">

**Author:** ![gabriel.sroka](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/gabriel.sroka/32/1292_2.png) [@gabriel.sroka](https://devforum.okta.com/u/gabriel.sroka)\
**Post date:** [April 11, 2025, 3:21pm UTC](https://devforum.okta.com/t/paginate-okta-via-link-headers/31248/3 "2025-04-11T15:21:36Z")

</div>

break it up into buckets of less than 250 pages. eg, by alphabet A-M and N-Z or smaller buckets as necessary.

the max limit for /users is 200, so 200 \* 250 = 50,000

---

<div class="post-metadata">

**Author:** ![Sk0909](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@Sk0909](https://devforum.okta.com/u/Sk0909)\
**Post date:** [April 11, 2025, 3:40pm UTC](https://devforum.okta.com/t/paginate-okta-via-link-headers/31248/4 "2025-04-11T15:40:28Z")

</div>

when we want to do this complete automation, we wont be able to count to break them in buckets.

example for offset based pagiation we have repeat card which can automatically calculate and iterate
