How can I use Postman to call the Accounts API and retrieve more than the 250-record limit in the response?

Dear Sir or Madam,

In this case,
The Search Goal: Generate a list of users with their AD accounts and entitlements.

During this process, I attempted to use the “search all accounts” method combined with iteration to gather the data and store it in a list. However, the results did not meet expectations.

What is the correct way to retrieve more than 250 records and export the results as a JSON or CSV file?

Hi @Dervish , you can use the Search API which have 10000 limit .
Search API
with query like below in body.

{
  "indices": [
    "identities"
  ],
  "query": {
    "query": "@accounts(source.name:AD OR source.name:RPA)"
  }
}


This may help to get results up to 10000 and you can do pagination in this also.
Thank you.

1 Like

Regarding the above reply:
Thank you for taking the time to respond. I now understand the purpose of pagination. However, since retrieving data still requires adjusting the offset and limit parameters, it can be very time-consuming when dealing with tens of thousands of records.

Is there a more efficient solution available?

you’ll want to get out of Postman for this and start scripting. if you know how to use Powershell, i have a module i wrote with a function that can do what you’re looking for here - A completely different ISC PowerShell Module. the Get-ISCAccount function will retrieve all accounts on a specified source.

3 Likes

Hi everyone,

I’ve written a Python script that uses the SailPoint API to retrieve a list of accounts. However, I’ve encountered a couple of issues:

Issue 1: Some of the returned data is incomplete. For example, although Source Name should have a value, the API response shows it as missing or null. Could this be due to differences in the data source?

Issue 2: I understand the API supports pagination, but my current script only returns 250 records. I was expecting it to retrieve all records by handling pagination correctly. Is there anything I might be missing in the implementation?

Attached are the Python script file and the output data.
Please take a moment to review and share any feedback or suggestions.
Thank you in advance!
sailpoint_accounts_export_to_desktop_20250602.py (1.8 KB)

Hi

You need to loop through records until you get less than 250 records returned.

something like

  while count == 250
    responseBody = getAccounts(url,offset,count) 
    count = responseBody.length
    objList = objList  + responseBody
    offset = offset + count
    puts "Count: #{count}, offset #{offset}, length #{$objList.length()}"
  end

Source name is null probably because you aren’t getting the value correctly

1 Like

Hi @sup3rmark
Thank you for the suggestion and for sharing your PowerShell module.
With your function and logic, I was able to revise and adjust my original script into a working solution.
Your assistance has been incredibly helpful and will certainly benefit similar tasks in the future.
Thank you once again!

Hello @jrossicare
Thank you very much for your detailed explanation and the sample logic!
I’ve already integrated this logic into my original script and modified it to correctly apply the field names and resolve the record limit issue.

1 Like

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