# IDN API to Get All Accounts (correlated and uncorrelated) from a certain Target System

**URL:** <https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud, apis\
**Created:** [September 12, 2023, 2:28am UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461 "2023-09-12T02:28:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rpalos](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Rpalos](https://developer.sailpoint.com/discuss/u/Rpalos)\
**Post date:** [September 12, 2023, 2:28am UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461/1 "2023-09-12T02:28:08Z")

</div>

Hi,

I’m trying to retrieve all the accounts from particular source in my Identitynow. what I mean by all accounts includes uncorrelated accounts.

I tried to use the v3 get accounts api:  
{{baseUrl}}/v3/accounts?filters=sourceId eq “47ce5419701040c593789252007aed5d”

but this api have a maximum number of records to return in a single API call which is 250.

is there a way to do paging? like fetch the first 250 accounts from page 1 then, another api call to fetch page 2 then next 250 accounts.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![gladstoneabrahamr](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gladstoneabrahamr/32/4232_2.png) [@gladstoneabrahamr](https://developer.sailpoint.com/discuss/u/gladstoneabrahamr)\
**Post date:** [September 12, 2023, 6:38am UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461/2 "2023-09-12T06:38:11Z")

</div>

Hi @Rpalos,

I believe the options you are looking for are **limit** & **offset** param which looks like the following,

> {{baseUrl}}/v3/accounts?limit=250&offset=0&filters=sourceId eq “47ce5419701040c593789252007aed5d”

For more references related to the API do check this [link](https://developer.sailpoint.com/idn/api/v3/list-accounts).

**Note:** The **offset** value is record-based, not page-based, and the index starts at 0

To get the next 250 accounts the Query will look something like,

> {{baseUrl}}/v3/accounts?limit=250&offset=249&filters=sourceId eq “47ce5419701040c593789252007aed5d”

**Note:** Collection is done based on array indexing and starts from 0. So the first 250 records number from **0-249** (offset=0, limit=250) & second 250 records number from **250-499** (offset=249, limit=250) and so on.

The collection standards imply that its its 250 per page like you said. If you want to explore more on the other options and standards that go with collection type endpoint check [here](https://developer.sailpoint.com/idn/api/standard-collection-parameters/)

---

<div class="post-metadata">

**Author:** ![mcheek](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mcheek/32/23705_2.png) [@mcheek](https://developer.sailpoint.com/discuss/u/mcheek)\
**Post date:** [September 12, 2023, 1:16pm UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461/3 "2023-09-12T13:16:35Z")

</div>

I would add to this to make sure you’re adding a “sorters” query parameter to this… preferably something like id that does not change.

I’ve found that sometimes the default sorting isn’t consistent and can lead to not getting back all the records or bringing in duplicates

---

<div class="post-metadata">

**Author:** ![Rpalos](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Rpalos](https://developer.sailpoint.com/discuss/u/Rpalos)\
**Post date:** [September 13, 2023, 1:28am UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461/4 "2023-09-13T01:28:51Z")

</div>

Hi gladstone,

Thanks! I can fetch now all the accounts from the target system.

---

<div class="post-metadata">

**Author:** ![Rpalos](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Rpalos](https://developer.sailpoint.com/discuss/u/Rpalos)\
**Post date:** [September 13, 2023, 1:31am UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461/5 "2023-09-13T01:31:33Z")

</div>

Hi mark,

I see. I’ll make sure to add the sorters parameter as well. Thanks for the inputs.

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [September 13, 2023, 2:40am UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461/6 "2023-09-13T02:40:58Z")

</div>

> [@gladstoneabrahamr](#):
>
> limit=250&offset=249

offset should be 250 to get the 251st record onwards.

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [September 13, 2023, 2:42am UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461/7 "2023-09-13T02:42:15Z")

</div>

> [@mcheek](#):
>
> I would add to this to make sure you’re adding a “sorters” query parameter to this

Very important point indeed… It drove me crazy when I had a case where there were few thousands of records and it took a me a long time to figure out the solution 😃

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [November 12, 2023, 2:43am UTC](https://developer.sailpoint.com/discuss/t/idn-api-to-get-all-accounts-correlated-and-uncorrelated-from-a-certain-target-system/17461/8 "2023-11-12T02:43:04Z")

</div>

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