# Collect changes in a window

> Ask each list for the rows created, changed and deleted in a time window, page through them with a cursor, and keep your copy in step without gaps.

The lists below take a **modification window** and return the rows created, changed and deleted in it, across every project the integration reaches. To collect yesterday's changes, call each list you need with yesterday as the window. Reads under `/v1/projects/{projectId}/…` that answer several rows, such as the storeys or a project's element counts, are snapshots: they are read when asked and have no window or deletions.

| List | One row is | Key | Permission |
|:-----|:-----------|:----|:-----------|
| `GET /v1/projects` | A project | `id` | *Reads data* (`projects:read`) |
| `GET /v1/elements` | An element of a model | `project_id` + `global_id` | *Reads data* (`elements:read`) |
| `GET /v1/element-events` | A delivery, receipt on site or installation of an element | `id` | *Reads data* (`elements:read`) |
| `GET /v1/inspections` | An inspection of an element, with its steps and checks | `id` | *Reads data* (`inspections:read`) |
| `GET /v1/findings` | A finding or another topic | `guid` | *Reads data* (`findings:read`) |
| `GET /v1/finding-drafts` | A [finding draft](/en/integrations/finding-drafts/) and its status | `id` | *Reads data* (`findings:read`) |
| `GET /v1/comments` | A comment on a finding | `guid` | *Reads data* (`findings:read`) |
| `GET /v1/viewpoints` | A viewpoint of a finding: selected elements, a point or a photo | `guid` | *Reads data* (`findings:read`) |
| `GET /v1/finding-files` | An IFC file a finding refers to | `id` | *Reads data* (`findings:read`) |
| `GET /v1/related-findings` | A relation between two findings, one row per direction | `link_key` | *Reads data* (`findings:read`) |
| `GET /v1/labels` | A [QR label](/en/integrations/labels/) and the element it is on | `id` | *Reads data* (`elements:read`) |
| `GET /v1/model-versions` | An uploaded IFC file, one [model version](/en/integrations/models/) | `id` | *Reads data* (`models:read`) |
| `GET /v1/carry-overs` | Data carried from a removed element to a live one | `id` | *Reads data* (`models:read`) |
| `GET /v1/reference-documents` | A PDF of the project's inspection templates | `id` | *Reads data* (`models:read`) |
| `GET /v1/inspection-plans` | An [inspection plan](/en/integrations/inspections-and-verdicts/) | `id` | *Reads data* (`inspections:read`) |
| `GET /v1/inspection-plan-elements` | An element added to or excluded from a plan by hand | `element_key` | *Reads data* (`inspections:read`) |
| `GET /v1/templates` | An inspection template of the project with its steps | `id` | *Reads data* (`inspections:read`) |
| `GET /v1/check-lists` | A check list of the project with its current version | `id` | *Reads data* (`inspections:read`) |
| `GET /v1/members` | A person on a project and their role | `project_id` + `user_id` | *Reads data* (`projects:read`) |
| `GET /v1/access-requests` | A request to join a project, where the integration is an admin | `id` | *Reads data* (`projects:read`) |
| `GET /v1/zones` | A [zone](/en/integrations/schedule-takt-and-deviations/) of the project, today one per storey of its models | `id` | *Reads data* (`schedule:read`) |
| `GET /v1/schedule-imports` | A schedule read from a model version | `id` | *Reads data* (`schedule:read`) |
| `GET /v1/schedule-tasks` | A task of the schedule | `id` | *Reads data* (`schedule:read`) |
| `GET /v1/maintenance-entries` | A [maintenance entry](/en/integrations/maintenance-handover-and-exports/) on an element | `id` | *Reads data* (`maintenance:read`) |

The fields of each row are in the [API reference](/en/api-reference/).

## The parameters

| Parameter | Meaning |
|:----------|:--------|
| `modified_from` | Start of the window, included |
| `modified_to` | End of the window, not included. Optional; it is never later than the [settled time](#the-settled-time) |
| `project_id` | Only these projects. Repeat it for several |
| `limit` | Rows per page, 1–1000, default 200 |
| `cursor` | The `next_cursor` of the previous page |
| Filters | Each list's own, such as `kind`, `status`, `is_finding`, `model_id` or `log_type`; see the [API reference](/en/api-reference/) |

Times are RFC 3339 with an offset, such as `2026-11-17T00:00:00+02:00` or `2026-11-16T22:00:00Z`. In a URL, write `+` as `%2B`: a bare `+` reads as a space and answers `400`.

The window is half-open, `[modified_from, modified_to)`, so two windows that share a bound neither overlap nor leave a gap. Yesterday in Helsinki, 17 November 2026:

```
modified_from=2026-11-17T00:00:00%2B02:00&modified_to=2026-11-18T00:00:00%2B02:00
```

## The answer

```json
{
  "data": [
    { "project_id": "6f1c…", "global_id": "2O2Fr$t4X7Zf8NOew3FLOH", "name": "P5-3004", "changed_at": "2026-11-17T08:14:03.512844+00:00", "deleted": false, "…": "…" },
    { "project_id": "6f1c…", "global_id": "1hOSvn6df7F8_7GcBWlRGQ", "changed_at": "2026-11-17T09:02:11.004117+00:00", "deleted": true, "reason": "deleted" }
  ],
  "window": { "modified_from": "2026-11-16T22:00:00.000000+00:00", "modified_to": "2026-11-17T22:00:00.000000+00:00" },
  "skipped_projects": [],
  "next_cursor": "eyJ2IjoxLCJ…"
}
```

- A row that changed several times in the window appears once, with its state now.
- A **deleted** row comes with `deleted: true`, its key, `project_id`, `changed_at` (when it was deleted) and `reason`. Delete it from your copy.
- Rows come in `(project_id, changed_at, key)` order, live rows and deletions in one stream. Upsert by the key.
- `window.modified_to` is the end the server used. It can be earlier than you asked; see [the settled time](#the-settled-time).
- `skipped_projects` names the projects this list did not read, with a reason. `FEATURE_OFF`: the project's organisation does not use the feature the list needs, such as element events without the takt board. `PUBLIC_API_DISABLED`: the organisation that owns the project, another than yours, has turned the API off.
- Your client must ignore fields and values it does not know. New fields, event kinds, statuses and reasons come without notice; see [Changelog](/en/integrations/changelog/).

## Pages

A page stops at `limit` rows or about 2 MB. **A page can hold fewer rows than `limit`, even none, while more follow.** Only `next_cursor: null` ends the list.

For the next page, send the same parameters again and add `cursor` with the `next_cursor` you got. A cursor with other parameters answers `400 INVALID_CURSOR`.

## The settled time

All times are the database's, so your own clock does not matter. A write can take a moment to commit, though, so the server ends every window at the **settled time**: at least 5 seconds ago, and before any write still in progress. A row can then never appear later in a window you have already read.

So the window you asked for may end earlier than you asked. **Start your next window at the `window.modified_to` of the answer, never at your own clock.** If the settled time is not yet past `modified_from`, the answer is an empty page with `window.modified_to` equal to `modified_from`: ask again a little later.

## The first load

Without `modified_from` a list returns every live row and no deletions. Its `window.modified_to` is where your first window starts.

## Keep in step

Keep one checkpoint per list:

1. First run: load without `modified_from`, page to the end, store `window.modified_to` as the checkpoint.
2. Every later run: call with `modified_from` = the checkpoint, page to the end, apply the rows, store the new `window.modified_to`.

Deletions are kept for 400 days. A window that starts earlier answers `422 WINDOW_BEFORE_RETENTION`; load again without a window.

## Projects gained and lost

Call `GET /v1/projects` first in every run.

- A project that is **added** to the integration, or that comes back, shows as changed, even though its elements and inspections did not change. Their old rows keep their old `changed_at`, so your window does not bring them. **Load that project without a window**: `project_id=<id>` and no `modified_from`, in every list.
- Do the same when a project **leaves** `skipped_projects`.
- A project the integration **lost**, because it was removed from the integration or handed over to another organisation, comes once as `deleted: true` with `reason: "access_removed"`. Drop all of its data.
- A **deleted** project comes as `reason: "access_removed"` when it was on the integration's list, and as `reason: "deleted"` otherwise. Either way, drop all of its data: its elements, inspections and findings get no deletions of their own.

## What counts as a change

| List | Changes when | Not a deletion |
|:-----|:-------------|:---------------|
| Projects | Any field of the project, or the integration's access to it | – |
| Elements | A listed field: name, IFC class, predefined type, type name, building, storey, origin, archiving. A new model version that leaves them alone changes nothing | An archived element: `archived_at` is set |
| Element events | Recorded or voided | A voided event: `voided_at` and `void_reason` are set |
| Inspections | The inspection, or any of its steps or checks | – |
| Findings | The topic, a step result behind it, or its viewpoints | A closed finding |
| Comments | Written or edited. A comment deleted on its own comes as a deletion | – |
| Viewpoints | Added or changed. A viewpoint deleted on its own comes as a deletion | – |
| Finding files | Set. Setting a finding's files again deletes the old rows and adds the new ones with new ids | – |
| Related findings | A relation added or removed, as one row or one deletion per direction | – |
| Labels | Created, linked to an element, taken out of use, or scanned the first time (`first_scanned_at`, `status`). Later scans change nothing. A deleted label comes as a deletion | A label taken out of use: `status` is `retired` |
| Model versions | Uploaded, and as its reading moves from `pending` through `processing` to `complete` or `failed`. A deleted model comes as a deletion of each of its versions, elements and carry-overs | – |
| Carry-overs | Applied or undone | An undone carry-over: `undone_at` is set |
| Reference documents | Added. A document no template uses any more is deleted and comes as a deletion | – |
| Inspection plans | The plan, its status or its assignees | An archived plan: `status` is `archived` |
| Plan elements | Added or excluded by hand; one taken back comes as a deletion | – |
| Templates | The template or any of its steps | – |
| Check lists | A new version | – |
| Members | Added, or their role changes. A removed person comes as a deletion | – |
| Access requests | Made, approved or denied | – |
| Zones | The label, the order or the element count changes | A zone left without live elements: `archived_at` is set |
| Schedule imports | Read from a model version, or replaced by a later import. Deleting the model deletes its imports, which come as deletions | A replaced import: `superseded_at` is set |
| Schedule tasks | A field changes at an import. Deleting the model deletes its tasks, which come as deletions | A task a later import no longer has: `archived_at` is set |
| Maintenance entries | Written or changed | – |

A deleted finding comes as one deletion in `GET /v1/findings`. Its comments, viewpoints and files, and its relations in both directions, get no deletions of their own: drop them with the finding.

`kind`, `status` and `is_finding` filter live rows only. Deletions come whatever the filter, because a deleted row no longer has a kind or status. A person's renamed name shows only when the row changes for another reason.

`GET /v1/findings` lists every topic. `is_finding` tells which are findings; a topic that stops being a finding changes, it does not vanish. Each inspection step also has a placeholder topic per element. Use `is_finding=true` if you only want findings.

## Example: yesterday's changes in Python

Uses `access_token()` from [Get an access token](/en/integrations/get-an-access-token/#python).

```python
import time
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo
import requests

API = "https://api.dev.whatsbuilt.fi/v1"

def collect(path: str, params: dict, token: str) -> tuple[list, str]:
    rows, cursor = [], None
    while True:
        query = dict(params, **({"cursor": cursor} if cursor else {}))
        answer = requests.get(f"{API}{path}", params=query, headers={"Authorization": f"Bearer {token}"}, timeout=60)
        if answer.status_code == 429:
            time.sleep(int(answer.headers.get("Retry-After", "5")))
            continue
        answer.raise_for_status()
        page = answer.json()
        rows += page["data"]
        cursor = page["next_cursor"]
        if cursor is None:
            return rows, page["window"]["modified_to"]

today = datetime.now(ZoneInfo("Europe/Helsinki")).replace(hour=0, minute=0, second=0, microsecond=0)
window = {"modified_from": (today - timedelta(days=1)).isoformat(), "modified_to": today.isoformat()}
token = access_token()
for path in ["/projects", "/elements", "/element-events", "/inspections", "/findings", "/finding-drafts",
             "/comments", "/viewpoints", "/finding-files", "/related-findings", "/labels", "/model-versions",
             "/carry-overs", "/reference-documents", "/inspection-plans", "/inspection-plan-elements", "/templates",
             "/check-lists", "/members", "/access-requests", "/zones", "/schedule-imports", "/schedule-tasks",
             "/maintenance-entries"]:
    rows, until = collect(path, window, token)
    deleted = [row for row in rows if row["deleted"]]
    print(f"{path}: {len(rows) - len(deleted)} changed, {len(deleted)} deleted, window ends {until}")
```

`requests` encodes the `+` of the offset for you. A token lasts 15 minutes; fetch a new one if a long run gets `401`.
