Share via

Clarification on pagination for the Purview scan endpoint.

Balamurugan, Susinthika 20 Reputation points
2026-03-23T07:09:52.6766667+00:00

Hi Team
We have generated additional scan run data for the below endpoint (100+ records). However, we are still not receiving pagination keys (e.g., nextLink) in the response.

We have attached the request and response for your reference. Could you please provide insights on this endpoint, specifically regarding its default page size and pagination behaviour? This will help us proceed further with validating pagination.

Request Endpoint: https://<domain>.purview.azure.com/scan/datasources/<datasourcename>/scans/<scanname>/runs?api-version=2023-09-01

**Response:

This contains a one sample record and the total count of records from this endpoint.**

JSON

        {
            "discoveryExecutionDetails": {
                "discoveryStartTime": "2026-03-10T06:40:11.4817265Z",
                "discoveryEndTime": "2026-03-10T06:44:29.8952577Z",
                "status": "Succeeded",
                "statistics": {
                    "assets": {
                        "discovered": 72,
                        "classified": 1
                    }
                },
                "isErrorLogAvailable": false
            },
            "ingestionExecutionDetails": {
                "ingestionStartTime": "2026-03-10T06:41:29.6976853Z",
                "ingestionEndTime": "2026-03-10T06:44:36.2151666Z",
                "status": "Succeeded",
                "statistics": {
                    "assets": {
                        "succeeded": 72,
                        "failed": 0,
                        "processing": 0
                    },
                    "relationships": {
                        "succeeded": 0,
                        "failed": 0,
                        "processing": 0
                    }
                },
                "estimatedTimeRemainingInSeconds": null,
                "isErrorLogAvailable": false,
                "lastUpdatedAt": "2026-03-20T07:12:32.6500378+00:00"
            },
            "parentId": null,
            "id": "df404def-14e9-4a7e-822f-5959aafe29d5",
            "ingestionJobId": "df404def-14e9-4a7e-822f-5959aafe29d5",
            "resourceId": null,
            "status": "Succeeded",
            "webScanResults": null,
            "diagnostics": {
                "notifications": [],
                "exceptionCountMap": {}
            },
            "startTime": "2026-03-10T06:40:07.3197594Z",
            "endTime": "2026-03-10T06:44:36.2151666Z",
            "scanRulesetVersion": 3,
            "scanRulesetType": "System",
            "scanScopeType": "L3",
            "scanLevelType": "Full",
            "errorMessage": null,
            "error": null,
            "runType": "Manual",
            "dataSourceType": "AmazonS3"
        }
    ],
    "count": 107
Microsoft Security | Microsoft Purview
0 comments No comments

2 answers

Sort by: Most helpful
  1. SAI JAGADEESH KUDIPUDI 1,905 Reputation points Microsoft External Staff Moderator
    2026-03-25T15:15:47.36+00:00

    Hi Balamurugan, Susinthika,
    Thanks for the details and JSON sample. Here’s what’s happening with the /scan/.../runs endpoint in Purview:

    1. Default paging behavior
      • By design this Data Plane endpoint returns only a single run record by default (think of it as a “head-of-list” snapshot).
      • The count field in your response is the total number of runs that exist (107 in your case), not the number of items returned in that single-page payload.
      • Because the default page size is 1, the service doesn’t emit a nextLink unless you explicitly ask for more than one item.
    2. How to page through runs
      • You can opt into paging by using OData query parameters: • $top to set how many runs you want returned in each page (up to the service limit). • $skip to skip a certain number of runs.
      • Example: GET …/runs?api-version=2023-09-01&$top=50
      • If you request fewer than or exactly the total count, and there are more runs beyond what you’ve asked for, you’ll get a nextLink in the response pointing at the next page.
    3. Next steps & troubleshooting
      • Try calling the endpoint with a $top value (e.g. 50 or 100). If you set $top smaller than count, you should see a nextLink in the payload.
      • If you still don’t see nextLink, let me know: • Which API version and region you’re calling? • Exact URL (minus any PII) including the query string you’re using. • Whether you’ve tried both $top and $skip or using the returned nextLink URI.

    Hope that helps you validate pagination. Let me know how it goes!

    Reference Links:

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

    Please do not forget to "Accept Answer" and "up-vote" wherever the information provided helps you, as this can be beneficial to other community members.


  2. Q&A Assist
    2026-03-23T07:10:05.05+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    For Microsoft Purview scan listing APIs, pagination is exposed through a nextLink property when there are additional pages of results.

    From the documented Purview Scanning models:

    • ScanListOutput (used by Purview scan list operations) has an optional
        nextLink?: string
      
      described as:

      The link to the next page of results, if any remaining results exist.

    • The response body schema for list operations is of the form:
        {
          "value": [ ... ],
          "nextLink": "string",
          "count": number
        }
      

    Key implications for the behavior being observed:

    1. count is the total number of items that match the query (in your case, 107).
    2. nextLink is only present when the current response is a partial page and more results remain.
    3. If nextLink is missing or null, the page returned already contains all items for that request, regardless of the count value.

    Therefore, if the response contains count: 107 but no nextLink, the service is returning all 107 runs in a single page for that endpoint invocation. In that case:

    • There is no additional page to request.
    • Pagination cannot be validated on that dataset because the server has not needed to paginate.

    To validate pagination behavior for this API, it is necessary to:

    • Use a data source/scan with enough runs that the service decides to split results into multiple pages, or
    • Use a client/SDK that exposes Pageable behavior (for example, PurviewDataSourceClient.GetScans returns Pageable<BinaryData> and internally handles nextLink when present).

    Once the service returns a partial page, the response will include nextLink, which can then be followed to retrieve subsequent pages.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.