---
title: "HISTORY: Retrieves incremental changes since timestamp"
method: GET
path: "/{collection}/history"
tags: ["generic"]
---

# HISTORY: Retrieves incremental changes since timestamp

`GET /{collection}/history`

HISTORY operation is intended for continuous data synchronization with other systems.
Every insertion, update and deletion will be included in the resulting JSON array of documents (since timestamp in `Last-Modified` request header value). All changes are listed chronologically in response with 200 HTTP status code. The maximum listed `srvModified` timestamp is also stored in `Last-Modified` and `ETag` response headers that you can use for future, directly following synchronization. You can also limit the array's length using `limit` parameter.

Deleted documents will appear with `isValid` = `false` field.

HISTORY operation has a fallback mechanism in place for documents, which were not created by API v3. For such documents `srvModified` is virtually assigned from the `date` field (for `entries` collection) or from the `created_at` field (for other collections).

This operation requires `read` permission for the API and the collection (e.g. `api:treatments:read`)

The only exception is the `settings` collection which requires `admin` permission (`api:settings:admin`), because the settings of each application should be isolated and kept secret. You need to know the concrete identifier to access the app's settings.

## Query parameters

- `limit` integer
- `fields` string

## Headers

- `Last-Modified` string, required

## Response `200`

Changed documents since specified timestamp

- object
  - `status` integer
  - `result` DocumentArray — unresolved $ref

## Other responses

- `400` — The request is malformed. There may be some required parameters missing or there are unrecognized parameters present.
- `401` — The request was not successfully authenticated using JWT, so that the request cannot continue due to the security policy.
- `403` — Insecure HTTP scheme used or the request has been successfully authenticated, but the security subject is not authorized for the operation.
- `404` — The collection or document specified was not found.
- `406` — The requested content type (in `Accept` header) is not supported.

## Changes

- **2026-07-17** `5b0d424433e1` — 1 info
  - the endpoint scheme security `accessToken` was removed from the API
- **2021-01-07** `8252719e8e34` — 2 breaking, 11 info
  - the response's body type changed from `object` to no type for status `200`
  - removed the success response with the status `204`
  - the endpoint scheme security `accessToken` was added to the API
  - the endpoint scheme security `jwtoken` was added to the API
  - …9 more
- **2020-01-12** `4f4eedb269d0` — 3 info
  - added the media type `application/xml` for the response with the status `200`
  - added the media type `text/csv` for the response with the status `200`
  - added the non-success response with the status `406`
- **2019-11-02** `6b2eb690f4ab` — 6 info
  - added the optional property `oneOf[#/components/schemas/DeviceStatusArray]/items/allOf[#/components/schemas/DocumentBase]/isReadOnly` to the response with the `200` status
  - added the optional property `oneOf[#/components/schemas/EntryArray]/items/allOf[#/components/schemas/DocumentBase]/isReadOnly` to the response with the `200` status
  - added the optional property `oneOf[#/components/schemas/FoodArray]/items/allOf[#/components/schemas/DocumentBase]/isReadOnly` to the response with the `200` status
  - added the optional property `oneOf[#/components/schemas/ProfileArray]/items/allOf[#/components/schemas/DocumentBase]/isReadOnly` to the response with the `200` status
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/nightscout/apis/nightscout-api/changes/:collection/history/get.md)

---

[API](https://skmtc.dev/nightscout/apis/nightscout-api.md) · [All operations](https://skmtc.dev/nightscout/apis/nightscout-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nightscout/nightscout-api/revisions/5b0d424433e1/schema)
