---
title: "Scroll documents"
method: GET
path: "/api/dataentities/{dataEntityName}/scroll"
tags: ["Scroll"]
---

# Scroll documents

`GET /api/dataentities/{dataEntityName}/scroll`

Returns a list of documents according to query parameter filters. If you need to query the entire database, or your collection is over 10000 documents, use this endpoint.

In the first request, the `X-VTEX-MD-TOKEN` token will be obtained in the response header. This token must be passed to the next request in the `_token` query string parameter. The token expires after 20 minutes of inactivity, and each request made with the token during this time resets the expiration timer.

After the token is obtained, it is no longer necessary to send the filter or document size per page parameters. You only need to resend the token until the document collection is empty.

First request:
```
/dataentities/Newsletter/scroll?isCluster=true&_size=250&_fields=email,firstName
```

Retrieve the token in the header `X-VTEX-MD-TOKEN` from the first request's response and use it to make the following requests.

Subsequent requests:
```
/dataentities/Newsletter/scroll?_token={tokenValue}
```

Learn more about [Pagination in the Master Data API](https://developers.vtex.com/docs/guides/pagination-in-the-master-data-api).

>⚠️ Avoid sending too many requests with wildcards (`*`) in the search parameters or using the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code `429`.

## Query examples

| **Query Type** | **Example** |
|-|-|
| **Simple filter** | `/dataentities/Newsletter/scroll?email=my@email.com` |
| **Complex filter** | `/dataentities/Newsletter/scroll?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01)` |
| **Date range** | `/dataentities/Newsletter/scroll?_where=createdIn between 2001-01-01 AND 2016-01-01` |
| **Range numeric fields** | `/dataentities/Newsletter/scroll?_where=age between 18 AND 25` |
| **Partial filter** | `/dataentities/Newsletter/scroll?firstName=*Maria*` |
| **Filter for null values** | `/dataentities/Newsletter/scroll?_where=firstName is null` |
| **Filter for non-null values** | `/dataentities/Newsletter/scroll?_where=firstName is not null` |
| **Filter for difference** | `/dataentities/Newsletter/scroll?_where=firstName<>maria` |
| **Filter greater than** | `/dataentities/Newsletter/scroll?_where=number>5` |
| **Filter less than** | `/dataentities/Newsletter/scroll?_where=date<2001-01-01` |

## Permissions

Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:

| **Product** | **Category** | **Resource** |
| --------------- | ----------------- | ----------------- |
| Dynamic Storage | Dynamic storage generic resources | **Read only documents** |
| Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** |
| Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** |
| Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** |

There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).

>❗ To prevent integrations from having excessive permissions, consider the [best practices for managing API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.

## Path parameters

- `dataEntityName` string, required

## Query parameters

- `_token` string
- `_size` integer
- `_fields` string
- `_where` string
- `_schema` string
- `_sort` string

## Headers

- `Content-Type` string, required
- `Accept` string, required

## Response `200`

OK

- UsingFieldsAll[] — List of documents that correspond to the result of the scroll.
  - `id` string, required — ID of the document.
  - `accountId` string, required — ID of the VTEX account.
  - `accountName` string, required — Name of the VTEX account.
  - `dataEntityId` string, required — Data entity name.

## Other responses

- `400` — Bad Request
- `429` — Too Many Requests Wildcard queries temporarily blocked due to excessive usage. Consider adjusting your code to remove them or reduce the rate of search requests with wildcards (*). This temporary block may also be due to excessive use of requests with the parameter `keyword`.

## Changes

- **2024-11-22** `7ad59b303bf1` — 1 warning
  - deleted the `query` request parameter `_page`
- **2024-08-16** `9e4c9b8b672b` — 1 info
  - added the new optional `query` request parameter `_page`
- **2024-04-04** `eeea1ecf1a05` — 1 warning
  - deleted the `query` request parameter `_keyword`
- **2024-01-09** `85848976f04c` — 1 warning, 1 info
  - deleted the `header` request parameter `REST-Range`
  - added the new optional `query` request parameter `_size`
- **2023-10-19** `5bf3265c027c` — 3 breaking
  - for the `query` request parameter `_fields`, default value `email,firstName,document` was removed
  - for the `query` request parameter `_sort`, default value `firstName ASC` was removed
  - for the `query` request parameter `_token`, default value `{tokenValueExample}` was removed

[Full history](https://skmtc.dev/vtex/apis/master-data-api-v2/changes/api/dataentities/:dataEntityName/scroll/get.md)

---

[API](https://skmtc.dev/vtex/apis/master-data-api-v2.md) · [All operations](https://skmtc.dev/vtex/apis/master-data-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vtex/master-data-api-v2/revisions/6d3f8010fa54/schema)
