# Pagination on the logs via Management API v2

**URL:** <https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976>\
**Category:** Get Help\
**Tags:** logs, auth0\
**Created:** [September 20, 2022, 2:07pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976 "2022-09-20T14:07:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![impurush](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/impurush/32/40050_2.png) [@impurush](https://community.auth0.com/u/impurush)\
**Post date:** [September 20, 2022, 2:07pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/1 "2022-09-20T14:07:40Z")

</div>

I read the documentation to pull the logs from Auth0 using management API v2 as per the below screenshot. However, I could not understand how to pull the next 100 logs using pagination. In the documentation, it stated that we need to use the link in the headers for the next 100 logs but what I get in the link looks like not the correct URL. Could anyone please help to make me understand which link I should use to get the following 100 logs?

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/b/6bdcec68eeadfa60cf6fb542c68526cec64fd5d6.png)

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [September 21, 2022, 5:44pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/4 "2022-09-21T17:44:16Z")

</div>

Hi @impurush ,

Welcome to the Auth0 Community!

I tested the endpoint

`https://{{my_tenant_domain}}/api/v2/logs?from=LOG_ID_1&take=100`

In the response, it displays 100 logs in chronicle order, and the id of the last log is LOG\_ID\_100, and the HTTP Link header looks like

`<https://{{my_tenant_domain}}/api/v2/logs?from=LOG_ID_100&take=100>; rel="next"`

`https://{{my_tenant_domain}}/api/v2/logs?from=LOG_ID_100&take=100` is the endpoint to retrieve the next batch with 100 logs.

Could you please provide additional details about what is in your Link header and what you expect in the Link Header field? Thanks!

---

<div class="post-metadata">

**Author:** ![impurush](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/impurush/32/40050_2.png) [@impurush](https://community.auth0.com/u/impurush)\
**Post date:** [September 21, 2022, 7:52pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/5 "2022-09-21T19:52:36Z")

</div>

Thanks for the reply  
As you mentioned in your response, I tried that way but did not work, and got the 404, which says URL is not correct.

I tried the below endpoint  
https://{{tenant\_domain}}/api/v2/logs?from=LOG\_ID&take=100

and the HTTP header link contains the below endpoint

https://{{tenant\_domain}}/api/v2/logs?from=LOD\_ID&take=100; rel=“next”

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [September 21, 2022, 9:39pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/6 "2022-09-21T21:39:12Z")

</div>

I tested this in Postman and it worked fine for me.

Could you please DM me the following details for further investigation?

1. the screenshot of the initial GET request which is successful and returns the Link header.
2. the value in the Link header. And is the log id available in the response body of the initial request?
3. the screenshot of the error when sending the GET request with the URL in the Link header.

Thanks!

---

<div class="post-metadata">

**Author:** ![impurush](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/impurush/32/40050_2.png) [@impurush](https://community.auth0.com/u/impurush)\
**Post date:** [September 22, 2022, 2:55pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/7 "2022-09-22T14:55:31Z")

</div>

Finally it worked in the following way.

First 0-100 logs  
https://{{tenant\_domain}/api/v2/logs?from=LOG\_ID&take=100

Next 100-200 logs  
https://{{tenant\_domain}/api/v2/logs?from=LOG\_ID\_FROM\_HEADER\_LINK&take=100&rel=next

Next 200-300 logs  
https://{{tenant\_domain}/api/v2/logs?from=LOG\_ID\_FROM\_HEADER\_LINK&take=100&rel=next

Thanks @lihua.zhang for your support.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [September 22, 2022, 3:02pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/8 "2022-09-22T15:02:21Z")

</div>

👏 Thanks for the updates @impurush!

---

<div class="post-metadata">

**Author:** ![Shashamura](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shashamura/32/40409_2.png) [@Shashamura](https://community.auth0.com/u/Shashamura)\
**Post date:** [October 4, 2022, 10:51pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/9 "2022-10-04T22:51:32Z")

</div>

How can I pull the logs from Auth0 using management API v2…with the 0-100 logs with all this url …https://{{tenant\_domain}/api/v2/logs?from=LOG\_ID&take=100 Next 100-200 logs https://{{tenant\_domain}/api/v2/logs?from=LOG\_ID\_FROM\_HEADER\_LINK&take=100&rel=next Next 200-300 logs https://{{tenant\_domain}/api/v2/logs?from=LOG\_ID\_FROM\_HEADE…I want to know how it operate…thank u

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [October 4, 2022, 11:00pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/10 "2022-10-04T23:00:47Z")

</div>

Hi @Shashamura ,

You can use Postman and make a GET request to those URLs as endpoint to pull the logs. Here is a screenshot.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/4/3/433fb2ae0858514da8937a103ec3f2465f623aac.png)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [October 18, 2022, 11:00pm UTC](https://community.auth0.com/t/pagination-on-the-logs-via-management-api-v2/90976/11 "2022-10-18T23:00:49Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
