---
title: "Query changed regions metadata."
method: POST
path: "/data/changed_regions"
tags: ["data"]
---

# Query changed regions metadata.

`POST /data/changed_regions`

This API provides for querying the metadata about the regions that are different between two snapshots of a disk in the AOS file system. (The snapshot specified by the reference parameter will be used as the basis for computing the changed regions.)
The main use of this API is to enable incremental and differential backups.
Since each region specifies whether the region is all zeros, reads of such zeroed regions need not have to be performed while backing up the underlying disk.
When no reference is specified, the response includes all the allocated regions in the given disk.

## Request body

- ChangedRegionsQuery — Instances of this type are used to specify the input for the changed regions query.
  - `end_offset` integer — The absolute offset in bytes up to which to query for the changed regions. Note that the interval specified by the start_offset together with the end_offset is right half-open. If the end_offset is not specified, the portion from the start_offset till the end of the file will be included in the query.
  - `snapshot_file_path` string, required — Absolute path of a file within a snapshot of an entity such as a virtual machine, a volume group or a protection domain.
  - `start_offset` integer — The absolute offset in bytes from where to query for the changed regions.
  - `reference_snapshot_file_path` string — Absolute path of a file within a snapshot that must be used as the reference in the computation of the changed regions. If this path is not specified, then the changed regions will not be computed. Instead, the sparse and the non-sparse regions of the file specified in snapshot_file_path will be returned.

## Response `200`

Success

- ChangedRegions — Returns information about all the regions that have changed in the interval: [start_offset, next_offset].
  - `next_offset` integer — The offset from where the client must continue the request. This field will not be set when there are no more changed regions to be returned. Note that the next_offset can be outside the endOffset specified by the client in the request. This helps clients reach the next changed offset faster.
  - `region_list` Region[] — List of regions describing the change for the interval [start_offset, next_offset).
    - `length` integer — The length of the region in bytes.
    - `type` string — The type of the region.
    - `offset` integer — The byte offset indicating the start of the region.
  - `file_size` integer — Size of the file specified by snapshot_file_path.

## Other responses

- `400` — Bad Request
- `404` — Not Found. Returned when the file(s) specified by the snapshot_file_path and/or the reference_snapshot_file_path does not exist.
- `503` — Service unavailable. The system cannot currently handle the request
- `default` — Internal Error

---

[API](https://skmtc.net/nutanix/apis/nutanix-intentful-api.md) · [All operations](https://skmtc.net/nutanix/apis/nutanix-intentful-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nutanix/nutanix-intentful-api/revisions/40395083ab31/schema)
