{
  "openapi": "3.1.0",
  "info": {
    "title": "WhatsBuilt API",
    "description": "The WhatsBuilt API lets your organisation's own systems, such as an ERP, a data platform or production control, read what changes in your projects, record deliveries and installations on elements, and propose findings.\n\n**Start with the guides:** [Create an integration](/en/integrations/create-an-integration/) · [Get an access token](/en/integrations/get-an-access-token/) · [Collect changes in a window](/en/integrations/collect-changes/) · [Record element events](/en/integrations/element-events/) · [Create finding drafts](/en/integrations/finding-drafts/) · [Integrations in another organisation's project](/en/integrations/other-organisations-projects/) · [Apps acting for a person](/en/integrations/apps-for-a-person/) · [Errors and limits](/en/integrations/errors-and-limits/) · [Changelog](/en/integrations/changelog/).\n\n## Base URL and access\n\n- Production `https://api.whatsbuilt.fi/v1`, test `https://api.test.whatsbuilt.fi/v1`, dev `https://api.dev.whatsbuilt.fi/v1`.\n- An organisation admin creates an *integration* on *Integrations* in the app, chooses its projects and permissions, and registers its public key. The integration gets a token from `POST /oauth/token` with the client credentials grant and a client assertion signed with its private key (`private_key_jwt`, ES256 or RS256). The token lasts 15 minutes and has no refresh token: ask for a new one.\n- An *app acting for a person* is registered by WhatsBuilt. A person signs in to WhatsBuilt and approves it; the app uses the authorization code grant with PKCE (S256) at `GET /oauth/authorize` and `POST /oauth/token`. Its token `wba_at_…` lasts an hour and acts as the person, never beyond the person's own rights; with `offline_access` it gets a rotating refresh token. A confidential app authenticates with `private_key_jwt`, a public one sends only its `client_id`. The connection lasts 90 days for a confidential app and 30 for a public one; `POST /oauth/revoke` ends it.\n- Send the token as `Authorization: Bearer wbi_at_…` or `wba_at_…`. A token works only on `/v1`.\n- The API returns exactly what the integration's projects show: the projects on its list in its own organisation, and the projects of other organisations whose project admins added it. A project whose owning organisation has turned the API off is named in `skipped_projects` with `PUBLIC_API_DISABLED`.\n\n## Conventions\n\n- JSON with `snake_case` names.\n- Times in answers are RFC 3339 in UTC with microseconds, e.g. `2026-11-17T08:14:03.512844+00:00`.\n- Times you send are RFC 3339 with an offset: `Z` or `±hh:mm`, lower-case `t` and `z` accepted, up to 9 fractional digits. Digits past microseconds are dropped (floored). 10 or more fractional digits, a time without an offset and a date that does not exist answer 400 `VALIDATION_ERROR`.\n- Every item of a windowed list has `changed_at` and `deleted`.\n- Errors are `{ \"error\", \"code\", \"details\", \"request_id\" }`. `code` is part of the contract; `error` is a sentence for people and may change.\n\n## Compatibility\n\n`/v1` changes only by addition: new endpoints, new optional parameters, new fields and new enum values (event kinds, deletion reasons, statuses). **Your client must ignore fields and enum values it does not know.** A breaking change opens `/v2`; `/v1` then answers with `Deprecation` and `Sunset` headers and keeps working for at least 12 months. Every change is on the [changelog](/en/integrations/changelog/).\n\n## Lists and windows\n\nEvery list under *Changes*, such as `GET /v1/elements`, takes a modification window `[modified_from, modified_to)` and returns the rows created, changed and deleted in it. Other reads that answer several rows, such as listStoreys, listIntegrations or listExportJobs, are snapshots: read when asked, without a window or deletions.\n\n- `modified_from` is inclusive, `modified_to` exclusive, so consecutive windows meet without a gap or an overlap.\n- The server clamps `modified_to` to the *settled time*: at least 5 seconds behind the database clock, and before the start of any write transaction still open, so no row can later appear in a window already read. `window.modified_to` in the answer is the bound used; start your next window there, never at your own clock.\n- Rows come in `(project_id, changed_at, key)` order, live rows and deletions in one stream. Upsert by the key.\n- `limit` is 1–1000, default 200; a page also stops at 2,000,000 bytes. A page may hold fewer rows than `limit`, even none, while more follow. Only `next_cursor: null` ends a list.\n- Pass `next_cursor` as `cursor` with the same other parameters. A cursor with other parameters answers 400 `INVALID_CURSOR`.\n- A deleted row comes as `deleted: true` with its key, `project_id`, `changed_at` (the deletion time) and `reason`.\n- Without `modified_from` a list returns every live row and no deletions: the initial load. Its `window.modified_to` is where your first window starts.\n- Deletions are kept for 400 days. A window that starts earlier answers 422 `WINDOW_BEFORE_RETENTION` with `details.oldest_from`; load again without a window.\n- When a project appears in `GET /v1/projects` as changed, or leaves `skipped_projects`, load that project without a window (`project_id=…`, no `modified_from`): its older rows keep their older `changed_at`.\n\n## Limits\n\n120 requests a minute per integration or app connection, with `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` on every answer to a valid token and 429 `RATE_LIMITED` with `Retry-After` above it. The token endpoint takes 30 requests a minute per integration.\n\n## Not in /v1\n\n`/v1` has a counterpart for every operation a person can do in the WhatsBuilt app. What it leaves out is left out on purpose:\n\n- **The app's own drawings.** The floor plan and the 3D viewer's geometry are derived from the model. `/v1` gives the IFC file (getModelVersionIfc) and each element's `origin` (listElements) instead.\n- **A person's own sign-in, settings and access.** Signing in, the interface language, leaving a project, asking for access for oneself, and the person's own app and AI assistant connections. Approving an app that acts for a person, and the organisation admin's control over such apps (removing their connections and limiting their scopes), are also done only in WhatsBuilt.\n- **Messages to WhatsBuilt support.**\n- **Change notifications (webhooks).** [Collect changes in a window](/en/integrations/collect-changes/) on a schedule instead.\n\nThe [changelog](/en/integrations/changelog/) lists what each release adds. The limits of BCF clients and of exports are on [Not available yet](/en/integrations/not-available-yet/).",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.whatsbuilt.fi",
      "description": "Production"
    },
    {
      "url": "https://api.test.whatsbuilt.fi",
      "description": "Test"
    },
    {
      "url": "https://api.dev.whatsbuilt.fi",
      "description": "Development"
    }
  ],
  "paths": {
    "/v1/access-requests": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Access requests to projects, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `projects:read`, and lists only projects where the integration is an admin (which `members:write` gives); elsewhere the list is empty. `status` is `pending`, `approved` or `denied`, and filters live rows only. Approve or deny with approveAccessRequest and denyAccessRequest.",
        "operationId": "listAccessRequests",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "approved",
                "denied"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessRequestPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:read"
            ]
          }
        ]
      }
    },
    "/v1/carry-overs": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Carry-overs changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `models:read`. A carry-over moved the data of a removed element (`from_global_id`, which stays archived) to a live one (`to_global_id`); an undone one is a change with `undone_at`. Deleting the model keeps its carry-overs: each is a change with `model_deleted` true and the element names kept. `batch_id` filters live rows only. Names (`applied_by_name`, `undone_by_name`) are read when answering. A project whose organisation does not use carry-over is in `skipped_projects` with FEATURE_OFF.",
        "operationId": "listCarryOvers",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "batch_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarryOverPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/check-lists": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "The project's check lists with their current version, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. A new version changes the check list. getCheckList has every version; the organisation's own lists are read with it too.",
        "operationId": "listCheckLists",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckListPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/comments": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Comments on findings, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `guid`. Needs `findings:read`. A comment deleted on its own comes as a deletion; a deleted finding implies its comments. `author_name` is read when answering.",
        "operationId": "listComments",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      }
    },
    "/v1/element-events": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Element events changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `elements:read`. Kinds today: `delivered`, `received_on_site`, `installed`; more may come. A voided event is a change with `voided_at`, not a deletion. Deleting the model keeps its events: each is a change with `model_deleted` true and the element name kept. `kind` filters live rows only; deletions come whatever the filter. Projects whose organisation lacks the `takt` feature are in `skipped_projects` with `FEATURE_OFF`. Names (`recorded_by_name`, `voided_by_name`) are read when answering; a rename alone moves no `changed_at`.",
        "operationId": "listElementEvents",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "delivered",
                "received_on_site",
                "installed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElementEventPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/elements": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Elements changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `project_id` + `global_id` (the IFC GlobalId). An element changes when a listed field changes; a new model version that leaves them alone moves nothing. An archived element is a change with `archived_at`, not a deletion. A deleted element implies its element events.",
        "operationId": "listElements",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElementPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/finding-drafts": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Finding drafts changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. The drafts the integration created; with the inspector role (from `element-events:write`) it sees every draft of the project. `status` is `pending`, `published` with the finding's `topic_guid`, or `rejected`, and filters live rows only.",
        "operationId": "listFindingDrafts",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "published",
                "rejected"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingDraftPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      }
    },
    "/v1/finding-files": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Model files findings refer to, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `findings:read`. setFindingFiles replaces a finding's files: the old ones come as deletions and the new ones with new ids. A deleted finding implies its files.",
        "operationId": "listFindingFiles",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingFilePage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      }
    },
    "/v1/findings": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Topics with is_finding, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `guid`. Every topic is listed, including the placeholder topics of inspection steps; `is_finding` says which are findings, so a topic that stops being a finding is seen changing, not vanishing. `elements` are the GlobalIds of the topic's first viewpoint. A step result change changes its topic. `is_finding` filters live rows only; deletions come whatever the filter. A deleted topic implies its comments and viewpoints.",
        "operationId": "listFindings",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "is_finding",
            "in": "query",
            "description": "Only findings (true) or only other topics (false)",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Only findings (true) or only other topics (false)",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      }
    },
    "/v1/handover-requests/incoming": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "Handover requests waiting for the integration's organisation",
        "description": "Needs `organisation:admin`. The pending requests other organisations sent to this one; the whole list in one answer.",
        "operationId": "listIncomingHandovers",
        "responses": {
          "200": {
            "description": "Pending requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingHandoverRequestList"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation; FEATURE_OFF when the organisation does not use handovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/handover-requests/{requestId}/accept": {
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Accept a handover: the project moves to the integration's organisation",
        "description": "Needs `organisation:admin`; an attesting operation, warned in the scope picker. The project, its members and records move; templates, check lists, fail-reason lists and documents are copied or moved. The request names the integration as the one who decided.",
        "operationId": "acceptHandover",
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Optional; an empty body accepts now",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptHandoverRequestBody"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "The accepted handover",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedHandoverRequest"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation; FEATURE_OFF when the organisation does not use handovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such pending request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The request is no longer pending, or the project changed; HANDOVER_NAME_TAKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/handover-requests/{requestId}/reject": {
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Reject a handover request",
        "operationId": "rejectHandover",
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Rejected"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation; FEATURE_OFF when the organisation does not use handovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such pending request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/inspection-plan-elements": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Elements added to or excluded from plans, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `element_key`, `{plan_id}:{global_id}`. `kind` is `added` (outside the plan's filter, picked by hand) or `excluded` (inside it, left out). The elements the filter covers are not listed: listInspectionPlanScope resolves them.",
        "operationId": "listInspectionPlanElements",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanElementPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/inspection-plans": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Inspection plans changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Draft plans are for the admin role. A change to the assignees changes the plan. `scope` is the filter; the hand-picked and excluded elements are in listInspectionPlanElements. `status` filters live rows only. A deleted plan implies its plan elements.",
        "operationId": "listInspectionPlans",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "active",
                "completed",
                "archived"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/inspections": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Inspections with their steps and checks, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Steps come in the template's order, each with its checks; a change to a step or a check changes the inspection. `status` filters live rows only; deletions come whatever the filter. `inspected_by_name` is read when answering.",
        "operationId": "listInspections",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "not_started",
                "in_progress",
                "completed",
                "failed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/integrations": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "summary": "The organisation's integrations",
        "operationId": "listIntegrations",
        "responses": {
          "200": {
            "description": "Integrations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Organisation"
        ],
        "summary": "Create an integration",
        "description": "Its scopes and projects can only be ones the calling integration holds itself (SCOPE_NOT_HELD, PROJECTS_NOT_HELD). Register its public key with addIntegrationKey.",
        "operationId": "createIntegration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewIntegration"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The integration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDetails"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR; INTEGRATION_PROJECT_UNAVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "summary": "One of the organisation's integrations",
        "operationId": "getIntegration",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The integration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Organisation"
        ],
        "summary": "Change an integration's name, scopes or projects",
        "description": "Not the calling integration itself or one up its creator chain (INTEGRATION_SELF). Every scope and project the integration has after the change must be the caller's own, so a weaker caller changes a stronger integration only by also taking away the scopes it lacks; it can disable or revoke it.",
        "operationId": "updateIntegration",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The integration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}/calls": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "summary": "An integration's API calls of the last 90 days",
        "operationId": "listIntegrationCalls",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50,
              "maximum": 200,
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0,
              "maximum": 100000,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calls, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationCallList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}/changes": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "summary": "Who changed an integration, and how",
        "operationId": "listIntegrationChanges",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50,
              "maximum": 200,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Changes, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationChangeList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}/disable": {
      "post": {
        "tags": [
          "Organisation"
        ],
        "summary": "Disable an integration: its next call is refused until it is enabled",
        "description": "Not the calling integration itself or one up its creator chain (INTEGRATION_SELF).",
        "operationId": "disableIntegration",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The integration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}/enable": {
      "post": {
        "tags": [
          "Organisation"
        ],
        "summary": "Enable a disabled integration; only one whose scopes and projects the caller holds, and none on another organisation's project",
        "description": "Not the calling integration itself or one up its creator chain (INTEGRATION_SELF).",
        "operationId": "enableIntegration",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The integration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}/keys": {
      "post": {
        "tags": [
          "Organisation"
        ],
        "summary": "Register a public key for an integration",
        "description": "A JWK or PEM public key; a private key is refused. At most two live keys. Not for the calling integration itself, and only for an integration whose scopes and projects the caller holds and that is on no other organisation's project, since the key lets its holder act as it.",
        "operationId": "addIntegrationKey",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewIntegrationKey"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationKey"
                }
              }
            }
          },
          "400": {
            "description": "PRIVATE_KEY_REFUSED; INTEGRATION_KEY_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}/keys/{kid}": {
      "delete": {
        "tags": [
          "Organisation"
        ],
        "summary": "Revoke an integration's key and the tokens it minted",
        "description": "Not a key of the calling integration or of one up its creator chain (INTEGRATION_SELF).",
        "operationId": "revokeIntegrationKey",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "kid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}/other-projects/{projectId}": {
      "delete": {
        "tags": [
          "Organisation"
        ],
        "summary": "Take an integration out of another organisation's project",
        "operationId": "leaveOtherOrganisationProject",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The integration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/integrations/{clientId}/revoke": {
      "post": {
        "tags": [
          "Organisation"
        ],
        "summary": "Revoke an integration for good: its tokens and projects end",
        "description": "Not the calling integration itself or one up its creator chain (INTEGRATION_SELF).",
        "operationId": "revokeIntegration",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The integration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE; INTEGRATION_SELF when the integration acts on itself or on an integration up its creator chain; SCOPE_NOT_HELD or PROJECTS_NOT_HELD when the integration created, changed, given a key or enabled would hold a scope or project the caller lacks; INTEGRATION_ON_OTHER_PROJECTS for a key or enable on an integration another organisation's project admitted; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such integration in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_REVOKED; INTEGRATION_KEY_LIMIT; INTEGRATION_KEY_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/labels": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "QR labels changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `elements:read`. `element_global_id` is the element a label is on. A scan moves only `first_scanned_at` and `status`, the first time. A deleted label comes as a deletion; a retired one is a change with `status: retired`. `status` filters live rows only.",
        "operationId": "listLabels",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unassigned",
                "assigned",
                "active",
                "retired"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabelPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/maintenance-entries": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Maintenance entries changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `maintenance:read`. Entries are written while a project is in maintenance; a change to an entry is a change. `log_type` and `global_id` filter live rows only. Projects whose organisation lacks the maintenance phase are in `skipped_projects` with `FEATURE_OFF`. `created_by_name` is read when answering; a rename alone moves no `changed_at`.",
        "operationId": "listMaintenanceEntries",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "log_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "routine_check",
                "repair",
                "replacement",
                "incident",
                "certification"
              ]
            }
          },
          {
            "name": "global_id",
            "in": "query",
            "description": "One element's entries",
            "required": false,
            "schema": {
              "type": "string",
              "description": "One element's entries",
              "maxLength": 64,
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaintenanceEntryPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "maintenance:read"
            ]
          }
        ]
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The principal the token acts as",
        "description": "Any valid token may call it, whatever its scopes. Use it to check a new token.",
        "operationId": "getMe",
        "responses": {
          "200": {
            "description": "The principal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicMe"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The principal no longer exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": []
          }
        ]
      }
    },
    "/v1/members": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "People on projects, changed or removed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `project_id` + `user_id`. Needs `projects:read`. People only: an integration on a project is never listed here (see listProjectIntegrations). A role change is a change; a removal comes as a deletion. `name`, `email` and `account_name` are read when answering; a rename alone moves no `changed_at`.",
        "operationId": "listMembers",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:read"
            ]
          }
        ]
      }
    },
    "/v1/model-versions": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Model versions changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `models:read`. One row per uploaded IFC file: every version of a model shares `model_id`, and the highest complete `version` is the model's current one. A version changes as its ingest moves from `pending` through `processing` to `complete` or `failed`; `diff` compares it with the previous version. A deleted model comes as a deletion of each of its versions. `status` and `model_id` filter live rows only.",
        "operationId": "listModelVersions",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "processing",
                "complete",
                "failed"
              ]
            }
          },
          {
            "name": "model_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelVersionPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/organisation": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "summary": "The integration's organisation and its settings",
        "operationId": "getOrganisation",
        "responses": {
          "200": {
            "description": "The organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organisation"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:read"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Organisation"
        ],
        "summary": "Change the organisation's settings",
        "description": "The default language, the GS1 company prefix, and whether AI assistants and the REST API are on. Each field sent is set; the rest stay. Turning `mcp_enabled` off ends every AI assistant connection of the organisation; sending its current value changes nothing.",
        "operationId": "updateOrganisation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organisation"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR; GS1_PREFIX_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/analytics": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "summary": "The organisation's usage: product events counted by day",
        "description": "What the organisation's admins see on the usage page: each event with its count in `[from, to)`, and per UTC day. Default: the last 30 days. Needs an integration that is an admin of its organisation.",
        "operationId": "getOrganisationAnalytics",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Inclusive; default 30 days before `to`",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Exclusive; default now",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationUsage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed time, or `to` before `from`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/check-lists": {
      "get": {
        "tags": [
          "Library"
        ],
        "summary": "The organisation's own check lists",
        "operationId": "listOrganisationCheckLists",
        "responses": {
          "200": {
            "description": "Check lists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckLists"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Library"
        ],
        "summary": "Create a check list in the organisation's library",
        "description": "A repeat with the same Idempotency-Key and body returns the first check list with 200; another body answers 422. Once it is deleted, the key answers 410 RESOURCE_DELETED and makes nothing.",
        "operationId": "createOrganisationCheckList",
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewCheckList"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The check list an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationCheckList"
                }
              }
            }
          },
          "201": {
            "description": "The check list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationCheckList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/check-lists/{id}": {
      "get": {
        "tags": [
          "Library"
        ],
        "summary": "One of the organisation's check lists with its items",
        "operationId": "getOrganisationCheckList",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The check list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationCheckList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Library"
        ],
        "summary": "Change one of the organisation's check lists",
        "description": "Changing the items makes a new version; checks already recorded keep the version they were recorded against.",
        "operationId": "updateOrganisationCheckList",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckListChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The check list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationCheckList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The check list changed meanwhile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Library"
        ],
        "summary": "Delete one of the organisation's check lists",
        "operationId": "deleteOrganisationCheckList",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A template step uses the check list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/fail-reason-lists": {
      "get": {
        "tags": [
          "Library"
        ],
        "summary": "The organisation's fail-reason lists",
        "operationId": "listOrganisationFailReasonLists",
        "responses": {
          "200": {
            "description": "Fail-reason lists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationFailReasonLists"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Not available yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Library"
        ],
        "summary": "Create a fail-reason list",
        "description": "\"Other\" is always offered and is never on a list. A repeat with the same Idempotency-Key and body returns the first list with 200; another body answers 422. Once it is deleted, the key answers 410 RESOURCE_DELETED and makes nothing.",
        "operationId": "createOrganisationFailReasonList",
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewFailReasonList"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The list an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationFailReasonList"
                }
              }
            }
          },
          "201": {
            "description": "The list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationFailReasonList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The organisation has its maximum of lists, or the name is taken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Not available yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/fail-reason-lists/{id}": {
      "put": {
        "tags": [
          "Library"
        ],
        "summary": "Change a fail-reason list",
        "operationId": "updateOrganisationFailReasonList",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FailReasonListChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationFailReasonList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The name is taken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Not available yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Library"
        ],
        "summary": "Delete a fail-reason list",
        "operationId": "deleteOrganisationFailReasonList",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A template uses the list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Not available yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/reference-documents": {
      "post": {
        "tags": [
          "Library"
        ],
        "summary": "Record an uploaded reference document for the organisation's templates",
        "description": "Checks that the upload finished and is a PDF, and records it for the organisation; attach it with an organisation template write. Sending the same `key` again returns the same document with 200, so a repeat needs no Idempotency-Key.",
        "operationId": "createOrganisationReferenceDocument",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferenceDocumentBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The document this key was recorded as before",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationReferenceDocument"
                }
              }
            }
          },
          "201": {
            "description": "The document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationReferenceDocument"
                }
              }
            }
          },
          "400": {
            "description": "DOCUMENT_UPLOAD_INCOMPLETE, DOCUMENT_CONTENT_MISMATCH, DOCUMENT_TOO_LARGE or a key of another organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/reference-documents/uploads": {
      "post": {
        "tags": [
          "Library"
        ],
        "summary": "Start an upload of a reference document for the organisation's templates",
        "description": "Answers a presigned PUT for one PDF. Upload it, then call createOrganisationReferenceDocument with the `key`. Needs an integration that is an admin of its organisation.",
        "operationId": "uploadOrganisationReferenceDocument",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferenceDocumentUploadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Where to upload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceDocumentUpload"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR, DOCUMENT_TYPE_NOT_ALLOWED or DOCUMENT_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/reference-documents/{documentId}": {
      "delete": {
        "tags": [
          "Library"
        ],
        "summary": "Delete an organisation reference document no template has",
        "description": "As deleteReferenceDocument, for a document of the organisation's templates: 409 DOCUMENT_IN_USE while a template has it.",
        "operationId": "deleteOrganisationReferenceDocument",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DOCUMENT_IN_USE: a template still has the document; details.template_ids names them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/reference-documents/{documentId}/file": {
      "get": {
        "tags": [
          "Library"
        ],
        "summary": "Download a reference document of the organisation's templates",
        "description": "Redirects (302) to a download address that is valid for 15 minutes. Organisation templates name their documents by id.",
        "operationId": "getOrganisationReferenceDocumentFile",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the PDF"
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/organisation/sso": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "summary": "The organisation's single sign-on",
        "operationId": "getSso",
        "responses": {
          "200": {
            "description": "SSO",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoSettings"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Organisation"
        ],
        "summary": "Set the organisation's single sign-on and its e-mail domains",
        "description": "SAML only: an OIDC configuration answers 400 SSO_OIDC_UNSUPPORTED and changes nothing, because sign-in runs on Cognito, which gets no OIDC identity provider. A domain another organisation signs in with answers 409. People of the domains sign in through the identity provider from then on.",
        "operationId": "setSso",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoConfiguration"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "SSO",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoSettings"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body; SSO_OIDC_UNSUPPORTED: OIDC single sign-on is not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SSO_DOMAIN_TAKEN: a domain belongs to another organisation; SSO_IDP_NAME_TAKEN: the identity provider name belongs to another organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The identity provider could not be reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Organisation"
        ],
        "summary": "Turn single sign-on off",
        "operationId": "removeSso",
        "responses": {
          "200": {
            "description": "SSO",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoSettings"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SSO_IDP_REMOVE_BLOCKED: the identity provider name belongs to another organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The identity provider could not be reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/templates": {
      "get": {
        "tags": [
          "Library"
        ],
        "summary": "The organisation's own inspection templates",
        "operationId": "listOrganisationTemplates",
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationTemplates"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Library"
        ],
        "summary": "Create a template in the organisation's library",
        "description": "Every project of the organisation can use it. Step check lists and fail-reason lists are the organisation's own. A repeat with the same Idempotency-Key and body returns the first template with 200; another body answers 422. Once it is deleted, the key answers 410 RESOURCE_DELETED and makes nothing.",
        "operationId": "createOrganisationTemplate",
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewOrganisationTemplate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The template an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationTemplate"
                }
              }
            }
          },
          "201": {
            "description": "The template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationTemplate"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR; FAIL_REASON_LIST_NOT_USABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/templates/{id}": {
      "get": {
        "tags": [
          "Library"
        ],
        "summary": "One of the organisation's templates with its steps",
        "operationId": "getOrganisationTemplate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Library"
        ],
        "summary": "Change one of the organisation's templates",
        "description": "Inspections already opened keep the steps they started with. A change still being saved 25 seconds after the request arrived answers 400 VALIDATION_ERROR with the reason TIME_LIMIT in `details` and writes nothing: send fewer step changes at a time. A change whose added plus removed steps times the inspections that use the template exceed 30 000 answers 400 VALIDATION_ERROR with the reason TOO_LARGE in `details` at once, also writing nothing.",
        "operationId": "updateOrganisationTemplate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganisationTemplateChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganisationTemplate"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The template changed meanwhile, or a removed step has results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Library"
        ],
        "summary": "Delete one of the organisation's templates",
        "operationId": "deleteOrganisationTemplate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not one of the organisation's own; a project's answers 404 here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Inspections or plans use the template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/users": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "summary": "The organisation's people",
        "description": "People only: integrations are never listed. Newest first, `limit` and `offset` page through.",
        "operationId": "listUsers",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100,
              "maximum": 500,
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "People",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Organisation"
        ],
        "summary": "Invite a person to the organisation",
        "description": "The person gets an invitation e-mail and chooses their own password; the API never sets one. An address that already has a user answers 409. An integration's address is refused. A repeat with the same Idempotency-Key and body returns the first person with 200; another body answers 422. Once it is deleted, the key answers 410 RESOURCE_DELETED and makes nothing.",
        "operationId": "createUser",
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewPerson"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The person an earlier call with the same Idempotency-Key invited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Person"
                }
              }
            }
          },
          "201": {
            "description": "Invited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedPerson"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR; INVALID_EMAIL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "EMAIL_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/users/{userId}": {
      "delete": {
        "tags": [
          "Organisation"
        ],
        "summary": "Remove a person from the organisation",
        "description": "Refused while the person is the only member of a project, or the organisation's only person admin. Their records stay without their name.",
        "operationId": "deleteUser",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "USER_SOLE_PROJECT_MEMBER; LAST_ADMIN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Organisation"
        ],
        "summary": "Change a person's name or organisation role",
        "description": "A person of the organisation only; an integration's id answers 404.",
        "operationId": "updateUser",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The person",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Person"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "LAST_ADMIN: the organisation's only person admin keeps the role",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/users/{userId}/require-password-change": {
      "post": {
        "tags": [
          "Organisation"
        ],
        "summary": "Lock a person's password until it is reset",
        "description": "As *Force Password Change* in the app: the current password stops working at once and no e-mail is sent. The person signs in again after resetUserPassword e-mails them a new temporary password, which they change at sign-in. The API never sees a password.",
        "operationId": "requirePasswordChange",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordChangeRequired"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/organisation/users/{userId}/reset-password": {
      "post": {
        "tags": [
          "Organisation"
        ],
        "summary": "Send a person a password reset e-mail",
        "operationId": "resetUserPassword",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetSent"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found in the organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/projects": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Projects the principal reaches, changed or lost in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. A project counts as changed at the later of its own change and the integration's membership, so a project added to the integration shows as changed: load it again without a window. A project the integration lost comes once as `reason: access_removed`; drop its data. A deleted project comes as `deleted` to an organisation admin who had no membership. A deleted project implies its elements, inspections and findings: they get no deletions of their own.",
        "operationId": "listProjects",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Create a project in the integration's organisation",
        "description": "Needs `organisation:admin`. The integration is not the project's owner: it reaches the project as its organisation's admin. A repeat with the same Idempotency-Key and body returns the first project with 200; another body answers 422. The key stays bound to that project: once it is deleted, the key answers 410 RESOURCE_DELETED and makes nothing.",
        "operationId": "createProject",
        "parameters": [
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewProjectBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The project an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDetails"
                }
              }
            }
          },
          "201": {
            "description": "The project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation; FEATURE_OFF when the organisation does not use handovers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, event or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "One project with its settings",
        "operationId": "getProject",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Projects"
        ],
        "summary": "Delete a project and everything in it",
        "description": "Needs `organisation:admin`, and the project must belong to the integration's organisation. Cannot be undone. The project answers 404 at once and its data is removed in the background. The project comes as a deletion in listProjects once it is removed; its elements, inspections and findings get no deletions of their own.",
        "operationId": "deleteProject",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE for another organisation's project the integration is not on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project; also another organisation's project the integration is on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "organisation:admin"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Projects"
        ],
        "summary": "Rename a project or change its settings",
        "description": "Needs the admin role on the project, which `projects:write` gives. `handoff_approval` answers 403 FEATURE_OFF where the organisation does not use the takt board.",
        "operationId": "updateProject",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectChangesBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/access-requests/{requestId}/approve": {
      "post": {
        "tags": [
          "People"
        ],
        "summary": "Approve an access request: the person becomes a viewer",
        "description": "Only a pending request; another answers 404. The request comes as a change in listAccessRequests.",
        "operationId": "approveAccessRequest",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approved"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the integration is not the project's admin, or the role is above its own; MEMBER_EXTERNAL_ADD_FORBIDDEN when the project is another organisation's; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or pending request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/access-requests/{requestId}/deny": {
      "post": {
        "tags": [
          "People"
        ],
        "summary": "Deny an access request",
        "description": "Only a pending request; another answers 404. The request comes as a change in listAccessRequests.",
        "operationId": "denyAccessRequest",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Denied"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the integration is not the project's admin, or the role is above its own; MEMBER_EXTERNAL_ADD_FORBIDDEN when the project is another organisation's; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or pending request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/bcf": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The project's findings as a BCF 3.0 archive",
        "description": "A ZIP of every topic of the project with its comments, viewpoints and photos. Needs the project admin role, as the app's BCF export. At most 20 exports a project an hour, shared with WhatsBuilt (429). Lists in a window are lighter for keeping a copy in step.",
        "operationId": "exportFindingsBcf",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BCF ZIP archive",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "A ZIP archive, as bytes."
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters; EXPORT_TOO_LARGE when the archive would not fit one answer. Collect the findings with GET /v1/projects/{projectId}/findings instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Import a BCF archive into the project",
        "description": "A topic with a new guid becomes a finding; one whose guid is in the project updates that finding's fields, and its comments and viewpoints are added or updated by guid. A guid of another project is skipped and named in `errors`. Nothing is deleted. At most 5 imports a project an hour, shared with WhatsBuilt (429). An author named in the archive is kept; otherwise the integration is the author.",
        "operationId": "importFindingsBcf",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BcfUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What the import did",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BcfImportResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:delete"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/check-lists": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Create a check list in the project",
        "description": "Its items become version 1. A repeat with the same Idempotency-Key and body returns the first check list with 200.",
        "operationId": "createCheckList",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckListBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The check list an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckList"
                }
              }
            }
          },
          "201": {
            "description": "The check list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or check list, or the check list is the organisation's own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/check-lists/{checkListId}": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "One check list with its versions",
        "description": "A check list of the project, or of its organisation, with `current_version` and a page of `versions`, newest first. A step result names the version it was recorded against; pass `next_before` as `versions_before` until it is null.",
        "operationId": "getCheckList",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "checkListId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versions_before",
            "in": "query",
            "description": "The next_before of the previous page",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2147483647,
              "minimum": 1
            }
          },
          {
            "name": "versions_limit",
            "in": "query",
            "description": "Versions per page, 1–100; a page also stops at about 2 MB",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The check list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckListWithVersions"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or check list, or the check list is the organisation's own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Delete a check list",
        "description": "A check list a template step names, or a result was recorded against, answers 409 CHECK_GROUP_IN_USE. It comes as a deletion in listCheckLists.",
        "operationId": "deleteCheckList",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "checkListId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or check list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "CHECK_GROUP_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:delete"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Writes"
        ],
        "summary": "Change a check list",
        "description": "A name or description changes the list itself. `items` that differ from the current version make a new version; steps pinned to an older version keep it.",
        "operationId": "updateCheckList",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "checkListId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCheckListBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The check list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or check list, or the check list is the organisation's own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "CHECK_GROUP_VERSION_CONFLICT: changed at the same moment; read it and send again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/deviations": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Failed checks, findings, returns and late installs of a date range, grouped or listed",
        "description": "Totals of the range and one page of groups, or with `by=deviation` one page of the deviations themselves; only `next_cursor = null` ends the pages. A snapshot read when asked, not a windowed list: it has no `changed_at` and no deletions; read it again for the current state.",
        "operationId": "getDeviationReport",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "First day, YYYY-MM-DD in Finnish time; 29 days before `to` by default",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Last day, YYYY-MM-DD in Finnish time; today by default",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Group by zone, organisation or element, or list each deviation",
              "default": "zone",
              "enum": [
                "zone",
                "organisation",
                "element",
                "deviation"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512,
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviationReportPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; FEATURE_OFF when the project's organisation does not use the takt board (zones, handoffs, deviations) or the schedule (schedule tasks, element facts); PUBLIC_API_DISABLED when it has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/deviations.csv": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Every deviation of a date range as a CSV file",
        "description": "The same CSV file as the app's export, one row per deviation; project admins only. A project writes at most 20 of these files an hour, from the app and /v1 together. A range too large to build within 20 seconds answers 400 VALIDATION_ERROR with the reason TIME_LIMIT in `details` and writes no file: page through getDeviationReport with `by=deviation` instead.",
        "operationId": "exportDeviationsCsv",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "First day, YYYY-MM-DD in Finnish time; 29 days before `to` by default",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Last day, YYYY-MM-DD in Finnish time; today by default",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV file",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "As above, and INSUFFICIENT_PROJECT_ROLE when the integration is not a project admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/element-counts": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Live elements counted by IFC type and by storey",
        "operationId": "getElementCounts",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "model_version_id",
            "in": "query",
            "description": "One model version (from listModelVersions); without it the current version of every model",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElementCounts"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter; INVALID_PROPERTY_FILTER for a property condition the filter cannot use",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/element-events": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Record one event of a kind on each listed element",
        "description": "Elements that already have a standing event of the kind, or that do not exist, come back in `refused` with their code. A repeat with the same Idempotency-Key and body returns the events the first call recorded and records nothing again. The body is the kind, the set of GlobalIds, load_ref and occurred_at; the same key with another body answers 422 IDEMPOTENCY_KEY_REUSED. A key binds a body only once its call has recorded an event.",
        "operationId": "recordElementEvents",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordElementEventsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Recorded and refused elements",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRecordedEvents"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, event or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "element-events:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/element-events/{eventId}": {
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Void an element event",
        "description": "The event stays in the history as voided. The recorder or a project admin may void it; a second void answers the voided event unchanged.",
        "operationId": "voidElementEvent",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "reason",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The voided event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicElementEvent"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, event or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "element-events:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/element-properties": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The property sets and properties the project's elements have",
        "description": "Each property with its type, how many elements have it and its most common values: what queryElements can filter on.",
        "operationId": "getElementProperties",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "model_version_id",
            "in": "query",
            "description": "One model version (from listModelVersions); without it the current version of every model",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElementPropertySummary"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter; INVALID_PROPERTY_FILTER for a property condition the filter cannot use",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/elements/query": {
      "post": {
        "tags": [
          "Integration"
        ],
        "summary": "Elements filtered by type, storey, name and property values",
        "description": "The filter of the app's element list. Live elements of the current models, or of one model version. A page holds at most `limit` elements; pass `next_cursor` as `cursor` with the same filter for the next.",
        "operationId": "queryElements",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ElementQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElementQueryPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter; INVALID_PROPERTY_FILTER for a property condition the filter cannot use",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/elements/{globalId}": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "One element with its properties",
        "description": "The element as listElements has it, with its property sets, the model version it was last read from and, for an archived element whose data was carried over, the element it went to. Its inspections, findings, events and maintenance entries are in their own lists.",
        "operationId": "getElement",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "globalId",
            "in": "path",
            "description": "The IFC GlobalId",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64,
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ElementDetail"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter; INVALID_PROPERTY_FILTER for a property condition the filter cannot use",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/export-jobs": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "The principal's export jobs of the project",
        "description": "The jobs this integration or person started in the last 7 days, newest first, at most 100. Another principal's jobs are never listed.",
        "operationId": "listExportJobs",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The jobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJobs"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE below the role the kind needs; FEATURE_OFF for report_pdf where the organisation lacks the PDF report; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "exports:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Exports"
        ],
        "summary": "Start an export or a report",
        "description": "`csv_topics`, `csv_assets`, `csv_inspections`: the app's CSV exports. `as_built_csv`: one row per element with its as-built dates. `report_md`: the inspection report in Markdown. `report_pdf`: the PDF report with each failed step's first photo (the organisation's PDF report). `handover`: the handover package, a ZIP of the BCF file, the CSV files, the report and the finding photos with manifest.json. Each kind needs the project role the app's export of it needs: admin for the CSV exports, as_built_csv and handover; inspector for report_pdf, and for report_md where the organisation has the PDF report, admin otherwise.\n\nAnswers 202 with the job; poll getExportJob until `status` is no longer `queued` or `running`, then download its files. Today the job is built within about 20 seconds while the call runs, a handover package up to 100 MB; a larger project answers `refused`, and so does a job that is not stored within 25 seconds. report_pdf draws from the project's 20 PDF reports an hour, handover from its 20 BCF exports an hour and as_built_csv from its 20 as-built files an hour, all shared with the app; the CSV exports draw from 20 an hour and report_md from 20 an hour (429). A refused or failed job gives its draw back. A repeat with the same Idempotency-Key and body returns the first job with 200; after a timeout or 503, repeat with the same key and read the job.",
        "operationId": "createExportJob",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewExportJob"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The job an earlier call with the same Idempotency-Key started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJob"
                }
              }
            }
          },
          "202": {
            "description": "The job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJob"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE below the role the kind needs; FEATURE_OFF for report_pdf where the organisation lacks the PDF report; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, job or template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "exports:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/export-jobs/{jobId}": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "One export job",
        "operationId": "getExportJob",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "description": "The job's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJob"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE below the role the kind needs; FEATURE_OFF for report_pdf where the organisation lacks the PDF report; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "exports:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/export-jobs/{jobId}/download": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "A link to one file of a done export job",
        "description": "Ask for the link when you start the download; it is signed now. A broken download asks for a new link. Needs the role the job's kind needs, as createExportJob.",
        "operationId": "getExportJobFile",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "description": "The job's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "file",
            "in": "query",
            "description": "The file's place in `files`, from 0",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportFileLink"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE below the role the kind needs; FEATURE_OFF for report_pdf where the organisation lacks the PDF report; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "EXPORT_NOT_DONE: the job has no files yet, or was refused or failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "EXPORT_EXPIRED: the files are gone; start the export again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "exports:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/fail-reason-lists": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The fail-reason lists the project's templates may name",
        "description": "The owning organisation's lists, whole and without a window: they are few, and the organisation's admins edit them.",
        "operationId": "listFailReasonLists",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The lists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailReasonLists"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/finding-drafts": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Create a finding draft for the project's inspectors to publish or reject",
        "description": "A project holds at most 500 pending drafts; above that the answer is 409 DRAFT_LIMIT. A repeat with the same Idempotency-Key and body returns the first draft with 200.",
        "operationId": "createFindingDraft",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 500,
                    "minLength": 1
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 20000
                  },
                  "priority": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 255
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255,
                      "minLength": 1
                    },
                    "maxItems": 100
                  },
                  "element_global_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 64,
                      "minLength": 1
                    },
                    "description": "GlobalIds of live elements in the project; the published finding selects them",
                    "maxItems": 100
                  },
                  "storey_global_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The storey a point is on, when no element fits (spec 054 §3.8)",
                    "maxLength": 64,
                    "minLength": 1
                  },
                  "point": {
                    "oneOf": [
                      {
                        "type": "object",
                        "required": [
                          "x",
                          "y",
                          "z"
                        ],
                        "properties": {
                          "x": {
                            "type": "number",
                            "format": "double",
                            "exclusiveMaximum": 10000000,
                            "exclusiveMinimum": -10000000
                          },
                          "y": {
                            "type": "number",
                            "format": "double",
                            "exclusiveMaximum": 10000000,
                            "exclusiveMinimum": -10000000
                          },
                          "z": {
                            "type": "number",
                            "format": "double",
                            "exclusiveMaximum": 10000000,
                            "exclusiveMinimum": -10000000
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Metres in the model's coordinates, z at the storey's floor; each within ±10000000 m"
                  },
                  "source_ref": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Your own id for the draft, shown to the inspector",
                    "maxLength": 128,
                    "minLength": 1
                  },
                  "photo_keys": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 1024,
                      "minLength": 1
                    },
                    "description": "Up to 10 keys from uploadDraftPhoto, each uploaded before the draft is created",
                    "maxItems": 10
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The draft an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingDraftCreated"
                }
              }
            }
          },
          "201": {
            "description": "The draft",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingDraftCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, event or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DRAFT_LIMIT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "finding-drafts:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/finding-drafts/photos": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "An address to upload one photo to",
        "description": "PUT the image to `upload_url` with the returned headers within 15 minutes, then pass `photo_key` to createFindingDraft as `photo_keys`. PNG or JPEG, at most 20 MB.",
        "operationId": "uploadDraftPhoto",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhotoUploadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The upload address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhotoUpload"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "finding-drafts:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/finding-drafts/{draftId}/publish": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Publish a pending draft as a finding",
        "description": "The integration becomes the finding's author; its first comment names the integration that made the draft. The draft's photos become the finding's photos. A decided draft answers 409 DRAFT_DECIDED.",
        "operationId": "publishFindingDraft",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "draftId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecideDraftBody"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "The published draft and its finding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishedDraft"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DRAFT_DECIDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/finding-drafts/{draftId}/reject": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Reject a pending draft",
        "description": "The draft stays listed as rejected and never becomes a finding. A decided draft answers 409 DRAFT_DECIDED.",
        "operationId": "rejectFindingDraft",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "draftId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The rejected draft",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingDraftCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DRAFT_DECIDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/finding-values": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The project's values for a finding's status, priority, type, stage and labels",
        "description": "The values the app offers on the project's findings. Send `topic_status`, `priority`, `topic_type` and `stage` as one of them.",
        "operationId": "getFindingValues",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The values",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingValues"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed project id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Create a finding",
        "description": "Authored by the integration, shown as *Integraatio · {name}*. `element_global_ids`, or a `storey_global_id` with an optional `point`, add a viewpoint that selects them. The guid comes from the Idempotency-Key when one is sent; a repeat with the same key and body returns the first finding with 200.",
        "operationId": "createFinding",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFindingBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The finding an earlier call with the same Idempotency-Key wrote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Finding"
                }
              }
            }
          },
          "201": {
            "description": "The finding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Finding"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings/{guid}": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "One finding",
        "description": "The same item `listFindings` returns.",
        "operationId": "getFinding",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The finding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Finding"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Delete a finding",
        "description": "Deletes the finding with its comments, viewpoints, files and relations. It comes as a deletion in `listFindings`, which implies its comments and viewpoints. The call log keeps the finding's guid. It cannot be undone.",
        "operationId": "deleteFinding",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:delete"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Writes"
        ],
        "summary": "Change a finding's fields or status",
        "description": "Only the fields sent change; closing is `topic_status: Closed`. A repeat with the same body changes nothing more.",
        "operationId": "updateFinding",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFindingBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The finding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Finding"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings/{guid}/comments": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Comment on a finding",
        "description": "Authored by the integration. A repeat with the same Idempotency-Key and body returns the first comment with 200.",
        "operationId": "createComment",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FindingCommentBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The comment an earlier call with the same Idempotency-Key wrote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                }
              }
            }
          },
          "201": {
            "description": "The comment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings/{guid}/comments/{commentGuid}": {
      "patch": {
        "tags": [
          "Writes"
        ],
        "summary": "Edit a comment",
        "description": "Changes the text or the viewpoint it points at. Editing the text of a verdict comment makes it a plain comment.",
        "operationId": "updateComment",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "commentGuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FindingCommentChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The comment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings/{guid}/files": {
      "put": {
        "tags": [
          "Writes"
        ],
        "summary": "Replace the model files a finding refers to",
        "description": "BCF 3.0 §3.3: the list replaces the finding's files. Each replaced file comes as a deletion in `listFindingFiles`.",
        "operationId": "setFindingFiles",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetFindingFilesBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The finding's files",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FindingFile"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings/{guid}/related": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Relate two findings of the project",
        "description": "Relates them both ways. Relating them again changes nothing.",
        "operationId": "relateFindings",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelateFindingBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The two relations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RelatedFinding"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings/{guid}/related/{relatedGuid}": {
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Remove the relation between two findings",
        "description": "Removes it both ways; each direction comes as a deletion in `listRelatedFindings`.",
        "operationId": "unrelateFindings",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "relatedGuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings/{guid}/viewpoints": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Add a photo or a selection to a finding",
        "description": "A viewpoint carries a photo from uploadFindingPhoto, elements it selects, or a storey point, or several of them. A repeat with the same Idempotency-Key and body returns the first viewpoint with 200.",
        "operationId": "createViewpoint",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FindingViewpointBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The viewpoint an earlier call with the same Idempotency-Key wrote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Viewpoint"
                }
              }
            }
          },
          "201": {
            "description": "The viewpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Viewpoint"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/findings/{guid}/viewpoints/{viewpointGuid}/photo": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Download a viewpoint's photo",
        "description": "Redirects (302) to a download address that is valid for an hour.",
        "operationId": "getViewpointPhoto",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "guid",
            "in": "path",
            "description": "The finding's guid",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "viewpointGuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the image"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/handoffs": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Hand off a zone's work",
        "description": "Marks a zone's task done, received, returned, approved or reopened, with defects that become findings on their elements, as the app's handoff does. `done` needs the inspector role; received, returned, approved and reopened need the project admin role, which a scope such as `inspections:write` gives, or the answer is 403 INSUFFICIENT_PROJECT_ROLE. Each event names the integration (`created_via`, `via_client_id`). A repeat with the same Idempotency-Key and body returns the first answer with `replayed: true`.",
        "operationId": "recordZoneHandoff",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ZoneHandoffBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The events recorded and the defects raised",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordHandoffResponse"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR; HANDOFF_TRANSITION_INVALID for defects with a kind other than received or returned, or a reopen without a note; HANDOFF_BLOCKING_DEFECT_REQUIRED; HANDOFF_ELEMENT_NOT_IN_ZONE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, zone or task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "HANDOFF_TRANSITION_INVALID when the task is not in a state this kind follows or the zone changed meanwhile; HANDOFF_APPROVAL_OFF",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:attest"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/handoffs/{zoneId}": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "A zone's tasks with their handoff states, the latest handoffs and their defects",
        "description": "The zone's installation tasks, optionally of one task or one work name, as the app's handoff panel shows them. `may_record_done` and `may_receive` say what the principal's project role allows. A snapshot read when asked, not a windowed list: it has no `changed_at` and no deletions; read it again for the current state.",
        "operationId": "getZoneHandoffs",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "zoneId",
            "in": "path",
            "description": "The zone's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "task_id",
            "in": "query",
            "description": "One task of the zone",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "work_name",
            "in": "query",
            "description": "The tasks of one work name, a takt board row",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The zone's handoffs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandoffCell"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; FEATURE_OFF when the project's organisation does not use the takt board (zones, handoffs, deviations) or the schedule (schedule tasks, element facts); PUBLIC_API_DISABLED when it has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, zone or task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/handover": {
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Ask another organisation to take the completed project over",
        "description": "Needs `members:write`; the project must be `completed`. Only the project's owner who is also an admin of its organisation may ask, and an integration never owns a project, so an integration's token gets 403 INSUFFICIENT_PROJECT_ROLE: the operation is for apps acting for that person. `admin_email` names an admin of the receiving organisation, a person, who gets the request by e-mail.",
        "operationId": "requestHandover",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewHandoverRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The pending request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandoverRequest"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, or no admin with this address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "HANDOVER_PENDING_EXISTS, or the project is not completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Projects"
        ],
        "summary": "Cancel the project's pending handover request",
        "description": "Needs `members:write` and the admin role on the project.",
        "operationId": "cancelHandover",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Cancelled"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, or no pending request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Create an inspection plan",
        "description": "A plan starts as a draft; activate it with updateInspectionPlan. A repeat with the same Idempotency-Key and body returns the first plan with 200.",
        "operationId": "createInspectionPlan",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanCreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The plan an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanItem"
                }
              }
            }
          },
          "201": {
            "description": "The plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanItem"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/assign": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Add elements to the active plan of a template",
        "description": "Up to 500 `global_ids`, or a `filter` that the plan's scope takes. Elements outside the filter join as `added` plan elements; each gets its inspection and a label. One call handles at most 500 elements, fewer for a template of more than 12 steps. A list of more `global_ids` than that answers 400 `VALIDATION_ERROR` and writes nothing; `details[0].maximum` is the most ids one call takes under the template. With `partial: true` such a call handles the first `taken` ids instead, and `remaining` counts the ids after them: send those next. A `filter` call answers `taken` and `remaining` too: send the same `filter` until `remaining` is 0. With `dry_run` nothing is written and the counts come back. Several active plans on the template need `plan_id`.",
        "operationId": "assignInspectionPlanElements",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignInspectionPlanBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignAnswerDoc"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Several active plans use the template; send plan_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/preview": {
      "post": {
        "tags": [
          "Integration"
        ],
        "summary": "What a scope covers, without saving it",
        "description": "A sample of at most 20 elements and the counts by IFC type and storey.",
        "operationId": "previewInspectionPlan",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewInspectionPlanBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanPreview"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/{planId}": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "One plan with its coverage",
        "description": "The listInspectionPlans item with how far its scope is inspected. Draft plans are for the admin role; archived plans show to every role.",
        "operationId": "getInspectionPlan",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Delete a plan",
        "description": "Refused with 409 PLAN_IN_USE while an inspection under the plan is open; archive it instead. Completed inspections stay, without a plan. It comes as a deletion in listInspectionPlans and implies its plan elements.",
        "operationId": "deleteInspectionPlan",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PLAN_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:delete"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Writes"
        ],
        "summary": "Change a plan, its scope, status or assignees",
        "description": "Only the fields sent change; `assignee_ids` replaces the list. A completed plan is read-only until it is reopened; an archived plan stays read-only.",
        "operationId": "updateInspectionPlan",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanUpdateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanItem"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PLAN_TEMPLATE_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/{planId}/elements": {
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Remove every added element from a plan",
        "description": "The `added` plan elements go; the filter's elements stay. Their inspections stay with the elements.",
        "operationId": "removeAddedPlanElements",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How many went",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanElementsRemoval"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:delete"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/{planId}/elements/{globalId}": {
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Put an excluded element back into a plan",
        "description": "Removes the `excluded` plan element, so the filter covers the element again. An element with open work under another plan or template answers 409 ELEMENT_HAS_OTHER_WORK unless `confirm=true`.",
        "operationId": "restorePlanElement",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "globalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "description": "true puts it back although it has open work under another plan or template",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How many plan elements went",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanElementsRemoval"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, plan or excluded element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ELEMENT_HAS_OTHER_WORK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:delete"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/{planId}/labels": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "QR labels for the plan's unlabelled elements, 500 at a time",
        "description": "Call again until `remaining` is 0. The organisation's hourly label limits apply (429). The labels come in listLabels.",
        "operationId": "labelInspectionPlan",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanLabelsResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The plan is not active, or changed meanwhile; call again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/{planId}/precreate": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Open the plan's missing inspections, up to 1 000 at a time",
        "description": "Every element in scope gets its inspection under the plan; call again until `remaining` is 0. A template of more than 5 steps opens fewer per call. Opened inspections stay with the elements for good.",
        "operationId": "precreateInspections",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanPrecreateResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The plan is not active, or changed meanwhile; call again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:delete"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/{planId}/precreated": {
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Remove the plan's untouched inspections, 1 000 at a time",
        "description": "Inspections with a verdict, a check, a comment or a photo are kept. Call again until `remaining` is 0.",
        "operationId": "removePrecreatedInspections",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanPrecreatedRemoval"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The plan is not active, or changed meanwhile; call again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:delete"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspection-plans/{planId}/scope": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The elements a plan covers today, by coverage state",
        "description": "GlobalIds per state in GlobalId order, a page at a time; pass `next_after` as `after` until it is null. The scope is resolved when asked, so it has no window.",
        "operationId": "listInspectionPlanScope",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "planId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "next_after of the previous page",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64,
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10000,
              "maximum": 10000,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectionPlanElementStates"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or plan, or a draft plan and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspections": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Open an element's inspection, as a scan does",
        "description": "Returns the element's open inspection under the plan that covers it, and creates it with its number when it has none. Without a covering plan the project's default template opens. Opening again returns the same inspection.",
        "operationId": "openInspection",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenInspectionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The inspection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "description": "PLAN_NOT_COVERING: the plan is not active or does not cover the element; VALIDATION_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or element, or no plan covers the element and the project has no default template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PLAN_CHOICE_REQUIRED with the covering plans in details; CONFLICT once the project is handed over to maintenance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspections/{inspectionId}": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "One inspection with its steps and checks",
        "description": "The same item listInspections returns.",
        "operationId": "getInspection",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "inspectionId",
            "in": "path",
            "description": "The inspection's id from listInspections",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The inspection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, inspection, element or step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspections/{inspectionId}/steps/{stepId}/checks/{itemId}": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Record one check of a step",
        "description": "The step's verdict follows from its checks: all required checks ok or not applicable passes it, a failed check fails it. Returns the inspection.",
        "operationId": "recordCheck",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "inspectionId",
            "in": "path",
            "description": "The inspection's id from listInspections",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stepId",
            "in": "path",
            "description": "The template step's id, `step_id` on the inspection's step",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "description": "The check's `id` in the check-list version the step is pinned to (`check_list_version_id`)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckResultBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The inspection after the check",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR, also when the check is not in the version the step is pinned to",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE; PLAN_RECORDED_BY_OWNER when the inspection's plan belongs to another organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, inspection, element or step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PRIOR_STEP_INCOMPLETE, STEP_HAS_CHECKS or another state the step is not in; CONFLICT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:attest"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspections/{inspectionId}/steps/{stepId}/comments": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Comment on an inspection step",
        "description": "The comment goes on the step's finding, authored by the integration. A repeat with the same Idempotency-Key and body returns the first comment with 200.",
        "operationId": "createStepComment",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "inspectionId",
            "in": "path",
            "description": "The inspection's id from listInspections",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stepId",
            "in": "path",
            "description": "The template step's id, `step_id` on the inspection's step",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepCommentBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The comment an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                }
              }
            }
          },
          "201": {
            "description": "The comment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, inspection, element or step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspections/{inspectionId}/steps/{stepId}/reopen": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Take a step's verdict back",
        "description": "The step returns to pending and the earlier verdict stays in its history. Only who recorded the verdict, or a project admin, reopens it (403 STEP_REOPEN_NOT_ALLOWED). A step that is already pending answers 200 unchanged. Returns the inspection.",
        "operationId": "reopenStep",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "inspectionId",
            "in": "path",
            "description": "The inspection's id from listInspections",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stepId",
            "in": "path",
            "description": "The template step's id, `step_id` on the inspection's step",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepReopenBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The inspection after the reopen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE; PLAN_RECORDED_BY_OWNER; STEP_REOPEN_NOT_ALLOWED when another principal recorded the verdict and the role is not admin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, inspection, element or step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PRIOR_STEP_INCOMPLETE, STEP_HAS_CHECKS or another state the step is not in; CONFLICT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:attest"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspections/{inspectionId}/steps/{stepId}/verdict": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Record a step's verdict",
        "description": "Records the verdict as the integration, shown as Integraatio · {name}. A step with a check list is passed by its checks (recordCheck) and answers 409 STEP_HAS_CHECKS. A sequential step waits for the required steps before it (409 PRIOR_STEP_INCOMPLETE); a failed verdict does not wait. Recording again replaces the verdict, as in the app. Returns the inspection.",
        "operationId": "recordStepVerdict",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "inspectionId",
            "in": "path",
            "description": "The inspection's id from listInspections",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stepId",
            "in": "path",
            "description": "The template step's id, `step_id` on the inspection's step",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepVerdictBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The inspection after the verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE; PLAN_RECORDED_BY_OWNER when the inspection's plan belongs to another organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, inspection, element or step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PRIOR_STEP_INCOMPLETE, STEP_HAS_CHECKS or another state the step is not in; CONFLICT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:attest"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/inspections/{inspectionId}/steps/{stepId}/viewpoints": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Attach a photo to an inspection step",
        "description": "Upload it first with uploadFindingPhoto. The photo goes on the step's finding as a viewpoint. A repeat with the same Idempotency-Key and body returns the first viewpoint with 200.",
        "operationId": "createStepViewpoint",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "inspectionId",
            "in": "path",
            "description": "The inspection's id from listInspections",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stepId",
            "in": "path",
            "description": "The template step's id, `step_id` on the inspection's step",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepPhotoBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The viewpoint an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Viewpoint"
                }
              }
            }
          },
          "201": {
            "description": "The viewpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Viewpoint"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, inspection, element or step",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/integrations": {
      "get": {
        "tags": [
          "People"
        ],
        "summary": "The integrations on the project",
        "description": "The project's own organisation's integrations and those of other organisations its admins added; the whole list in one answer. They are never in listMembers.",
        "operationId": "listProjectIntegrations",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The integrations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationOnProjectList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:read"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "People"
        ],
        "summary": "Add another organisation's integration to the project",
        "description": "As viewer, or inspector when it records element events. Only a person may do this; an integration's token gets 403.",
        "operationId": "addProjectIntegration",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewProjectIntegration"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationOnProject"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_PROJECT_ROLE: only a person who is a project admin of the project's organisation manages another organisation's integration, so an integration always gets this; apps acting for such a person can",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, or no integration has this client_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INTEGRATION_ALREADY_MEMBER",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/integrations/{clientId}": {
      "delete": {
        "tags": [
          "People"
        ],
        "summary": "Remove another organisation's integration from the project",
        "description": "It gets `access_removed` for the project in listProjects.",
        "operationId": "removeProjectIntegration",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "clientId",
            "in": "path",
            "description": "The other organisation's integration's client_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_PROJECT_ROLE: only a person who is a project admin of the project's organisation manages another organisation's integration, so an integration always gets this; apps acting for such a person can",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, or no integration has this client_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "People"
        ],
        "summary": "Change another organisation's integration's role on the project",
        "operationId": "setProjectIntegrationRole",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "clientId",
            "in": "path",
            "description": "The other organisation's integration's client_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectIntegrationRoleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The integration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationOnProject"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_PROJECT_ROLE: only a person who is a project admin of the project's organisation manages another organisation's integration, so an integration always gets this; apps acting for such a person can",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, or no integration has this client_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/labels": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Create QR labels",
        "description": "`count` labels on no element, or one label linked to each of `element_global_ids`; at most 500 a call. The organisation's hourly label limits apply (429). A repeat with the same Idempotency-Key and body returns the labels the first call created, with 200.",
        "operationId": "createLabels",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLabelsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The labels an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedLabels"
                }
              }
            }
          },
          "201": {
            "description": "The new labels",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedLabels"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, label or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "LABEL_GENERATION_INCOMPLETE: nothing was created; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/labels/{labelId}": {
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Delete a label",
        "description": "The label is gone: a scan of it finds nothing. It comes as a deletion in `listLabels`. To keep the history, retire it instead.",
        "operationId": "deleteLabel",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "labelId",
            "in": "path",
            "description": "The label's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, label or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:delete"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/labels/{labelId}/assign": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Link a label to an element",
        "description": "For a label on no element, or one whose element was deleted from the project. A label on another element answers 409 CONFLICT unless `move` is true, which moves it as the app does. A retired label answers 409 LABEL_RETIRED. An element carries one label: a second answers 409 ASSET_ALREADY_LABELLED. Needs the admin role, or the inspector role where the project lets inspectors link labels (403 LABEL_LINK_NOT_ALLOWED).",
        "operationId": "assignLabel",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "labelId",
            "in": "path",
            "description": "The label's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignLabelBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The label",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Label"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, label or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ASSET_ALREADY_LABELLED, LABEL_RETIRED, or the label is on another element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/labels/{labelId}/retire": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Take a label out of use",
        "description": "The label leaves its element and scans as out of use. It cannot be brought back; create a new label instead. Retiring it again changes nothing.",
        "operationId": "retireLabel",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "labelId",
            "in": "path",
            "description": "The label's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The retired label",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Label"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, label or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/lifecycle": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "The project's phase, its history and a pending handover",
        "description": "Where the project's organisation uses the maintenance phase (`fm`); otherwise 403 FEATURE_OFF.",
        "operationId": "getProjectLifecycle",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The lifecycle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lifecycle"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/maintenance-entries": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Record a maintenance entry on an element",
        "description": "Only while the project is in maintenance (409 PROJECT_NOT_IN_FM otherwise), on an element of the project's models. The entry shows in the app with the integration's name. A repeat with the same Idempotency-Key and body returns the first entry with 200.",
        "operationId": "createMaintenanceEntry",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewMaintenanceLogEntry"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The entry an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaintenanceLogEntry"
                }
              }
            }
          },
          "201": {
            "description": "The entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaintenanceLogEntry"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the role the scopes give is below inspector, or an inspector changes another's entry; FEATURE_OFF when the project's organisation does not use the maintenance phase; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, entry or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROJECT_NOT_IN_FM: entries are written only while the project is in maintenance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "maintenance:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/maintenance-entries/{entryId}": {
      "patch": {
        "tags": [
          "Writes"
        ],
        "summary": "Change a maintenance entry",
        "description": "Its type, title, description or time. The entry's writer may change it, and a project admin any entry; only while the project is in maintenance.",
        "operationId": "updateMaintenanceEntry",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "entryId",
            "in": "path",
            "description": "The entry's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaintenanceLogEntryChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaintenanceLogEntry"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the role the scopes give is below inspector, or an inspector changes another's entry; FEATURE_OFF when the project's organisation does not use the maintenance phase; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, entry or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROJECT_NOT_IN_FM: entries are written only while the project is in maintenance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "maintenance:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/members": {
      "post": {
        "tags": [
          "People"
        ],
        "summary": "Add a person to the project",
        "description": "By `user_id`: a person of the project's organisation, or of another organisation whose access request was approved. By `email`: any person with a WhatsBuilt account, for a project of the integration's own organisation; the person gets an e-mail. An integration is never added this way: its address finds nothing and its id answers 404. Adding someone who is already a member answers 200 with `already_member` and changes nothing, so a repeat is safe. The role can be at most the integration's own on the project.",
        "operationId": "addMember",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMemberBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Already a member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddedMember"
                }
              }
            }
          },
          "201": {
            "description": "Added",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddedMember"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR; MEMBER_OTHER_ACCOUNT: a person of another organisation needs an approved access request, or an add by e-mail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the integration is not the project's admin, or the role is above its own; MEMBER_EXTERNAL_ADD_FORBIDDEN when the project is another organisation's; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or member; MEMBER_EMAIL_NOT_FOUND when no person has the address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED: the organisation's hourly budget of adds by e-mail is spent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/members/{userId}": {
      "delete": {
        "tags": [
          "People"
        ],
        "summary": "Remove a person from the project",
        "description": "The owner and the last person stay (409). The removal comes as a deletion in listMembers.",
        "operationId": "removeMember",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the integration is not the project's admin, or the role is above its own; MEMBER_EXTERNAL_ADD_FORBIDDEN when the project is another organisation's; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or member; MEMBER_EMAIL_NOT_FOUND when no person has the address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "LAST_PROJECT_MEMBER, or the owner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "People"
        ],
        "summary": "Change a member's role",
        "description": "The owner's role cannot be changed (409 PROJECT_OWNER_ROLE_LOCKED), and the role can be at most the integration's own. An integration's membership is not a person's: its id answers 404.",
        "operationId": "updateMemberRole",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberRoleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The member",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Member"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the integration is not the project's admin, or the role is above its own; MEMBER_EXTERNAL_ADD_FORBIDDEN when the project is another organisation's; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or member; MEMBER_EMAIL_NOT_FOUND when no person has the address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROJECT_OWNER_ROLE_LOCKED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "members:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/model-versions": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Start a model upload",
        "description": "Records a pending model version and answers a presigned PUT for the IFC file. Upload the file, then call ingestModelVersion. Without `model_id` the file starts a new model; with it the file becomes the model's next version once ingested. A repeat with the same Idempotency-Key and body returns the same model version with a fresh upload URL, with 200.",
        "operationId": "createModelVersion",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateModelVersionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The model version and where to upload its file an earlier call with the same Idempotency-Key wrote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelUpload"
                }
              }
            }
          },
          "201": {
            "description": "The model version and where to upload its file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelUpload"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "UPLOAD_NOT_CLAIMABLE: the model has no complete version yet; MODEL_BUSY: a version of it is being processed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UPLOAD_NOT_READY: try again in a moment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/model-versions/{versionId}": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "One model version",
        "operationId": "getModelVersion",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "description": "The model version's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The model version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelFileVersion"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Delete a model, or an unfinished attempt",
        "description": "On a complete version, current or earlier, this deletes the whole model: every version and its elements. Labels and inspections are left without an element. Element events and carry-overs stay, with the element's global id and name and `model_deleted` true. It cannot be undone; check getModelVersionImpact first. An attempt whose elements carry labels, inspections, plans, findings or element events answers 409 UPLOAD_HAS_LINKED_ELEMENTS. Each deleted version and element comes as a deletion in its list; each kept element event and carry-over comes as a change.",
        "operationId": "deleteModelVersion",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "description": "The model version's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "MODEL_BUSY or UPLOAD_HAS_LINKED_ELEMENTS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:delete"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/model-versions/{versionId}/ifc": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Download a complete model version's IFC file",
        "description": "Redirects (302) to a download address that is valid for 15 minutes. Needs the admin role, which `models:write` gives.",
        "operationId": "getModelVersionIfc",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "description": "The model version's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the IFC file"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/model-versions/{versionId}/impact": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "What deleting a model version would take",
        "description": "On a complete version: the whole model with every version. On an unfinished attempt: its own elements. Needs the admin role, which `models:write` gives.",
        "operationId": "getModelVersionImpact",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "description": "The model version's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelVersionImpact"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/model-versions/{versionId}/ingest": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Ingest an uploaded model file",
        "description": "Queues the file for processing and answers 202 at once. Poll getModelVersion, or collect listModelVersions, until `status` is `complete` or `failed`; the new elements then come in listElements. Ingests count against the integration's hourly IFC limit (429). A version that is already queued or processed answers 409 UPLOAD_NOT_CLAIMABLE, and that call costs nothing. A file that never arrived fails the version later (`status: failed`).",
        "operationId": "ingestModelVersion",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "description": "The model version's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The 202 of `ingestModelVersion`.",
                  "required": [
                    "status",
                    "model_version_id"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "accepted"
                      ]
                    },
                    "model_version_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "UPLOAD_NOT_CLAIMABLE: already queued or processed; MODEL_BUSY: another version of the model is being processed; MODEL_CHANGED: a newer version of the model finished first, so upload this file again as a new version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UPLOAD_NOT_READY: model processing is not available right now; send the same request again in a moment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/model-versions/{versionId}/retry": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Process a model version again",
        "description": "A complete version is processed again as a new attempt of its model, which comes in listModelVersions; any other is queued again in place. Deletes no elements. Counts against the hourly IFC limit (429).",
        "operationId": "retryModelVersion",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "versionId",
            "in": "path",
            "description": "The model version's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The 200 of `retryModelVersion`.",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, or UPLOAD_ALREADY_QUEUED: the version is already queued for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "UPLOAD_NOT_CLAIMABLE, MODEL_BUSY or MODEL_CHANGED, as for ingestModelVersion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UPLOAD_NOT_READY: model processing is not available right now; send the same request again in a moment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/models/removed-summary": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Removed elements per model",
        "description": "Per model: elements a new version removed, how many still carry data and are not resolved (`open`), and the carry-over proposals.",
        "operationId": "getRemovedElementSummary",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One entry per model",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModelRemovedSummary"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/models/{modelId}/carry-over-candidates": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Live elements of a model to carry data to",
        "description": "Pages of at most 25, filtered by `search` on name, mark and type; pass `next_cursor` as `cursor`.",
        "operationId": "listCarryOverCandidates",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelId",
            "in": "path",
            "description": "The model's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarryOverCandidatePage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/models/{modelId}/carry-overs": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Carry removed elements' data to live ones (spec 048)",
        "description": "Moves each pair's label, inspections, plan rows and element events from the removed element to the live one in one transaction, and adds the live one to findings. A pair that would put two labels or two inspections with results on one element, or that is no longer valid, comes back refused with its code; the rest are carried. The removed element stays archived. Each carry-over comes in listCarryOvers. A repeat with the same Idempotency-Key and body returns the carry-overs the first call made and carries nothing again. A carry-over still running 25 seconds after the request arrived answers 400 VALIDATION_ERROR with the reason TIME_LIMIT in `details` and carries nothing: carry fewer pairs at a time.",
        "operationId": "carryOverElements",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelId",
            "in": "path",
            "description": "The model's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CarryOverBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Carried and refused pairs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CarryOverResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "MODEL_BUSY: the model is being processed or carried; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "UPLOAD_NOT_READY: try again in a moment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/models/{modelId}/carry-overs/undo": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Take back carry-overs",
        "description": "By `carry_over_ids` or a whole `batch_id`. Moves back exactly what each carry-over moved; work recorded on the live element after it stays there and is counted in `stayed`. An undone carry-over is a change in listCarryOvers with `undone_at`. Undoing one again answers it refused with REMAP_STALE. An undo still running 25 seconds after the request arrived answers 400 VALIDATION_ERROR with the reason TIME_LIMIT in `details` and undoes nothing: undo fewer carry-overs at a time, by carry_over_ids.",
        "operationId": "undoCarryOvers",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelId",
            "in": "path",
            "description": "The model's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UndoCarryOversBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Undone and refused carry-overs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UndoCarryOversResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "MODEL_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/models/{modelId}/removed-elements": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "A model's removed elements with what is linked to them",
        "description": "Pages of at most 25; pass `next_cursor` as `cursor`. Removed elements stay archived; they also come in listElements with `archived_at`.",
        "operationId": "listRemovedElements",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelId",
            "in": "path",
            "description": "The model's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The tab of the removed list.",
              "default": "open",
              "enum": [
                "open",
                "resolved",
                "all"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096,
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 25,
              "maximum": 25,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelRemovedElementPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/models/{modelId}/removed-elements/resolve": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Mark removed elements resolved",
        "description": "The data stays on the archived elements; they leave the open count. Send `global_ids` or `\"all\": true`.",
        "operationId": "resolveRemovedElements",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "modelId",
            "in": "path",
            "description": "The model's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveRemovedElementsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "How many were resolved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "What a resolve of removed elements changed.",
                  "required": [
                    "resolved"
                  ],
                  "properties": {
                    "resolved": {
                      "type": "integer",
                      "format": "int64",
                      "description": "Elements newly marked resolved."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/phase": {
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Move the project to another phase",
        "description": "Between `construction` and `completed`, either way. `fm_active` comes only from an accepted handover and cannot be left. Answers 409 PROJECT_PHASE_TRANSITION_INVALID for a move the project cannot make.",
        "operationId": "setProjectPhase",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPhaseBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The lifecycle after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lifecycle"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROJECT_PHASE_TRANSITION_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "projects:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/photos": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "An address to upload one photo to",
        "description": "PUT the image to `upload_url` with the returned headers within 15 minutes, then pass `photo_key` to createViewpoint. PNG or JPEG, at most 20 MB.",
        "operationId": "uploadFindingPhoto",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhotoUploadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The upload address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhotoUpload"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, finding, comment, viewpoint, draft or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/places": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "One level of the project's buildings, storeys, spaces and types",
        "description": "Without `node`: the project's first level. Send a place's `node` to open it. Each place counts its elements, the ones whose latest inspection is in progress and the open findings on them.",
        "operationId": "listPlaces",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "node",
            "in": "query",
            "description": "A `node` from an earlier answer",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4096,
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The level",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceTree"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter; INVALID_PROPERTY_FILTER for a property condition the filter cannot use",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or element",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/reference-documents": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Record an uploaded reference document",
        "description": "Checks that the upload finished and is a PDF, and records it in the project. A repeat with the same Idempotency-Key and body returns the same document with 200; the same key without one answers 409.",
        "operationId": "createReferenceDocument",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReferenceDocumentBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The reference document an earlier call with the same Idempotency-Key wrote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectReferenceDocument"
                }
              }
            }
          },
          "201": {
            "description": "The reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectReferenceDocument"
                }
              }
            }
          },
          "400": {
            "description": "DOCUMENT_UPLOAD_INCOMPLETE, DOCUMENT_CONTENT_MISMATCH, DOCUMENT_TOO_LARGE or a key of another organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "This upload is already recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/reference-documents/uploads": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Start a reference document upload",
        "description": "Answers a presigned PUT for one PDF. Upload it, then call createReferenceDocument with the `key`. Attaching it to an inspection template is a template write.",
        "operationId": "uploadReferenceDocument",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferenceDocumentUploadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Where to upload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceDocumentUpload"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR, DOCUMENT_TYPE_NOT_ALLOWED or DOCUMENT_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/reference-documents/{documentId}": {
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Delete a reference document no template has",
        "description": "Removes an uploaded document of the project that no inspection template has, such as one recorded but never attached. A document a template still has answers 409 DOCUMENT_IN_USE: update the template without it, and the document goes when no template has it. It comes as a deletion in listReferenceDocuments.",
        "operationId": "deleteReferenceDocument",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE below admin; PUBLIC_API_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DOCUMENT_IN_USE: a template still has the document; details.template_ids names them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/reference-documents/{documentId}/file": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Download a reference document",
        "description": "Redirects (302) to a download address that is valid for 15 minutes.",
        "operationId": "getReferenceDocumentFile",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "description": "The reference document's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the PDF"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, model, model version or reference document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/schedule-element-facts": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "Per element its installation task and, with the takt board, its installed, passed and defect days",
        "description": "Every element with an effective installation task, in columns, 2000 elements a page at most, in GlobalId order; only `next_cursor = null` ends the pages. Each page names only the tasks its elements use. A snapshot read when asked, not a windowed list: it has no `changed_at` and no deletions; read it again for the current state.",
        "operationId": "getScheduleElementFacts",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 2000,
              "maximum": 2000,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The facts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleElementFacts"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; FEATURE_OFF when the project's organisation does not use the takt board (zones, handoffs, deviations) or the schedule (schedule tasks, element facts); PUBLIC_API_DISABLED when it has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/schedule-tasks/{taskId}/elements": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The elements linked to a schedule task",
        "description": "Pages in GlobalId order; only `next_cursor = null` ends the list. An archived task answers 404. A snapshot read when asked, not a windowed list: it has no `changed_at` and no deletions; read it again for the current state.",
        "operationId": "listScheduleTaskElements",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "taskId",
            "in": "path",
            "description": "The schedule task's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 1000,
              "maximum": 1000,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleTaskElementsPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; FEATURE_OFF when the project's organisation does not use the takt board (zones, handoffs, deviations) or the schedule (schedule tasks, element facts); PUBLIC_API_DISABLED when it has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or live schedule task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/storeys": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The project's live storeys with their GlobalIds",
        "description": "Every storey (`IfcBuildingStorey`) of the project's current models, by building and elevation. Find an element's storey by its `building_name` and `storey_name`. Several models may each have a storey of the same name; any of them anchors a point, and the app uses the one with the most `elements`.",
        "operationId": "listStoreys",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The storeys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Storeys"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed project id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "elements:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/takt-board": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The takt board of one day: zones × work names with installed, inspected and open-defect counts",
        "description": "The board as the app shows it at the end of `date`. A snapshot read when asked, not a windowed list: it has no `changed_at` and no deletions; read it again for the current state.",
        "operationId": "getTaktBoard",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "The day, YYYY-MM-DD in Finnish time; today by default",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The board",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaktBoardDay"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; FEATURE_OFF when the project's organisation does not use the takt board (zones, handoffs, deviations) or the schedule (schedule tasks, element facts); PUBLIC_API_DISABLED when it has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/templates": {
      "post": {
        "tags": [
          "Writes"
        ],
        "summary": "Create a template with its steps in the project",
        "description": "A step's `check_list_id` names a check list of the project or its organisation (400 CHECK_GROUP_UNAVAILABLE otherwise). A repeat with the same Idempotency-Key and body returns the first template with 200.",
        "operationId": "createTemplate",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "idempotency-key",
            "in": "header",
            "description": "A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[\\x21-\\x7e]{1,255}$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The template an earlier call with the same Idempotency-Key created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "201": {
            "description": "The template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or template, or the template is the organisation's own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "DEFAULT_TEMPLATE_CONFLICT: another template became the default at the same moment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/templates/{templateId}": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "One template with its steps",
        "description": "A template of the project, or of its organisation that the project uses. listTemplates lists the project's own.",
        "operationId": "getTemplate",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or template, or the template is the organisation's own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Writes"
        ],
        "summary": "Delete a template",
        "description": "A template that any inspection or plan uses answers 409 TEMPLATE_IN_USE. It comes as a deletion in listTemplates.",
        "operationId": "deleteTemplate",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "TEMPLATE_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:delete"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Writes"
        ],
        "summary": "Change a template or its steps",
        "description": "Only the fields sent change. `steps` replaces the list: a step with `id` stays, one without is new, one left out goes. A step with recorded results cannot go (409 STEP_HAS_RESULTS). On a template in use, keep at least one existing step: a list with none of them answers 409 TEMPLATE_STEPS_STALE, an empty one 409 TEMPLATE_STEPS_REQUIRED. Open inspections follow the new steps at once. A change still being saved 25 seconds after the request arrived answers 400 VALIDATION_ERROR with the reason TIME_LIMIT in `details` and writes nothing: send fewer step changes at a time. A change whose added plus removed steps times the inspections that use the template exceed 30 000 answers 400 VALIDATION_ERROR with the reason TOO_LARGE in `details` at once, also writing nothing.",
        "operationId": "updateTemplate",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTemplateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The template",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, parameters or Idempotency-Key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration's; PUBLIC_API_DISABLED when the project's owning organisation has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project or template, or the template is the organisation's own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "STEP_HAS_RESULTS, TEMPLATE_STEPS_STALE, TEMPLATE_STEPS_REQUIRED or DEFAULT_TEMPLATE_CONFLICT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "IDEMPOTENCY_KEY_REUSED: the key was used with another body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:write"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/zone-scheme": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The project's zones with their element counts",
        "description": "The live zones in the app's natural order and the count of elements in no zone. listZones has the zones as a windowed list. A snapshot read when asked, not a windowed list: it has no `changed_at` and no deletions; read it again for the current state.",
        "operationId": "getZoneScheme",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The zone scheme",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ZoneScheme"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; FEATURE_OFF when the project's organisation does not use the takt board (zones, handoffs, deviations) or the schedule (schedule tasks, element facts); PUBLIC_API_DISABLED when it has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/projects/{projectId}/zones/{zoneId}/elements": {
      "get": {
        "tags": [
          "Integration"
        ],
        "summary": "The GlobalIds of a zone's elements",
        "description": "Pages in GlobalId order; only `next_cursor = null` ends the list. A snapshot read when asked, not a windowed list: it has no `changed_at` and no deletions; read it again for the current state.",
        "operationId": "listZoneElements",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "zoneId",
            "in": "path",
            "description": "The zone's id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 5000,
              "maximum": 5000,
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ZoneElementPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for a malformed id or parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration's; FEATURE_OFF when the project's organisation does not use the takt board (zones, handoffs, deviations) or the schedule (schedule tasks, element facts); PUBLIC_API_DISABLED when it has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/reference-documents": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Reference documents changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `models:read`. The PDFs of the project's inspection templates; download one with getReferenceDocumentFile. A document no template uses any more is deleted and comes as a deletion. Organisation-wide documents are not listed.",
        "operationId": "listReferenceDocuments",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceDocumentPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "models:read"
            ]
          }
        ]
      }
    },
    "/v1/related-findings": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Relations between findings, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `link_key`. Needs `findings:read`. A relation is listed in both directions, one row each. A deleted finding implies its relations in both directions.",
        "operationId": "listRelatedFindings",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RelatedFindingPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      }
    },
    "/v1/schedule-imports": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Schedule imports changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `schedule:read`. A model's schedule is read from its `[4D]Task` properties or its `IfcTask` entities each time a version is ingested; the import of the previous version is then a change with `superseded_at`. Deleting the model deletes its imports, which come as deletions. `model_id` filters live rows only. A project whose organisation does not use the schedule is in `skipped_projects` with FEATURE_OFF.",
        "operationId": "listScheduleImports",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "model_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleImportPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/schedule-tasks": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Schedule tasks changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `schedule:read`. A task keeps its id and `changed_at` across imports while its fields stay the same; a task a later import no longer has is a change with `archived_at`. Deleting the model deletes its tasks, which come as deletions. The linked elements are in listScheduleTaskElements. `model_id` filters live rows only. A project whose organisation does not use the schedule is in `skipped_projects` with FEATURE_OFF.",
        "operationId": "listScheduleTasks",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          },
          {
            "name": "model_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleTaskPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    },
    "/v1/templates": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "The project's templates with their steps, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. A change to a step changes the template. The organisation's own templates are not listed; getTemplate reads one a plan or an inspection names.",
        "operationId": "listTemplates",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "inspections:read"
            ]
          }
        ]
      }
    },
    "/v1/viewpoints": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Viewpoints of findings, changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `guid`. Needs `findings:read`. `elements` are the GlobalIds the viewpoint selects; download a photo with getViewpointPhoto. A deleted finding implies its viewpoints.",
        "operationId": "listViewpoints",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewpointPage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "findings:read"
            ]
          }
        ]
      }
    },
    "/v1/zones": {
      "get": {
        "tags": [
          "Changes"
        ],
        "summary": "Zones changed in a window",
        "description": "Rows changed in `[modified_from, modified_to)`, deletions included, in `(project_id, changed_at, key)` order. Only `next_cursor = null` ends the list; a page may hold fewer rows than `limit`, even none. Without `modified_from`: every live row and no deletions.\n\nKey `id`. Needs `schedule:read`. A zone is a storey of the project's models today; `element_count` changes as models change, and a zone left without live elements is a change with `archived_at`, not a deletion. getZoneScheme answers the live zones in order with the count of elements in no zone. A project whose organisation does not use the takt board is in `skipped_projects` with FEATURE_OFF.",
        "operationId": "listZones",
        "parameters": [
          {
            "name": "modified_from",
            "in": "query",
            "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Inclusive lower bound on changed_at, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped. Without it: every live row and no deletions."
            }
          },
          {
            "name": "modified_to",
            "in": "query",
            "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Exclusive upper bound, an RFC 3339 time with an offset (Z or ±hh:mm) and at most 9 fractional digits, e.g. 2026-11-17T00:00:00Z; digits past microseconds are dropped; default and maximum: the settled time"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Repeatable, at most 50 times",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ],
              "description": "Repeatable, at most 50 times"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "maximum": 1000,
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12288
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ZonePage"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR for invalid parameters; INVALID_CURSOR for a cursor that does not belong to them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, expired or revoked token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "INSUFFICIENT_SCOPE, or PUBLIC_API_DISABLED when an admin of the integration's organisation, or on a per-project route of the project's owning organisation, has turned the API off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "WINDOW_BEFORE_RETENTION: the window starts before deletions are kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMITED; wait for Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "integration": [
              "schedule:read"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptHandoverRequestBody": {
        "type": "object",
        "description": "The body of `acceptHandover`.",
        "properties": {
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AcceptedHandoverRequest": {
        "type": "object",
        "description": "`AcceptedHandoverRequest`: the project now belongs to the principal's organisation.",
        "required": [
          "request_id",
          "project_id",
          "phase",
          "owner_account_id",
          "plan",
          "occurred_at"
        ],
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "phase": {
            "type": "string",
            "enum": [
              "fm_active"
            ]
          },
          "owner_account_id": {
            "type": "string",
            "format": "uuid"
          },
          "plan": {
            "type": "object",
            "description": "What moved and what was copied: members, templates, check lists, fail-reason lists and documents",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "occurred_at": {
            "type": "string"
          },
          "entered_later": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        }
      },
      "AccessRequest": {
        "type": "object",
        "description": "A live access request.",
        "required": [
          "id",
          "project_id",
          "user_id",
          "name",
          "email",
          "status",
          "message",
          "created_at",
          "reviewed_by",
          "reviewed_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The request."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "user_id": {
            "type": "string",
            "description": "The person asking.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their e-mail, read when answering."
          },
          "status": {
            "$ref": "#/components/schemas/AccessRequestStatus",
            "description": "`pending`, `approved` or `denied`."
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their message."
          },
          "created_at": {
            "type": "string",
            "description": "When it was made."
          },
          "reviewed_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who reviewed it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "reviewed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was reviewed."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "AccessRequestItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/AccessRequest",
            "description": "A live request."
          },
          {
            "$ref": "#/components/schemas/DeletedAccessRequest",
            "description": "A deleted request."
          }
        ],
        "description": "An item of `GET /v1/access-requests`."
      },
      "AccessRequestPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessRequestItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "AccessRequestStatus": {
        "type": "string",
        "description": "An access request's state.",
        "enum": [
          "pending",
          "approved",
          "denied"
        ]
      },
      "AddMemberBody": {
        "type": "object",
        "description": "The body of `addMember`: `user_id` or `email`.",
        "properties": {
          "user_id": {
            "type": "string",
            "description": "A person of the project's organisation, or one whose access request was approved",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "email": {
            "type": "string",
            "description": "Any person with a WhatsBuilt account; they get an e-mail. Only for the project's own organisation.",
            "maxLength": 320
          },
          "project_role": {
            "$ref": "#/components/schemas/AssignableRole",
            "default": "viewer"
          }
        },
        "additionalProperties": false
      },
      "AddedMember": {
        "type": "object",
        "description": "The answer of `addMember`.",
        "required": [
          "status",
          "member"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "Whether the person was added.",
            "enum": [
              "added",
              "already_member"
            ]
          },
          "notified": {
            "type": "boolean",
            "description": "For an add by e-mail: whether the member got the e-mail"
          },
          "member": {
            "$ref": "#/components/schemas/Member"
          }
        }
      },
      "Approved": {
        "type": "object",
        "description": "The answer of `approveAccessRequest`.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "An approved request.",
            "enum": [
              "approved"
            ]
          }
        }
      },
      "AssignAnswerDoc": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/AssignInspectionPlanResult",
            "description": "A write."
          },
          {
            "$ref": "#/components/schemas/AssignInspectionPlanDryRun",
            "description": "A dry run."
          }
        ],
        "description": "The answer of `assignInspectionPlanElements`, as the contract documents it."
      },
      "AssignGroupDoc": {
        "type": "object",
        "description": "A group of a dry run.",
        "required": [
          "key",
          "count",
          "project_total"
        ],
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ]
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "project_total": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "AssignInspectionPlanBody": {
        "type": "object",
        "description": "The body of `assignInspectionPlanElements`.",
        "required": [
          "template_id"
        ],
        "properties": {
          "template_id": {
            "type": "string",
            "format": "uuid"
          },
          "plan_id": {
            "type": "string",
            "format": "uuid",
            "description": "Required when several active plans use the template."
          },
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 50000,
            "minItems": 1
          },
          "filter": {
            "$ref": "#/components/schemas/PlanAssignFilter"
          },
          "open_elsewhere": {
            "type": "string",
            "default": "skip",
            "enum": [
              "skip",
              "include"
            ]
          },
          "dry_run": {
            "type": "boolean",
            "default": false
          },
          "partial": {
            "type": "boolean",
            "description": "true handles the first `taken` ids of a list longer than one call takes; default false answers 400",
            "default": false
          }
        }
      },
      "AssignInspectionPlanDryRun": {
        "type": "object",
        "description": "`AssignInspectionPlanDryRun`, as the contract documents it.",
        "required": [
          "selected",
          "unknown",
          "labelled",
          "adoptable",
          "adoptable_completed",
          "open_elsewhere",
          "open_elsewhere_unlabelled",
          "by_type",
          "by_storey",
          "truncated",
          "plans"
        ],
        "properties": {
          "selected": {
            "type": "integer",
            "format": "int32"
          },
          "unknown": {
            "type": "integer",
            "format": "int32"
          },
          "labelled": {
            "type": "integer",
            "format": "int32"
          },
          "adoptable": {
            "type": "integer",
            "format": "int32"
          },
          "adoptable_completed": {
            "type": "integer",
            "format": "int32"
          },
          "open_elsewhere": {
            "type": "integer",
            "format": "int32"
          },
          "open_elsewhere_unlabelled": {
            "type": "integer",
            "format": "int32"
          },
          "by_type": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssignGroupDoc"
            }
          },
          "by_storey": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssignGroupDoc"
            }
          },
          "truncated": {
            "type": "boolean"
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssignPlanDoc"
            }
          }
        }
      },
      "AssignInspectionPlanResult": {
        "type": "object",
        "description": "`AssignInspectionPlanResult`, as the contract documents it.",
        "required": [
          "plan",
          "saved_as",
          "created",
          "adopted",
          "adopted_completed",
          "already_present",
          "skipped",
          "labels_created",
          "taken",
          "remaining"
        ],
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/AssignedPlanDoc"
          },
          "saved_as": {
            "type": "string",
            "description": "How the elements joined the plan.",
            "enum": [
              "filter",
              "elements",
              "covered"
            ]
          },
          "created": {
            "type": "integer",
            "format": "int32"
          },
          "adopted": {
            "type": "integer",
            "format": "int32"
          },
          "adopted_completed": {
            "type": "integer",
            "format": "int32"
          },
          "already_present": {
            "type": "integer",
            "format": "int32"
          },
          "skipped": {
            "type": "integer",
            "format": "int32"
          },
          "labels_created": {
            "type": "integer",
            "format": "int32"
          },
          "taken": {
            "type": "integer",
            "format": "int32"
          },
          "remaining": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "AssignLabelBody": {
        "type": "object",
        "description": "The body of `assignLabel`.",
        "required": [
          "element_global_id"
        ],
        "properties": {
          "element_global_id": {
            "type": "string",
            "description": "The element.",
            "maxLength": 64,
            "minLength": 1
          },
          "move": {
            "type": "boolean",
            "description": "true moves a label that is on another element, as the app does; default false answers 409"
          }
        },
        "additionalProperties": false
      },
      "AssignPlanDoc": {
        "type": "object",
        "description": "A plan a dry run names.",
        "required": [
          "id",
          "name",
          "due_date",
          "scope_summary",
          "covered",
          "with_workflow"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope_summary": {
            "type": "object",
            "properties": {
              "ifc_type": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 1
                },
                "maxItems": 100,
                "minItems": 1
              },
              "storey_name": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 1
                },
                "maxItems": 100,
                "minItems": 1
              },
              "assigned": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "excluded": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "global_ids_count": {
                "type": "integer"
              }
            },
            "additionalProperties": false
          },
          "covered": {
            "type": "integer",
            "format": "int32"
          },
          "with_workflow": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "AssignableRole": {
        "type": "string",
        "description": "A role a member route gives.",
        "enum": [
          "viewer",
          "inspector",
          "admin"
        ]
      },
      "AssignedPlanDoc": {
        "type": "object",
        "description": "The plan an assign wrote to.",
        "required": [
          "id",
          "name",
          "created"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "created": {
            "type": "boolean"
          }
        }
      },
      "BcfImportResult": {
        "type": "object",
        "description": "How many topics the import added, updated and skipped, and why it skipped any.",
        "required": [
          "imported",
          "updated",
          "skipped",
          "errors"
        ],
        "properties": {
          "imported": {
            "type": "integer",
            "format": "int64"
          },
          "updated": {
            "type": "integer",
            "format": "int64"
          },
          "skipped": {
            "type": "integer",
            "format": "int64"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BcfUpload": {
        "type": "object",
        "description": "The import form: one BCF archive in `file`.",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "A BCF 2.1 or 3.0 ZIP"
          }
        }
      },
      "BoardCompany": {
        "type": "object",
        "description": "The organisation of a cell.",
        "required": [
          "name",
          "account_id"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The account."
          }
        }
      },
      "BoardWork": {
        "type": "object",
        "description": "A work-name column of the board.",
        "required": [
          "name",
          "start_date"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The work name."
          },
          "start_date": {
            "type": "string",
            "description": "Its earliest planned start."
          }
        }
      },
      "BoardZone": {
        "type": "object",
        "description": "A zone row of the board.",
        "required": [
          "id",
          "label",
          "element_count"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The zone."
          },
          "label": {
            "type": "string",
            "description": "Its label."
          },
          "element_count": {
            "type": "integer",
            "format": "int64",
            "description": "Its elements."
          }
        }
      },
      "CarryOver": {
        "type": "object",
        "description": "A live carry-over.",
        "required": [
          "id",
          "project_id",
          "model_id",
          "from_global_id",
          "to_global_id",
          "model_deleted",
          "from_name",
          "to_name",
          "model_version_id",
          "tier",
          "batch_id",
          "moved",
          "applied_by",
          "applied_by_name",
          "applied_at",
          "undone_at",
          "undone_by",
          "undone_by_name",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The carry-over."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "model_id": {
            "type": "string",
            "format": "uuid",
            "description": "The model."
          },
          "from_global_id": {
            "type": "string",
            "description": "The removed element the data came from; it stays archived"
          },
          "to_global_id": {
            "type": "string",
            "description": "The live element that took the data"
          },
          "model_deleted": {
            "type": "boolean",
            "description": "true when the model was deleted; the carry-over stays as history, without its elements"
          },
          "from_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "After a model delete, the removed element's name kept from it; otherwise null"
          },
          "to_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "After a model delete, the new element's name kept from it; otherwise null"
          },
          "model_version_id": {
            "type": "string",
            "format": "uuid",
            "description": "The model's current version when the data was carried"
          },
          "tier": {
            "$ref": "#/components/schemas/CarryOverTier",
            "description": "How the pair was matched: a sure or a likely proposal, or picked by hand"
          },
          "batch_id": {
            "type": "string",
            "format": "uuid",
            "description": "The batch it was applied in."
          },
          "moved": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CarryOverMoved",
                "description": "What moved to the new element. New counts may come."
              },
              {
                "type": "null"
              }
            ]
          },
          "applied_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who applied it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "applied_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "applied_at": {
            "type": "string",
            "description": "When it was applied."
          },
          "undone_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was undone."
          },
          "undone_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who undid it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "undone_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "CarryOverBody": {
        "type": "object",
        "required": [
          "pairs"
        ],
        "properties": {
          "pairs": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A removed element and the live one its data goes to.",
              "required": [
                "from",
                "to"
              ],
              "properties": {
                "from": {
                  "type": "string",
                  "maxLength": 200,
                  "minLength": 1
                },
                "to": {
                  "type": "string",
                  "maxLength": 200,
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "description": "`from` a removed element of the model, `to` a live one of its current version",
            "maxItems": 500,
            "minItems": 1
          },
          "batch_id": {
            "type": "string",
            "format": "uuid",
            "description": "Groups the pairs for undoCarryOvers; default derived from the Idempotency-Key, or new"
          }
        },
        "additionalProperties": false
      },
      "CarryOverCandidatePage": {
        "type": "object",
        "description": "One page of candidates.",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A live element of the model's current version.",
              "required": [
                "global_id",
                "name",
                "ifc_type",
                "type_name",
                "storey_name",
                "has_label",
                "in_remap"
              ],
              "properties": {
                "global_id": {
                  "type": "string",
                  "description": "GlobalId."
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Name, cut to 200 characters."
                },
                "ifc_type": {
                  "type": "string",
                  "description": "IFC class."
                },
                "type_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Type name, cut to 200 characters."
                },
                "storey_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Storey, cut to 200 characters."
                },
                "has_label": {
                  "type": "boolean",
                  "description": "It has a label."
                },
                "in_remap": {
                  "type": "boolean",
                  "description": "It is the target of an active carry-over."
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CarryOverItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CarryOver",
            "description": "A live carry-over."
          },
          {
            "$ref": "#/components/schemas/DeletedCarryOver",
            "description": "A deleted carry-over."
          }
        ],
        "description": "An item of `GET /v1/carry-overs`."
      },
      "CarryOverMoved": {
        "type": "object",
        "description": "What moved to the new element. New counts may come.",
        "properties": {
          "labels": {
            "type": "integer",
            "format": "int64",
            "description": "Labels."
          },
          "workflows": {
            "type": "integer",
            "format": "int64",
            "description": "Inspections."
          },
          "placeholders": {
            "type": "integer",
            "format": "int64",
            "description": "Placeholders."
          },
          "plan_rows": {
            "type": "integer",
            "format": "int64",
            "description": "Plan rows."
          },
          "plan_scopes": {
            "type": "integer",
            "format": "int64",
            "description": "Plan scopes."
          },
          "viewpoints": {
            "type": "integer",
            "format": "int64",
            "description": "Viewpoints."
          },
          "element_events": {
            "type": "integer",
            "format": "int64",
            "description": "Element events."
          }
        }
      },
      "CarryOverMovedBack": {
        "type": "object",
        "description": "What an undo moved back.",
        "properties": {
          "labels": {
            "type": "integer",
            "format": "int64"
          },
          "workflows": {
            "type": "integer",
            "format": "int64"
          },
          "plan_rows": {
            "type": "integer",
            "format": "int64"
          },
          "plan_scopes": {
            "type": "integer",
            "format": "int64"
          },
          "viewpoints": {
            "type": "integer",
            "format": "int64"
          },
          "element_events": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CarryOverPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CarryOverItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "CarryOverResult": {
        "type": "object",
        "required": [
          "batch_id",
          "pairs",
          "totals",
          "element_events_left"
        ],
        "properties": {
          "batch_id": {
            "type": "string"
          },
          "pairs": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One pair of a carry-over's answer.",
              "required": [
                "from",
                "to",
                "status"
              ],
              "properties": {
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "description": "A pair's status.",
                  "enum": [
                    "carried",
                    "refused"
                  ]
                },
                "carry_over_id": {
                  "type": "string"
                },
                "tier": {
                  "type": "string",
                  "description": "The tier of a carried pair: the proposal's, or `manual` when the pair was not the proposal.",
                  "enum": [
                    "varma",
                    "todennakoinen",
                    "manual"
                  ]
                },
                "moved": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CarryOverMoved"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "code": {
                  "type": "string",
                  "description": "Why a pair was refused.",
                  "enum": [
                    "LABEL_ON_BOTH",
                    "INSPECTION_ON_BOTH",
                    "REMAP_STALE"
                  ]
                },
                "element_events_left": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "totals": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CarryOverMoved"
              },
              {
                "type": "null"
              }
            ]
          },
          "element_events_left": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CarryOverTier": {
        "type": "string",
        "description": "How a carry-over's pair was matched.",
        "enum": [
          "varma",
          "todennakoinen",
          "manual"
        ]
      },
      "CellElement": {
        "type": "object",
        "description": "An element of a cell.",
        "required": [
          "name",
          "global_id"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "global_id": {
            "type": "string"
          }
        }
      },
      "CellState": {
        "type": "string",
        "description": "`CELL_STATES`: where a cell stands on its day.",
        "enum": [
          "not_started",
          "in_progress",
          "late",
          "installed"
        ]
      },
      "CellTask": {
        "type": "object",
        "description": "A task of a cell with its handoff state.",
        "required": [
          "name",
          "state",
          "total",
          "task_id",
          "installed",
          "work_name",
          "start_date",
          "finish_date",
          "last_event_id",
          "done_by"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "state": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/HandoffKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "task_id": {
            "type": "string",
            "format": "uuid"
          },
          "installed": {
            "type": "integer",
            "format": "int64"
          },
          "work_name": {
            "type": "string"
          },
          "start_date": {
            "type": "string"
          },
          "finish_date": {
            "type": "string"
          },
          "last_event_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "done_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/HandoffOrganisation"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CellZone": {
        "type": "object",
        "description": "The zone of a cell.",
        "required": [
          "id",
          "label"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "CheckBody": {
        "type": "object",
        "description": "A check of a check-list body.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "required": {
            "type": "boolean",
            "description": "Default true"
          }
        },
        "additionalProperties": false
      },
      "CheckList": {
        "type": "object",
        "description": "A live check list.",
        "required": [
          "id",
          "project_id",
          "organisation_id",
          "name",
          "description",
          "created_by",
          "created_at",
          "modified_date",
          "current_version",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The check list."
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null for the organisation's own check list"
          },
          "organisation_id": {
            "type": "string",
            "format": "uuid",
            "description": "Its organisation."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who created it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "created_at": {
            "type": "string",
            "description": "When it was created."
          },
          "modified_date": {
            "type": "string",
            "description": "When it was changed last."
          },
          "current_version": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CheckListVersion",
                "description": "Its current version."
              },
              {
                "type": "null"
              }
            ]
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "CheckListChanges": {
        "type": "object",
        "description": "The body of `updateOrganisationCheckList`.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NewCheckListItem"
            },
            "maxItems": 100,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "CheckListItem": {
        "type": "object",
        "description": "An item of `OrganisationCheckList`.",
        "required": [
          "id",
          "version_id",
          "sort_order",
          "name",
          "description",
          "required"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version_id": {
            "type": "string",
            "format": "uuid"
          },
          "sort_order": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean"
          }
        }
      },
      "CheckListListItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CheckList",
            "description": "A live row."
          },
          {
            "$ref": "#/components/schemas/DeletedCheckList",
            "description": "A deleted row."
          }
        ]
      },
      "CheckListPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckListListItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "CheckListSummary": {
        "type": "object",
        "description": "`pickCheckList()` with `item_count`: one of the organisation's check lists in a list.",
        "required": [
          "id",
          "name",
          "description",
          "current_version",
          "created_by",
          "created_at",
          "modified_date",
          "item_count"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "modified_date": {
            "type": "string"
          },
          "item_count": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "CheckListVersion": {
        "type": "object",
        "description": "A version of a check list.",
        "required": [
          "id",
          "version",
          "created_at",
          "items"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The version."
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "description": "Its number."
          },
          "created_at": {
            "type": "string",
            "description": "When it was made."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckListVersionItem"
            },
            "description": "Its items."
          }
        }
      },
      "CheckListVersionItem": {
        "type": "object",
        "description": "An item of a check-list version.",
        "required": [
          "id",
          "sort_order",
          "name",
          "description",
          "required"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The item_id a check result names"
          },
          "sort_order": {
            "type": "integer",
            "format": "int32",
            "description": "Its place."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "required": {
            "type": "boolean",
            "description": "True when it must pass."
          }
        }
      },
      "CheckListWithVersions": {
        "type": "object",
        "description": "A check list with a page of its versions.",
        "required": [
          "id",
          "project_id",
          "organisation_id",
          "name",
          "description",
          "created_by",
          "created_at",
          "modified_date",
          "current_version",
          "changed_at",
          "deleted",
          "versions",
          "next_before"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The check list."
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null for the organisation's own check list"
          },
          "organisation_id": {
            "type": "string",
            "format": "uuid",
            "description": "Its organisation."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who created it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "created_at": {
            "type": "string",
            "description": "When it was created."
          },
          "modified_date": {
            "type": "string",
            "description": "When it was changed last."
          },
          "current_version": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CheckListVersion",
                "description": "Its current version."
              },
              {
                "type": "null"
              }
            ]
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "versions": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/CheckListVersion"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "A page of the versions, newest first"
          },
          "next_before": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Pass as `versions_before` for the next page; null on the last"
          }
        }
      },
      "CheckLists": {
        "type": "object",
        "description": "`{ data }` of `listOrganisationCheckLists`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckListSummary"
            },
            "description": "The organisation's own check lists, newest first."
          }
        }
      },
      "CheckResultBody": {
        "type": "object",
        "description": "The body of `recordCheck`.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "failed",
              "na"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "fail_reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "occurred_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it happened on site, if earlier than now; the answer marks it entered later"
          }
        }
      },
      "Comment": {
        "type": "object",
        "description": "A live comment.",
        "required": [
          "guid",
          "project_id",
          "topic_guid",
          "comment",
          "viewpoint_guid",
          "author",
          "author_name",
          "date",
          "modified_author",
          "modified_date",
          "kind",
          "created_via",
          "via_client_id",
          "entered_later",
          "recorded_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "guid": {
            "type": "string",
            "format": "uuid",
            "description": "The comment."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "topic_guid": {
            "type": "string",
            "format": "uuid",
            "description": "Its topic."
          },
          "comment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its text."
          },
          "viewpoint_guid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The viewpoint it is on."
          },
          "author": {
            "type": "string",
            "description": "Its author's e-mail."
          },
          "author_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The author's name, read when answering."
          },
          "date": {
            "type": "string",
            "description": "When it was written."
          },
          "modified_author": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who changed it last."
          },
          "modified_date": {
            "type": "string",
            "description": "When it was changed last."
          },
          "kind": {
            "type": [
              "string",
              "null"
            ],
            "description": "`verdict` for the comment an inspection verdict writes, `check_results` for the summary a grouped step writes, `checks_recorded` for the checks an agent records; null otherwise. New kinds may come."
          },
          "created_via": {
            "type": [
              "string",
              "null"
            ],
            "description": "How it was written."
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client that wrote it."
          },
          "entered_later": {
            "type": "boolean",
            "description": "True when recorded after the fact."
          },
          "recorded_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was recorded."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "CommentItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Comment",
            "description": "A live row."
          },
          {
            "$ref": "#/components/schemas/DeletedComment",
            "description": "A deleted row."
          }
        ]
      },
      "CommentPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommentItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "CreateCheckListBody": {
        "type": "object",
        "description": "The body of `createCheckList`.",
        "required": [
          "name",
          "items"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckBody"
            },
            "description": "Version 1. A version holds at most 256 KiB of checks serialized as JSON; more answers 400 VALIDATION_ERROR.",
            "maxItems": 100,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "CreateFindingBody": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "topic_type": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "topic_status": {
            "type": "string",
            "description": "Default Open",
            "maxLength": 255
          },
          "priority": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "assigned_to": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "An RFC 3339 time or a YYYY-MM-DD date",
            "maxLength": 64
          },
          "element_global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64,
              "minLength": 1
            },
            "description": "GlobalIds of live elements in the project; the finding selects them",
            "maxItems": 100
          },
          "storey_global_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The storey a point is on (spec 054 §3.8)",
            "maxLength": 64,
            "minLength": 1
          },
          "point": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PointBody",
                "description": "Metres in the model's coordinates, z at the storey's floor; each strictly between -10000000 and 10000000 m"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CreateLabelsBody": {
        "type": "object",
        "description": "The body of `createLabels`: `count` or `element_global_ids`.",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Labels on no element, to print and link later",
            "maximum": 500,
            "minimum": 1
          },
          "element_global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An element's IFC GlobalId in a list.",
              "maxLength": 64,
              "minLength": 1
            },
            "description": "One label linked to each element; an element that has a label or is not in the current model is skipped",
            "maxItems": 500,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "CreateModelVersionBody": {
        "type": "object",
        "required": [
          "filename"
        ],
        "properties": {
          "filename": {
            "type": "string",
            "description": "Letters, digits, underscore, dot, dash and space; ends with .ifc",
            "example": "rakenne.ifc",
            "maxLength": 255,
            "minLength": 1
          },
          "content_type": {
            "type": "string",
            "description": "Default application/octet-stream; send the same Content-Type with the PUT",
            "enum": [
              "application/octet-stream",
              "model/ifc"
            ]
          },
          "model_id": {
            "type": "string",
            "format": "uuid",
            "description": "Upload a new version of this model; without it the file starts a new model"
          }
        },
        "additionalProperties": false
      },
      "CreateReferenceDocumentBody": {
        "type": "object",
        "required": [
          "key",
          "filename"
        ],
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1
          },
          "filename": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
          }
        },
        "additionalProperties": false
      },
      "CreateTemplateBody": {
        "type": "object",
        "description": "The body of `createTemplate`.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "is_default": {
            "type": "boolean",
            "description": "The project's default template: opened for an element no plan covers. Default false"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateTemplateStepBody"
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false
      },
      "CreateTemplateStepBody": {
        "type": "object",
        "description": "A step of `CreateTemplateBody`.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "required": {
            "type": "boolean",
            "description": "Default true"
          },
          "sequential": {
            "type": "boolean",
            "description": "Default true: the step waits for the required steps before it"
          },
          "check_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A check list of the project or the organisation; the step is then passed by its checks"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "CreatedLabels": {
        "type": "object",
        "description": "The answer of `createLabels`.",
        "required": [
          "labels",
          "skipped"
        ],
        "properties": {
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Label"
            },
            "description": "The labels, by GIAI."
          },
          "skipped": {
            "type": "integer",
            "format": "int64",
            "description": "Elements that got no label: they had one, or are not in the current model"
          }
        }
      },
      "CreatedPerson": {
        "allOf": [
          {
            "type": "object",
            "description": "`Person`: a person of the organisation.",
            "required": [
              "id",
              "email",
              "name",
              "role",
              "created_at"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "role": {
                "$ref": "#/components/schemas/PersonRole"
              },
              "created_at": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "warning_details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/WarningDetail"
                },
                "description": "The address is on a domain that signs in with SSO; the person is created anyway"
              }
            }
          }
        ],
        "description": "`CreatedPerson`: the invited person."
      },
      "DecideDraftBody": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string",
            "description": "The language of the comment that names the drafting integration; default fi",
            "enum": [
              "fi",
              "en"
            ]
          }
        },
        "additionalProperties": false
      },
      "DefaultView": {
        "type": "string",
        "description": "Which list a storey with spaces opens on.",
        "enum": [
          "types",
          "spaces"
        ]
      },
      "DeletedAccessRequest": {
        "type": "object",
        "description": "A deleted access request.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The request."
          }
        }
      },
      "DeletedCarryOver": {
        "type": "object",
        "description": "A deleted carry-over.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The carry-over."
          }
        }
      },
      "DeletedCheckList": {
        "type": "object",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DeletedComment": {
        "type": "object",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "guid"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "guid": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DeletedElement": {
        "type": "object",
        "description": "A deleted element.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "global_id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "global_id": {
            "type": "string",
            "description": "The IFC GlobalId."
          }
        }
      },
      "DeletedElementEvent": {
        "type": "object",
        "description": "A deleted element event.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The event."
          }
        }
      },
      "DeletedFinding": {
        "type": "object",
        "description": "A deleted topic.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "guid"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "guid": {
            "type": "string",
            "format": "uuid",
            "description": "The topic."
          }
        }
      },
      "DeletedFindingDraft": {
        "type": "object",
        "description": "A deleted finding draft.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The draft."
          }
        }
      },
      "DeletedFindingFile": {
        "type": "object",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string"
          }
        }
      },
      "DeletedInspection": {
        "type": "object",
        "description": "A deleted inspection.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The inspection."
          }
        }
      },
      "DeletedInspectionPlan": {
        "type": "object",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DeletedInspectionPlanElement": {
        "type": "object",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "element_key"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "element_key": {
            "type": "string"
          }
        }
      },
      "DeletedLabel": {
        "type": "object",
        "description": "A deleted label.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The label."
          }
        }
      },
      "DeletedMaintenanceLogEntry": {
        "type": "object",
        "description": "A deleted maintenance entry.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The entry."
          }
        }
      },
      "DeletedMember": {
        "type": "object",
        "description": "A removed member.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "user_id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "user_id": {
            "type": "string",
            "description": "The person.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          }
        }
      },
      "DeletedModelVersion": {
        "type": "object",
        "description": "A deleted model version.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The version."
          }
        }
      },
      "DeletedProject": {
        "type": "object",
        "description": "A project deleted or lost.",
        "required": [
          "project_id",
          "id",
          "changed_at",
          "deleted",
          "reason"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project, again."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When it was deleted or lost."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedProjectReason",
            "description": "access_removed: the principal lost the project; drop its data"
          }
        }
      },
      "DeletedProjectReason": {
        "type": "string",
        "description": "Why a project left the list.",
        "enum": [
          "deleted",
          "access_removed"
        ]
      },
      "DeletedReason": {
        "type": "string",
        "description": "The reason of a tombstone of `DeletedSchema`.",
        "enum": [
          "deleted"
        ]
      },
      "DeletedReferenceDocument": {
        "type": "object",
        "description": "A deleted reference document.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The document."
          }
        }
      },
      "DeletedRelatedFinding": {
        "type": "object",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "link_key"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "link_key": {
            "type": "string"
          }
        }
      },
      "DeletedScheduleImport": {
        "type": "object",
        "description": "A deleted schedule import.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The import."
          }
        }
      },
      "DeletedScheduleTask": {
        "type": "object",
        "description": "A deleted schedule task.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The task."
          }
        }
      },
      "DeletedTemplate": {
        "type": "object",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DeletedViewpoint": {
        "type": "object",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "guid"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "guid": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DeletedZone": {
        "type": "object",
        "description": "A deleted zone.",
        "required": [
          "project_id",
          "changed_at",
          "deleted",
          "reason",
          "id"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "changed_at": {
            "type": "string",
            "description": "When the row was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/DeletedReason",
            "description": "Always `deleted`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The zone."
          }
        }
      },
      "Denied": {
        "type": "object",
        "description": "The answer of `denyAccessRequest`.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "A denied request.",
            "enum": [
              "denied"
            ]
          }
        }
      },
      "DeviationCounts": {
        "type": "object",
        "description": "The five counts of a report or group.",
        "required": [
          "total",
          "failed_check",
          "finding",
          "returned",
          "late_install"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32",
            "description": "Every deviation."
          },
          "failed_check": {
            "type": "integer",
            "format": "int32",
            "description": "Failed checks."
          },
          "finding": {
            "type": "integer",
            "format": "int32",
            "description": "Findings."
          },
          "returned": {
            "type": "integer",
            "format": "int32",
            "description": "Zones returned."
          },
          "late_install": {
            "type": "integer",
            "format": "int32",
            "description": "Late installs."
          }
        }
      },
      "DeviationGroupItem": {
        "type": "object",
        "description": "One group of a report page.",
        "required": [
          "key",
          "label",
          "total",
          "failed_check",
          "finding",
          "returned",
          "late_install"
        ],
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The zone id, organisation id or GlobalId; null for deviations with none"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "zone_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "failed_check": {
            "type": "integer",
            "format": "int32"
          },
          "finding": {
            "type": "integer",
            "format": "int32"
          },
          "returned": {
            "type": "integer",
            "format": "int32"
          },
          "late_install": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "DeviationItem": {
        "type": "object",
        "description": "One deviation.",
        "required": [
          "kind",
          "occurred_at",
          "zone_id",
          "zone_label",
          "account_id",
          "organisation",
          "global_id",
          "element_name",
          "work_name",
          "detail",
          "finding_id",
          "delay_days"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "What kind of deviation a row is; new kinds may come.",
            "enum": [
              "failed_check",
              "finding",
              "returned",
              "late_install"
            ]
          },
          "occurred_at": {
            "type": "string"
          },
          "zone_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "zone_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "organisation": {
            "type": [
              "string",
              "null"
            ],
            "description": "The organisation responsible for the work"
          },
          "global_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "element_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "work_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "finding_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "delay_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          }
        }
      },
      "DeviationReportPage": {
        "type": "object",
        "description": "`DeviationReportPage`: the range's totals and one page of groups or deviations.",
        "required": [
          "from",
          "to",
          "by",
          "totals",
          "next_cursor"
        ],
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "by": {
            "type": "string",
            "description": "What a deviation report groups by.",
            "enum": [
              "zone",
              "organisation",
              "element",
              "deviation"
            ]
          },
          "totals": {
            "$ref": "#/components/schemas/DeviationCounts"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeviationGroupItem"
            },
            "description": "With `by` zone, organisation or element"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeviationItem"
            },
            "description": "With `by` deviation"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DraftPointDoc": {
        "type": "object",
        "description": "Metres in the model's coordinates, z at the storey's floor",
        "required": [
          "x",
          "y",
          "z"
        ],
        "properties": {
          "x": {
            "type": "number",
            "format": "double"
          },
          "y": {
            "type": "number",
            "format": "double"
          },
          "z": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "Element": {
        "type": "object",
        "description": "A live element.",
        "required": [
          "project_id",
          "global_id",
          "name",
          "ifc_type",
          "predefined_type",
          "type_name",
          "building_name",
          "storey_name",
          "archived_at",
          "origin",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "global_id": {
            "type": "string",
            "description": "The IFC GlobalId."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The element's name."
          },
          "ifc_type": {
            "type": "string",
            "description": "The IFC class."
          },
          "predefined_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The IFC predefined type."
          },
          "type_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The type's name."
          },
          "building_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The building."
          },
          "storey_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The storey."
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the element left the model."
          },
          "origin": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ElementOrigin",
                "description": "The placement's origin."
              },
              {
                "type": "null"
              }
            ]
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "ElementCounts": {
        "type": "object",
        "description": "`ElementCounts`: live elements by IFC type and by storey.",
        "required": [
          "total",
          "ifc_types",
          "storeys"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "ifc_types": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Live elements of one IFC type.",
              "required": [
                "ifc_type",
                "count"
              ],
              "properties": {
                "ifc_type": {
                  "type": "string"
                },
                "count": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "description": "Most elements first"
          },
          "storeys": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Live elements of one storey name.",
              "required": [
                "storey_name",
                "count"
              ],
              "properties": {
                "storey_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "count": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "description": "By name; elements on no storey last, with null"
          }
        }
      },
      "ElementDetail": {
        "type": "object",
        "description": "`ElementDetail`: one element with its property sets.",
        "required": [
          "global_id",
          "project_id",
          "name",
          "ifc_type",
          "predefined_type",
          "storey_name",
          "building_name",
          "type_name",
          "part_count",
          "archived_at",
          "properties",
          "moved_to",
          "model_version_id"
        ],
        "properties": {
          "global_id": {
            "type": "string"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ifc_type": {
            "type": "string"
          },
          "predefined_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "storey_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "building_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "type_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "part_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when a later version of its model no longer has the element"
          },
          "properties": {
            "type": [
              "object",
              "null"
            ],
            "description": "Property sets by name, each with its properties by name; a value is a string, a number or a boolean",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {},
              "propertyNames": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "moved_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "For an archived element whose data was carried over: the live element it went to"
          },
          "model_version_id": {
            "type": "string",
            "format": "uuid",
            "description": "The model version the element was last read from"
          }
        }
      },
      "ElementEvent": {
        "type": "object",
        "description": "A live element event.",
        "required": [
          "id",
          "project_id",
          "global_id",
          "model_deleted",
          "element_name",
          "kind",
          "occurred_at",
          "recorded_at",
          "entered_later",
          "recorded_by",
          "recorded_by_name",
          "account_id",
          "account_name",
          "created_via",
          "via_client_id",
          "load_ref",
          "voided_at",
          "voided_by",
          "voided_by_name",
          "void_reason",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The event."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "global_id": {
            "type": "string",
            "description": "The element's IFC GlobalId."
          },
          "model_deleted": {
            "type": "boolean",
            "description": "true when the element's model was deleted; the event stays, without its element"
          },
          "element_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "After a model delete, the element's name kept from it; otherwise null"
          },
          "kind": {
            "type": "string",
            "description": "`delivered`, `received_on_site` or `installed`; more may come."
          },
          "occurred_at": {
            "type": "string",
            "description": "When it happened."
          },
          "recorded_at": {
            "type": "string",
            "description": "When it was recorded."
          },
          "entered_later": {
            "type": "boolean",
            "description": "True when recorded after the fact."
          },
          "recorded_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who recorded it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "recorded_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Their organisation."
          },
          "account_name": {
            "type": "string",
            "description": "Its name when recorded."
          },
          "created_via": {
            "type": [
              "string",
              "null"
            ],
            "description": "How it was recorded."
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client that recorded it."
          },
          "load_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The load it came with."
          },
          "voided_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was voided."
          },
          "voided_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who voided it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "voided_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "void_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it was voided."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "ElementEventItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ElementEvent",
            "description": "A live event."
          },
          {
            "$ref": "#/components/schemas/DeletedElementEvent",
            "description": "A deleted event."
          }
        ],
        "description": "An item of `GET /v1/element-events`."
      },
      "ElementEventKind": {
        "type": "string",
        "description": "The kind of an element event.",
        "enum": [
          "delivered",
          "received_on_site",
          "installed"
        ]
      },
      "ElementEventPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElementEventItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ElementEventRefusal": {
        "type": "string",
        "description": "Why an element took no event.",
        "enum": [
          "ALREADY_RECORDED",
          "ELEMENT_NOT_FOUND",
          "ELEMENT_REMOVED"
        ]
      },
      "ElementItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Element",
            "description": "A live element."
          },
          {
            "$ref": "#/components/schemas/DeletedElement",
            "description": "A deleted element."
          }
        ],
        "description": "An item of `GET /v1/elements`."
      },
      "ElementMatch": {
        "type": "object",
        "description": "`ElementMatch`: an element of a query page with the conditions' values on it.",
        "required": [
          "global_id",
          "project_id",
          "name",
          "ifc_type",
          "predefined_type",
          "storey_name",
          "building_name",
          "type_name",
          "archived_at",
          "matched",
          "model_version_id"
        ],
        "properties": {
          "global_id": {
            "type": "string"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ifc_type": {
            "type": "string"
          },
          "predefined_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "storey_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "building_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "type_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "matched": {
            "type": "object",
            "description": "The conditions' values on this element, keyed `pset.property`",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "model_version_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ElementOrigin": {
        "type": "object",
        "description": "An element's placement origin.",
        "required": [
          "x",
          "y",
          "z"
        ],
        "properties": {
          "x": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Along the model's x axis."
          },
          "y": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Along the model's y axis."
          },
          "z": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Along the model's z axis."
          }
        }
      },
      "ElementPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElementItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ElementPropertyCondition": {
        "type": "object",
        "description": "One condition on a property of the elements.",
        "required": [
          "pset",
          "property",
          "op"
        ],
        "properties": {
          "pset": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "property": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "op": {
            "type": "string",
            "description": "`eq`, `prefix` and `contains` take `value`; `in` takes `values`; `exists` neither",
            "enum": [
              "eq",
              "prefix",
              "contains",
              "in",
              "exists"
            ]
          },
          "value": {
            "type": "string",
            "maxLength": 255
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255
            },
            "maxItems": 5000,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "ElementPropertySummary": {
        "type": "object",
        "description": "`ElementPropertySummary`: the property sets and properties the project's elements have.",
        "required": [
          "elements_with_properties",
          "keys",
          "dropped",
          "models_without_properties"
        ],
        "properties": {
          "elements_with_properties": {
            "type": "integer",
            "format": "int64"
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One property over the merged models.",
              "required": [
                "pset",
                "property",
                "type",
                "count",
                "distinct",
                "complete",
                "values"
              ],
              "properties": {
                "pset": {
                  "type": "string"
                },
                "property": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "description": "The type of a summarised property.",
                  "enum": [
                    "string",
                    "number",
                    "boolean",
                    "mixed"
                  ]
                },
                "count": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Elements that have the property"
                },
                "distinct": {
                  "type": "integer",
                  "format": "int64"
                },
                "complete": {
                  "type": "boolean",
                  "description": "false when `values` holds only the most common values"
                },
                "values": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ElementPropertyValueCount"
                  },
                  "description": "Most common first, as the text the filter compares"
                }
              }
            }
          },
          "dropped": {
            "type": "object",
            "description": "What the summary left out at its limits.",
            "required": [
              "values",
              "properties",
              "assets_capped"
            ],
            "properties": {
              "values": {
                "type": "integer",
                "format": "int64"
              },
              "properties": {
                "type": "integer",
                "format": "int64"
              },
              "assets_capped": {
                "type": "integer",
                "format": "int64"
              }
            }
          },
          "models_without_properties": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Model versions read before properties were kept"
          }
        }
      },
      "ElementPropertyValueCount": {
        "type": "object",
        "description": "`ElementPropertyValueCount`: one value and the elements that have it.",
        "required": [
          "value",
          "count"
        ],
        "properties": {
          "value": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ElementQuery": {
        "type": "object",
        "description": "The filter of an element query and the page to read.",
        "properties": {
          "model_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "ifc_type": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "storey_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "search": {
            "type": [
              "string",
              "null"
            ],
            "description": "Part of the name, type name or GlobalId",
            "maxLength": 255
          },
          "properties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElementPropertyCondition"
            },
            "description": "Every condition must hold",
            "default": [],
            "maxItems": 10
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "default": 200,
            "maximum": 200,
            "minimum": 1
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `next_cursor` of the previous page; the other fields must be the same",
            "maxLength": 2048
          },
          "include_total": {
            "type": "boolean",
            "default": true
          }
        },
        "additionalProperties": false
      },
      "ElementQueryPage": {
        "type": "object",
        "description": "`ElementQueryPage`: one page of `queryElements`.",
        "required": [
          "data",
          "total",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElementMatch"
            }
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "null with `include_total: false` and on every page after the first"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "value_counts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ElementPropertyValueCount"
            },
            "description": "First page with an `in` condition: each of its values with the elements that have it, in the order sent"
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "The error body of every `/v1` answer of 400 or more.",
        "required": [
          "error",
          "code",
          "request_id"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "A sentence for people; it may change"
          },
          "code": {
            "type": "string",
            "description": "Part of the contract"
          },
          "details": {
            "description": "What the code names, where it names something"
          },
          "request_id": {
            "type": "string",
            "description": "The `X-Request-Id` of the call"
          }
        }
      },
      "ExportFileLink": {
        "type": "object",
        "description": "The answer of `getExportJobFile`.",
        "required": [
          "url",
          "expires_in"
        ],
        "properties": {
          "url": {
            "type": "string",
            "description": "A signed GET of the file, served as an attachment with its name; valid for 60 seconds from now. A download that starts in time completes."
          },
          "expires_in": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds the link is valid.",
            "minimum": 0
          }
        }
      },
      "ExportJob": {
        "type": "object",
        "description": "An export job.",
        "required": [
          "id",
          "project_id",
          "kind",
          "status",
          "params",
          "counts",
          "truncated",
          "omitted",
          "code",
          "message",
          "created_at",
          "started_at",
          "finished_at",
          "expires_at",
          "files"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "description": "What a job exports.",
            "enum": [
              "csv_topics",
              "csv_assets",
              "csv_inspections",
              "as_built_csv",
              "report_md",
              "report_pdf",
              "handover"
            ]
          },
          "status": {
            "type": "string",
            "description": "Poll while `queued` or `running`. `done`: download each file. `refused`: `message` says why (too large, too slow). `failed`: start it again with a new Idempotency-Key; a job cut off before it ends reads `failed` a minute after it started. `expired`: the files are gone. New statuses may come.",
            "enum": [
              "queued",
              "running",
              "done",
              "refused",
              "failed",
              "cancelled",
              "expired"
            ]
          },
          "params": {
            "type": "object",
            "description": "The parameters of an export job.",
            "properties": {
              "language": {
                "type": "string",
                "description": "`fi` or `en`.",
                "enum": [
                  "fi",
                  "en"
                ]
              },
              "stages": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "propertyNames": {
                  "type": "string"
                }
              }
            }
          },
          "counts": {
            "type": [
              "object",
              "null"
            ],
            "description": "What the files hold, by kind: rows, findings, photos",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "truncated": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Files that stop at their row limit"
          },
          "omitted": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Files a handover package left out because they could not be built in time"
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "EXPORT_REFUSED or EXPORT_FAILED"
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "started_at": {
            "type": "string"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the files go; 24 hours after the job is done"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A file of an export job.",
              "required": [
                "name",
                "sha256",
                "size_bytes",
                "content_type"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "sha256": {
                  "type": "string",
                  "description": "Hex SHA-256 of the file"
                },
                "size_bytes": {
                  "type": "integer",
                  "format": "int64"
                },
                "content_type": {
                  "type": "string"
                }
              }
            },
            "description": "Download file n with getExportJobFile and `file=n`"
          }
        }
      },
      "ExportJobs": {
        "type": "object",
        "description": "The answer of `listExportJobs`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExportJob"
            },
            "description": "The jobs, newest first."
          }
        }
      },
      "ExportStages": {
        "type": "object",
        "description": "For as_built_csv and handover: the template whose latest passed inspection dates each stage; a stage left out stays empty",
        "properties": {
          "factory_check": {
            "type": "string",
            "format": "uuid"
          },
          "delivered": {
            "type": "string",
            "format": "uuid"
          },
          "received": {
            "type": "string",
            "format": "uuid"
          },
          "installed": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "FactColumns": {
        "type": "object",
        "description": "The columns of [`ScheduleElementFacts`]: one position per element with an effective installation task, by GlobalId.",
        "required": [
          "global_id",
          "task",
          "installed",
          "passed",
          "defect",
          "defect_until"
        ],
        "properties": {
          "global_id": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The elements."
          },
          "task": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Index into `tasks`."
          },
          "installed": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "Day of the live installed event, YYYY-MM-DD in Europe/Helsinki, or null."
          },
          "passed": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "Day the first completed inspection finished, YYYY-MM-DD in Europe/Helsinki, or null."
          },
          "defect": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "Day the element's earliest defect began, YYYY-MM-DD in Europe/Helsinki, or null."
          },
          "defect_until": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "Day the last of those defects closed, YYYY-MM-DD in Europe/Helsinki; null while one is open."
          }
        }
      },
      "FailReasonListChanges": {
        "type": "object",
        "description": "The body of `updateOrganisationFailReasonList`.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 120,
              "minLength": 1
            },
            "maxItems": 30,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "FailReasonListItem": {
        "type": "object",
        "description": "One of the organisation's fail-reason lists, members in the order `listFailReasonLists` writes them.",
        "required": [
          "id",
          "name",
          "is_default",
          "modified_date",
          "reasons"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The list."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "is_default": {
            "type": "boolean",
            "description": "The organisation's default."
          },
          "modified_date": {
            "type": "string",
            "description": "When it was changed last."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The reasons an inspector picks from; \"Muu\" with free text is always offered too"
          }
        }
      },
      "FailReasonLists": {
        "type": "object",
        "description": "`{ data }` of `listFailReasonLists`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FailReasonListItem"
            },
            "description": "The lists."
          }
        }
      },
      "Finding": {
        "type": "object",
        "description": "A live topic.",
        "required": [
          "guid",
          "project_id",
          "server_assigned_id",
          "title",
          "topic_type",
          "topic_status",
          "priority",
          "assigned_to",
          "labels",
          "description",
          "stage",
          "creation_author",
          "creation_date",
          "modified_author",
          "modified_date",
          "due_date",
          "closed_at",
          "created_via",
          "via_client_id",
          "entered_later",
          "recorded_at",
          "is_finding",
          "elements",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "guid": {
            "type": "string",
            "format": "uuid",
            "description": "The topic."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "server_assigned_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its number."
          },
          "title": {
            "type": "string",
            "description": "Its title."
          },
          "topic_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its BCF type."
          },
          "topic_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its BCF status."
          },
          "priority": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its priority."
          },
          "assigned_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who it is assigned to."
          },
          "labels": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Its labels."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its stage."
          },
          "creation_author": {
            "type": "string",
            "description": "Who created it."
          },
          "creation_date": {
            "type": "string",
            "description": "When it was created."
          },
          "modified_author": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who changed it last."
          },
          "modified_date": {
            "type": "string",
            "description": "When it was changed last."
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it is due."
          },
          "closed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was closed."
          },
          "created_via": {
            "type": [
              "string",
              "null"
            ],
            "description": "How it was created."
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client that created it."
          },
          "entered_later": {
            "type": "boolean",
            "description": "True when recorded after the fact."
          },
          "recorded_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was recorded."
          },
          "is_finding": {
            "type": "boolean",
            "description": "True for a finding."
          },
          "elements": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The GlobalIds of its first viewpoint."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "FindingCommentBody": {
        "type": "object",
        "required": [
          "comment"
        ],
        "properties": {
          "comment": {
            "type": "string",
            "maxLength": 20000,
            "minLength": 1
          },
          "viewpoint_guid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A viewpoint of the same finding"
          }
        },
        "additionalProperties": false
      },
      "FindingCommentChange": {
        "type": "object",
        "properties": {
          "comment": {
            "type": "string",
            "maxLength": 20000,
            "minLength": 1
          },
          "viewpoint_guid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "FindingDraft": {
        "type": "object",
        "description": "A live finding draft.",
        "required": [
          "id",
          "project_id",
          "title",
          "description",
          "priority",
          "labels",
          "element_global_ids",
          "storey_global_id",
          "point",
          "source_ref",
          "status",
          "created_by",
          "created_by_name",
          "created_via",
          "via_client_id",
          "created_at",
          "decided_by",
          "decided_by_name",
          "decided_at",
          "topic_guid",
          "photo_keys",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The draft."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "title": {
            "type": "string",
            "description": "Its title."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "priority": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its priority."
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Its labels."
          },
          "element_global_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The elements it selects."
          },
          "storey_global_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The storey its point is on."
          },
          "point": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ViewpointPoint",
                "description": "Metres in the model's coordinates, z at the storey's floor"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "The integration's own id for it."
          },
          "status": {
            "$ref": "#/components/schemas/FindingDraftStatus",
            "description": "`pending`, `published` or `rejected`."
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who created it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "created_via": {
            "type": [
              "string",
              "null"
            ],
            "description": "How it was created."
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client that created it."
          },
          "created_at": {
            "type": "string",
            "description": "When it was created."
          },
          "decided_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who decided it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "decided_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was decided."
          },
          "topic_guid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The published finding."
          },
          "photo_keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The photos the draft carries; each becomes a photo of the published finding"
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "FindingDraftCreated": {
        "type": "object",
        "description": "A draft as `/v1` answers it; for the document only.",
        "required": [
          "id",
          "project_id",
          "title",
          "description",
          "priority",
          "labels",
          "element_global_ids",
          "storey_global_id",
          "point",
          "source_ref",
          "status",
          "created_by",
          "created_by_name",
          "created_via",
          "via_client_id",
          "created_at",
          "decided_by",
          "decided_by_name",
          "decided_at",
          "topic_guid",
          "photo_keys"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "priority": {
            "type": [
              "string",
              "null"
            ]
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "element_global_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "storey_global_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "point": {
            "oneOf": [
              {
                "type": "object",
                "description": "Metres in the model's coordinates, z at the storey's floor",
                "required": [
                  "x",
                  "y",
                  "z"
                ],
                "properties": {
                  "x": {
                    "type": "number",
                    "format": "double"
                  },
                  "y": {
                    "type": "number",
                    "format": "double"
                  },
                  "z": {
                    "type": "number",
                    "format": "double"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "source_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "published",
              "rejected"
            ]
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_via": {
            "type": [
              "string",
              "null"
            ]
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "decided_by": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "decided_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "topic_guid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "photo_keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The photos the draft carries; each becomes a photo of the published finding"
          }
        }
      },
      "FindingDraftItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/FindingDraft",
            "description": "A live draft."
          },
          {
            "$ref": "#/components/schemas/DeletedFindingDraft",
            "description": "A deleted draft."
          }
        ],
        "description": "An item of `GET /v1/finding-drafts`."
      },
      "FindingDraftPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FindingDraftItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "FindingDraftStatus": {
        "type": "string",
        "description": "A draft's state.",
        "enum": [
          "pending",
          "published",
          "rejected"
        ]
      },
      "FindingFile": {
        "type": "object",
        "description": "A live finding file.",
        "required": [
          "id",
          "project_id",
          "topic_guid",
          "ifc_project",
          "filename",
          "reference",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "A whole number as a string"
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "topic_guid": {
            "type": "string",
            "format": "uuid",
            "description": "Its topic."
          },
          "ifc_project": {
            "type": [
              "string",
              "null"
            ],
            "description": "The IFC project."
          },
          "filename": {
            "type": [
              "string",
              "null"
            ],
            "description": "The file's name."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its reference."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "FindingFileItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/FindingFile",
            "description": "A live row."
          },
          {
            "$ref": "#/components/schemas/DeletedFindingFile",
            "description": "A deleted row."
          }
        ]
      },
      "FindingFilePage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FindingFileItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "FindingItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Finding",
            "description": "A live topic."
          },
          {
            "$ref": "#/components/schemas/DeletedFinding",
            "description": "A deleted topic."
          }
        ],
        "description": "An item of `GET /v1/findings`."
      },
      "FindingPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FindingItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "FindingValues": {
        "type": "object",
        "description": "`FindingValues`: the values the app offers on the project's findings.",
        "required": [
          "topic_statuses",
          "priorities",
          "topic_types",
          "stages",
          "topic_labels"
        ],
        "properties": {
          "topic_statuses": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Values for `topic_status`"
          },
          "priorities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Values for `priority`"
          },
          "topic_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Values for `topic_type`"
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Values for `stage`"
          },
          "topic_labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The labels the app offers for `labels`"
          }
        }
      },
      "FindingViewpointBody": {
        "type": "object",
        "properties": {
          "photo_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "A key from uploadFindingPhoto, uploaded before this call",
            "maxLength": 1024,
            "minLength": 1
          },
          "element_global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64,
              "minLength": 1
            },
            "description": "GlobalIds of live elements in the project; the finding selects them",
            "maxItems": 100
          },
          "storey_global_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The storey a point is on (spec 054 §3.8)",
            "maxLength": 64,
            "minLength": 1
          },
          "point": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PointBody",
                "description": "Metres in the model's coordinates, z at the storey's floor; each strictly between -10000000 and 10000000 m"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "HandoffCell": {
        "type": "object",
        "description": "`GET …/handoffs/{zoneId}`: the cell's tasks and states, its history, its defects and up to 200 of its elements.",
        "required": [
          "zone",
          "work_name",
          "approval",
          "may_record_done",
          "may_receive",
          "tasks",
          "events",
          "defects",
          "elements"
        ],
        "properties": {
          "zone": {
            "$ref": "#/components/schemas/CellZone"
          },
          "work_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "approval": {
            "type": "boolean",
            "description": "The project asks for an approval after a receive"
          },
          "may_record_done": {
            "type": "boolean"
          },
          "may_receive": {
            "type": "boolean"
          },
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CellTask"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HandoffEvent"
            },
            "description": "The latest 100 handoffs, oldest first"
          },
          "defects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HandoffDefect"
            }
          },
          "elements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CellElement"
            },
            "description": "At most 200 elements of the cell, by name; listZoneElements and listScheduleTaskElements have them all"
          }
        }
      },
      "HandoffDefect": {
        "type": "object",
        "description": "A defect of a handoff with its finding.",
        "required": [
          "finding_id",
          "number",
          "title",
          "status",
          "open",
          "blocking",
          "handoff_event_id",
          "task_id",
          "global_ids",
          "responsible"
        ],
        "properties": {
          "finding_id": {
            "type": "string",
            "format": "uuid",
            "description": "The finding's guid"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "open": {
            "type": "boolean"
          },
          "blocking": {
            "type": "boolean"
          },
          "handoff_event_id": {
            "type": "string",
            "format": "uuid"
          },
          "task_id": {
            "type": "string",
            "format": "uuid"
          },
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "responsible": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/HandoffOrganisation"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "HandoffEvent": {
        "type": "object",
        "description": "One handoff event.",
        "required": [
          "id",
          "task_id",
          "task_name",
          "kind",
          "occurred_at",
          "recorded_at",
          "entered_later",
          "actor_name",
          "account_id",
          "account_name",
          "created_via",
          "via_client_id",
          "via_client_name",
          "note"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "task_id": {
            "type": "string",
            "format": "uuid"
          },
          "task_name": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/HandoffKind",
            "description": "New kinds may come"
          },
          "occurred_at": {
            "type": "string"
          },
          "recorded_at": {
            "type": "string"
          },
          "entered_later": {
            "type": "boolean"
          },
          "actor_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_name": {
            "type": "string"
          },
          "created_via": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for a person in the app; `agent`, `integration` or `app` otherwise. New values may come."
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The integration's id or the app's client id when created_via is integration or app"
          },
          "via_client_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The registered name of the app when created_via is app; the app shows it as {person} · sovelluksella {app}"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HandoffKind": {
        "type": "string",
        "description": "A handoff transition.",
        "enum": [
          "done",
          "received",
          "returned",
          "approved",
          "reopened"
        ]
      },
      "HandoffOrganisation": {
        "type": "object",
        "description": "An organisation a task or a defect is put on.",
        "required": [
          "account_id",
          "name"
        ],
        "properties": {
          "account_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          }
        }
      },
      "HandoverRequest": {
        "type": [
          "object",
          "null"
        ],
        "description": "`HandoverRequest` as an object.",
        "required": [
          "id",
          "project_id",
          "to_account_name",
          "named_admin_name",
          "named_admin_email",
          "requested_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "to_account_name": {
            "type": "string"
          },
          "named_admin_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "named_admin_email": {
            "type": "string"
          },
          "requested_at": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          },
          "entered_later": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "recorded_at": {
            "type": "string"
          }
        }
      },
      "IncomingHandoverRequest": {
        "type": "object",
        "description": "`IncomingHandoverRequest`: a pending request to the principal's organisation.",
        "required": [
          "id",
          "project_id",
          "summary",
          "requested_by_name",
          "requested_by_email",
          "requested_via",
          "requested_by_client_name",
          "requested_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "summary": {
            "type": "object",
            "description": "The project as it stood when the request was made.",
            "required": [
              "project_name",
              "project_created_at",
              "from_account_name",
              "to_account_name",
              "named_admin",
              "elements",
              "inspections",
              "findings",
              "members"
            ],
            "properties": {
              "project_name": {
                "type": "string"
              },
              "project_created_at": {
                "type": "string"
              },
              "from_account_name": {
                "type": "string"
              },
              "to_account_name": {
                "type": "string"
              },
              "named_admin": {
                "type": "object",
                "description": "The admin a request names.",
                "required": [
                  "name",
                  "email"
                ],
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "type": "string"
                  }
                }
              },
              "elements": {
                "type": "number",
                "format": "double"
              },
              "inspections": {
                "type": "number",
                "format": "double"
              },
              "findings": {
                "type": "number",
                "format": "double"
              },
              "members": {
                "type": "number",
                "format": "double"
              }
            }
          },
          "requested_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "requested_by_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "requested_via": {
            "type": [
              "string",
              "null"
            ],
            "description": "`integration` or `app` when the request was made through one; null for a person in the app"
          },
          "requested_by_client_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The app's registered name when `requested_via` is `app`"
          },
          "requested_at": {
            "type": "string"
          },
          "expires_at": {
            "type": "string"
          },
          "entered_later": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "recorded_at": {
            "type": "string"
          }
        }
      },
      "IncomingHandoverRequestList": {
        "type": "object",
        "description": "The answer of `listIncomingHandovers`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncomingHandoverRequest"
            }
          }
        }
      },
      "Inspection": {
        "type": "object",
        "description": "A live inspection.",
        "required": [
          "id",
          "project_id",
          "global_id",
          "plan_id",
          "template_id",
          "status",
          "current_step",
          "topic_guid",
          "number",
          "steps",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The inspection."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "global_id": {
            "type": "string",
            "description": "The element's IFC GlobalId."
          },
          "plan_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The plan it belongs to."
          },
          "template_id": {
            "type": "string",
            "format": "uuid",
            "description": "Its template."
          },
          "status": {
            "type": "string",
            "description": "Its status."
          },
          "current_step": {
            "type": "integer",
            "format": "int32",
            "description": "The step under way."
          },
          "topic_guid": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Its topic."
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The inspection number, INSP-00001 onwards per project; null until the inspection is opened"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionStep"
            },
            "description": "Its steps in the template's order."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "InspectionCheck": {
        "type": "object",
        "description": "A check of an inspection step.",
        "required": [
          "id",
          "item_id",
          "status",
          "previously_failed",
          "inspected_by",
          "inspected_by_name",
          "created_via",
          "via_client_id",
          "inspected_at",
          "occurred_at",
          "entered_later",
          "note",
          "fail_reason"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The check result."
          },
          "item_id": {
            "type": "string",
            "format": "uuid",
            "description": "The check-list item it answers."
          },
          "status": {
            "type": "string",
            "description": "Its status."
          },
          "previously_failed": {
            "type": "boolean",
            "description": "True when it failed before."
          },
          "inspected_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who recorded it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "inspected_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "created_via": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/InspectionCreatedVia",
                "description": "integration or app when it was recorded through this API; shown as Integraatio · {name}"
              },
              {
                "type": "null"
              }
            ]
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The integration's id or the app's client id when created_via is integration or app"
          },
          "inspected_at": {
            "type": "string",
            "description": "When it was recorded."
          },
          "occurred_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it happened."
          },
          "entered_later": {
            "type": "boolean",
            "description": "True when recorded after the fact."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its note."
          },
          "fail_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed."
          }
        }
      },
      "InspectionCreatedVia": {
        "type": "string",
        "description": "How a step or a check was recorded.",
        "enum": [
          "agent",
          "integration",
          "app"
        ]
      },
      "InspectionItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Inspection",
            "description": "A live inspection."
          },
          {
            "$ref": "#/components/schemas/DeletedInspection",
            "description": "A deleted inspection."
          }
        ],
        "description": "An item of `GET /v1/inspections`."
      },
      "InspectionPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "InspectionPlanAssignee": {
        "type": "object",
        "description": "An assignee of a plan.",
        "required": [
          "user_id",
          "name",
          "sort_order"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "description": "The user.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name."
          },
          "sort_order": {
            "type": "integer",
            "format": "int32",
            "description": "The first assignee gets the findings of failed steps"
          }
        }
      },
      "InspectionPlanCoverage": {
        "type": "object",
        "description": "`PlanCoverage`: the plan's elements per coverage state.",
        "required": [
          "in_scope",
          "not_scanned",
          "in_progress",
          "done",
          "failed"
        ],
        "properties": {
          "in_scope": {
            "type": "integer",
            "format": "int32",
            "description": "Live elements in scope."
          },
          "not_scanned": {
            "type": "integer",
            "format": "int32",
            "description": "No workflow, or one nobody has started."
          },
          "in_progress": {
            "type": "integer",
            "format": "int32",
            "description": "Started, not finished."
          },
          "done": {
            "type": "integer",
            "format": "int32",
            "description": "Completed."
          },
          "failed": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in the `failed` coverage state."
          }
        }
      },
      "InspectionPlanDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/InspectionPlanItem"
          },
          {
            "type": "object",
            "required": [
              "coverage",
              "assigned_count",
              "excluded_count"
            ],
            "properties": {
              "coverage": {
                "$ref": "#/components/schemas/PlanCoverage"
              },
              "assigned_count": {
                "type": "integer"
              },
              "excluded_count": {
                "type": "integer"
              },
              "removed_count": {
                "type": "integer",
                "description": "Hand-picked elements no longer in the model"
              },
              "precreation": {
                "type": "object",
                "description": "For the admin role: what precreateInspections and removePrecreatedInspections would touch",
                "required": [
                  "with_workflow",
                  "removable",
                  "kept",
                  "labelled",
                  "per_call"
                ],
                "properties": {
                  "with_workflow": {
                    "type": "integer"
                  },
                  "removable": {
                    "type": "integer"
                  },
                  "kept": {
                    "type": "integer"
                  },
                  "labelled": {
                    "type": "integer"
                  },
                  "per_call": {
                    "type": "integer",
                    "description": "The most inspections one precreateInspections call opens: 1 000, fewer for a template of more than 5 steps"
                  }
                }
              }
            }
          }
        ]
      },
      "InspectionPlanElementItem": {
        "type": "object",
        "description": "A live plan element.",
        "required": [
          "element_key",
          "project_id",
          "plan_id",
          "global_id",
          "kind",
          "added_by",
          "added_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "element_key": {
            "type": "string",
            "description": "`{plan_id}:{global_id}`"
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "plan_id": {
            "type": "string",
            "format": "uuid",
            "description": "The plan."
          },
          "global_id": {
            "type": "string",
            "description": "The element's IFC GlobalId."
          },
          "kind": {
            "$ref": "#/components/schemas/InspectionPlanElementKind",
            "description": "`added`: in the plan outside its filter; `excluded`: left out although the filter matches"
          },
          "added_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who added it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "added_at": {
            "type": "string",
            "description": "When it was added."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "InspectionPlanElementKind": {
        "type": "string",
        "description": "How an element is in a plan.",
        "enum": [
          "added",
          "excluded"
        ]
      },
      "InspectionPlanElementListItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/InspectionPlanElementItem",
            "description": "A live row."
          },
          {
            "$ref": "#/components/schemas/DeletedInspectionPlanElement",
            "description": "A deleted row."
          }
        ]
      },
      "InspectionPlanElementPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionPlanElementListItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "InspectionPlanElementStates": {
        "type": "object",
        "description": "`InspectionPlanElementStates`: one page of the scope's GlobalIds per coverage state.",
        "required": [
          "not_scanned",
          "in_progress",
          "done",
          "failed",
          "next_after"
        ],
        "properties": {
          "not_scanned": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "No workflow, or one nobody has started."
          },
          "in_progress": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Started, not finished."
          },
          "done": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Completed."
          },
          "failed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Global ids in the `failed` coverage state."
          },
          "next_after": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `after` of the next page; null on the last page."
          }
        }
      },
      "InspectionPlanElementsRemoval": {
        "type": "object",
        "description": "The answer of the two element removals.",
        "required": [
          "removed"
        ],
        "properties": {
          "removed": {
            "type": "integer",
            "format": "int64",
            "description": "Member rows deleted."
          }
        }
      },
      "InspectionPlanItem": {
        "type": "object",
        "description": "A live inspection plan.",
        "required": [
          "id",
          "project_id",
          "template_id",
          "name",
          "description",
          "scope",
          "start_date",
          "due_date",
          "status",
          "created_by",
          "created_at",
          "modified_date",
          "assignees",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The plan."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "template_id": {
            "type": "string",
            "format": "uuid",
            "description": "Its template."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "scope": {
            "$ref": "#/components/schemas/PlanScope",
            "description": "Keys AND together, values within a key OR; `{}` is the whole project. New keys may come."
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD"
          },
          "status": {
            "$ref": "#/components/schemas/InspectionPlanStatus",
            "description": "draft, active, completed or archived; new statuses may come"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who created it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "created_at": {
            "type": "string",
            "description": "When it was created."
          },
          "modified_date": {
            "type": "string",
            "description": "When it was changed last."
          },
          "assignees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionPlanAssignee"
            },
            "description": "Its assignees."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "InspectionPlanLabelsResult": {
        "type": "object",
        "description": "The answer of `POST /api/inspection-plans/{planId}/labels`.",
        "required": [
          "labels_created",
          "in_scope",
          "labelled",
          "remaining"
        ],
        "properties": {
          "labels_created": {
            "type": "integer",
            "format": "int32",
            "description": "Labels this call minted, at most 500."
          },
          "in_scope": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in scope."
          },
          "labelled": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in scope with a label."
          },
          "remaining": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in scope still without a label; call again until 0."
          }
        }
      },
      "InspectionPlanListItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/InspectionPlanItem",
            "description": "A live row."
          },
          {
            "$ref": "#/components/schemas/DeletedInspectionPlan",
            "description": "A deleted row."
          }
        ]
      },
      "InspectionPlanPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionPlanListItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "InspectionPlanPrecreateResult": {
        "type": "object",
        "description": "The answer of `POST /api/inspection-plans/{planId}/precreate`.",
        "required": [
          "created",
          "already_present",
          "in_scope",
          "remaining"
        ],
        "properties": {
          "created": {
            "type": "integer",
            "format": "int32",
            "description": "Workflows this call inserted, at most `PRECREATE_CHUNK`."
          },
          "already_present": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in scope that ended the call with a workflow under the plan this call did not insert."
          },
          "in_scope": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in scope."
          },
          "remaining": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in scope still without a workflow under the plan; 0 when the plan is fully pre-created."
          }
        }
      },
      "InspectionPlanPrecreatedRemoval": {
        "type": "object",
        "description": "The answer of `DELETE /api/inspection-plans/{planId}/precreated`.",
        "required": [
          "removed",
          "kept",
          "remaining"
        ],
        "properties": {
          "removed": {
            "type": "integer",
            "format": "int32",
            "description": "Workflows removed."
          },
          "kept": {
            "type": "integer",
            "format": "int32",
            "description": "Workflows left under the plan, each carrying a verdict, check result, comment or viewpoint."
          },
          "remaining": {
            "type": "integer",
            "format": "int32",
            "description": "Workflows nobody has touched that are still under the plan; call again until 0."
          }
        }
      },
      "InspectionPlanPrecreation": {
        "type": "object",
        "description": "What the two pre-creation actions would touch.",
        "required": [
          "with_workflow",
          "removable",
          "kept",
          "labelled",
          "per_call"
        ],
        "properties": {
          "with_workflow": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in scope carrying a workflow under the plan."
          },
          "removable": {
            "type": "integer",
            "format": "int32",
            "description": "Workflows under the plan that removePrecreatedInspections would remove."
          },
          "kept": {
            "type": "integer",
            "format": "int32",
            "description": "Workflows it would keep, because they carry evidence."
          },
          "labelled": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in scope carrying a QR label."
          },
          "per_call": {
            "type": "integer",
            "format": "int64",
            "description": "The most inspections one precreateInspections call opens: 1 000, fewer for a template of more than 5 steps."
          }
        }
      },
      "InspectionPlanPreview": {
        "type": "object",
        "description": "`InspectionPlanPreview`: a scope resolved without saving it.",
        "required": [
          "in_scope",
          "sample",
          "by_type",
          "by_storey"
        ],
        "properties": {
          "in_scope": {
            "type": "integer",
            "format": "int32",
            "description": "Live elements in scope."
          },
          "sample": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionPlanPreviewSample"
            },
            "description": "At most 20 of them."
          },
          "by_type": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionPlanPreviewType"
            },
            "description": "At most 200 classes."
          },
          "by_storey": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionPlanPreviewStorey"
            },
            "description": "At most 200 storeys."
          },
          "added": {
            "type": "integer",
            "format": "int32",
            "description": "With `plan_id`: the plan's added elements."
          },
          "excluded": {
            "type": "integer",
            "format": "int32",
            "description": "With `plan_id`: elements the edited filter matches that the plan leaves out."
          }
        }
      },
      "InspectionPlanPreviewSample": {
        "type": "object",
        "description": "One element of a preview's sample.",
        "required": [
          "global_id",
          "name",
          "ifc_type",
          "storey_name"
        ],
        "properties": {
          "global_id": {
            "type": "string",
            "description": "The element."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its name, cut at 120 characters."
          },
          "ifc_type": {
            "type": "string",
            "description": "Its IFC class."
          },
          "storey_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its storey, cut at 120 characters."
          }
        }
      },
      "InspectionPlanPreviewStorey": {
        "type": "object",
        "description": "The elements in scope on one storey.",
        "required": [
          "storey_name",
          "count"
        ],
        "properties": {
          "storey_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The storey; null for elements without one."
          },
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Elements."
          }
        }
      },
      "InspectionPlanPreviewType": {
        "type": "object",
        "description": "The elements in scope of one IFC class.",
        "required": [
          "ifc_type",
          "count"
        ],
        "properties": {
          "ifc_type": {
            "type": "string",
            "description": "The IFC class."
          },
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Elements."
          }
        }
      },
      "InspectionPlanStatus": {
        "type": "string",
        "description": "Where an inspection plan stands.",
        "enum": [
          "draft",
          "active",
          "completed",
          "archived"
        ]
      },
      "InspectionStep": {
        "type": "object",
        "description": "A step of an inspection.",
        "required": [
          "id",
          "step_id",
          "status",
          "inspected_by",
          "inspected_by_name",
          "created_via",
          "via_client_id",
          "inspected_at",
          "occurred_at",
          "entered_later",
          "notes",
          "fail_reason",
          "first_failed_at",
          "check_list_version_id",
          "checks"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The step result."
          },
          "step_id": {
            "type": "string",
            "format": "uuid",
            "description": "The template step."
          },
          "status": {
            "type": "string",
            "description": "Its status."
          },
          "inspected_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who recorded it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "inspected_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "created_via": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/InspectionCreatedVia",
                "description": "integration or app when it was recorded through this API; shown as Integraatio · {name}"
              },
              {
                "type": "null"
              }
            ]
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The integration's id or the app's client id when created_via is integration or app"
          },
          "inspected_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was recorded."
          },
          "occurred_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it happened."
          },
          "entered_later": {
            "type": "boolean",
            "description": "True when recorded after the fact."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its notes."
          },
          "fail_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed."
          },
          "first_failed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its first failing verdict."
          },
          "check_list_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The check-list version the step is pinned to; its items are the checks recordCheck takes"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectionCheck"
            },
            "description": "Its checks."
          }
        }
      },
      "IntegrationCall": {
        "type": "object",
        "description": "One entry of *Kutsuloki*: an API call of the integration.",
        "required": [
          "id",
          "at",
          "method",
          "route",
          "scope",
          "status",
          "rows",
          "bytes",
          "window_from",
          "window_to",
          "request_id",
          "source_ip",
          "path_params"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The call."
          },
          "at": {
            "type": "string",
            "description": "When it came."
          },
          "method": {
            "type": "string",
            "description": "Its method."
          },
          "route": {
            "type": [
              "string",
              "null"
            ],
            "description": "The operation's path template."
          },
          "scope": {
            "type": [
              "string",
              "null"
            ],
            "description": "The scope the operation needs."
          },
          "status": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The answer's status."
          },
          "rows": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Rows answered."
          },
          "bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Bytes answered."
          },
          "window_from": {
            "type": [
              "string",
              "null"
            ],
            "description": "The window's start, for a list."
          },
          "window_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "The window's end, for a list."
          },
          "request_id": {
            "type": "string",
            "description": "The call's `X-Request-Id`."
          },
          "source_ip": {
            "type": [
              "string",
              "null"
            ],
            "description": "The caller's address."
          },
          "path_params": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "IntegrationCallList": {
        "type": "object",
        "description": "`{ data }` of *Kutsuloki*.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationCall"
            },
            "description": "Newest first."
          }
        }
      },
      "IntegrationChange": {
        "type": "object",
        "description": "One entry of *Muutokset*: who changed an integration, and how.",
        "required": [
          "id",
          "at",
          "actor_user_id",
          "actor_name",
          "actor_via",
          "actor_via_client_id",
          "actor_client_name",
          "action"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The change."
          },
          "at": {
            "type": "string",
            "description": "When it was made."
          },
          "actor_user_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who made it; `null` once that person is deleted.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "actor_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "That person's or integration's name."
          },
          "actor_via": {
            "type": "string",
            "description": "`web`, `integration` or `app`; new values may come"
          },
          "actor_via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The integration or app that made the change through the API"
          },
          "actor_client_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "For `app`: the app's registered name. Show the actor as `{actor_name} · via {actor_client_name}`"
          },
          "action": {
            "type": "string",
            "description": "What changed."
          },
          "before": {
            "description": "The values before."
          },
          "after": {
            "description": "The values after."
          }
        }
      },
      "IntegrationChangeList": {
        "type": "object",
        "description": "`{ data }` of *Muutokset*.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationChange"
            },
            "description": "Newest first."
          }
        }
      },
      "IntegrationChanges": {
        "type": "object",
        "description": "The body of `updateIntegration`.",
        "properties": {
          "name": {
            "type": "string",
            "description": "1 to 100 characters after the trim.",
            "maxLength": 100,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "At most 500 characters after the trim; `null` clears it.",
            "maxLength": 500
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "projects:read",
                "projects:write",
                "members:write",
                "organisation:admin",
                "models:read",
                "models:write",
                "models:delete",
                "elements:read",
                "elements:write",
                "elements:delete",
                "element-events:write",
                "schedule:read",
                "schedule:write",
                "inspections:read",
                "inspections:write",
                "inspections:delete",
                "inspections:attest",
                "findings:read",
                "findings:write",
                "findings:delete",
                "finding-drafts:write",
                "maintenance:read",
                "maintenance:write",
                "exports:read"
              ]
            },
            "description": "The whole list",
            "maxItems": 25
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The organisation's projects it is on afterwards.",
            "maxItems": 1000
          },
          "all_projects": {
            "type": "boolean",
            "description": "Every project of the organisation, new ones included."
          }
        },
        "additionalProperties": false
      },
      "IntegrationDetails": {
        "type": "object",
        "description": "An integration as the admin pages and `/v1` show it.",
        "required": [
          "client_id",
          "name",
          "description",
          "scopes",
          "all_projects",
          "project_role",
          "status",
          "created_by",
          "created_at",
          "last_used_at",
          "disabled_at",
          "revoked_at",
          "calls_24h",
          "project_ids",
          "other_projects",
          "keys"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "format": "uuid",
            "description": "The integration's id, its OAuth `client_id`."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What it is for."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Its scopes."
          },
          "all_projects": {
            "type": "boolean",
            "description": "Whether it is on every project of the organisation, new ones included."
          },
          "project_role": {
            "$ref": "#/components/schemas/IntegrationProjectRole",
            "description": "The project role its scopes give it."
          },
          "status": {
            "$ref": "#/components/schemas/IntegrationStatus",
            "description": "`active`, `disabled` or `revoked`."
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who created it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "created_at": {
            "type": "string",
            "description": "When it was created."
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When its token was last used."
          },
          "disabled_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was disabled."
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was revoked."
          },
          "calls_24h": {
            "type": "integer",
            "format": "int32",
            "description": "Its calls in the last 24 hours."
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The organisation's own projects it is on."
          },
          "other_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OtherProject"
            },
            "description": "Projects of other organisations whose project admins added it."
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationKey"
            },
            "description": "Its keys, oldest first."
          }
        }
      },
      "IntegrationKey": {
        "type": "object",
        "description": "An integration's public key.",
        "required": [
          "kid",
          "alg",
          "thumbprint",
          "public_jwk",
          "created_at",
          "expires_at",
          "revoked_at"
        ],
        "properties": {
          "kid": {
            "type": "string",
            "description": "The key's id: its RFC 7638 thumbprint."
          },
          "alg": {
            "$ref": "#/components/schemas/IntegrationKeyAlg",
            "description": "`ES256` or `RS256`."
          },
          "thumbprint": {
            "type": "string",
            "description": "The RFC 7638 thumbprint."
          },
          "public_jwk": {
            "type": "object",
            "additionalProperties": {}
          },
          "created_at": {
            "type": "string",
            "description": "When it was registered."
          },
          "expires_at": {
            "type": "string",
            "description": "When it expires: a year after it was registered."
          },
          "revoked_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was revoked."
          }
        }
      },
      "IntegrationKeyAlg": {
        "type": "string",
        "description": "A key's signature algorithm.",
        "enum": [
          "ES256",
          "RS256"
        ]
      },
      "IntegrationList": {
        "type": "object",
        "description": "`{ data }` of the integration list.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationDetails"
            },
            "description": "Oldest first."
          }
        }
      },
      "IntegrationOnProject": {
        "type": "object",
        "description": "An integration on the project.",
        "required": [
          "client_id",
          "name",
          "status",
          "project_role",
          "account_name",
          "other_organisation"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "An integration's state.",
            "enum": [
              "active",
              "disabled",
              "revoked"
            ]
          },
          "project_role": {
            "type": "string",
            "description": "A role a member route gives.",
            "enum": [
              "viewer",
              "inspector",
              "admin"
            ]
          },
          "account_name": {
            "type": "string"
          },
          "other_organisation": {
            "type": "boolean"
          }
        }
      },
      "IntegrationOnProjectList": {
        "type": "object",
        "description": "The answer of `listProjectIntegrations`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationOnProject"
            }
          }
        }
      },
      "IntegrationProjectRole": {
        "type": "string",
        "description": "The project role an integration's scopes give it.",
        "enum": [
          "viewer",
          "inspector",
          "admin"
        ]
      },
      "IntegrationStatus": {
        "type": "string",
        "description": "An integration's status.",
        "enum": [
          "active",
          "disabled",
          "revoked"
        ]
      },
      "Label": {
        "type": "object",
        "description": "A live label.",
        "required": [
          "id",
          "project_id",
          "giai",
          "code",
          "digital_link",
          "element_global_id",
          "status",
          "assigned_at",
          "first_scanned_at",
          "created_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The label."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "giai": {
            "type": "string",
            "description": "The GS1 GIAI printed in the QR code"
          },
          "code": {
            "type": "string",
            "description": "The short code printed under the QR code"
          },
          "digital_link": {
            "type": "string",
            "description": "The GS1 Digital Link the QR code holds"
          },
          "element_global_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The element the label is on; null while unassigned or retired"
          },
          "status": {
            "$ref": "#/components/schemas/LabelStatus",
            "description": "`assigned` and `active` are both in use; `active` once scanned. New statuses may come."
          },
          "assigned_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was put on its element."
          },
          "first_scanned_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its first scan."
          },
          "created_at": {
            "type": "string",
            "description": "When it was minted."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "LabelItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Label",
            "description": "A live label."
          },
          {
            "$ref": "#/components/schemas/DeletedLabel",
            "description": "A deleted label."
          }
        ],
        "description": "An item of `GET /v1/labels`."
      },
      "LabelPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabelItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "LabelStatus": {
        "type": "string",
        "description": "A label's state.",
        "enum": [
          "unassigned",
          "assigned",
          "active",
          "retired"
        ]
      },
      "Lifecycle": {
        "type": "object",
        "description": "`Lifecycle`: the phase and its history, newest first.",
        "required": [
          "phase",
          "history",
          "pending_handover",
          "last_handover",
          "can_request_handover"
        ],
        "properties": {
          "phase": {
            "type": "string",
            "description": "A project phase.",
            "enum": [
              "construction",
              "completed",
              "fm_active"
            ]
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One phase change.",
              "required": [
                "id",
                "from_phase",
                "to_phase",
                "occurred_at",
                "recorded_at",
                "entered_later",
                "actor",
                "actor_name",
                "created_via",
                "via_client_id",
                "via_client_name",
                "handover_request_id",
                "handover"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "from_phase": {
                  "type": "string",
                  "description": "A project phase.",
                  "enum": [
                    "construction",
                    "completed",
                    "fm_active"
                  ]
                },
                "to_phase": {
                  "type": "string",
                  "description": "A project phase.",
                  "enum": [
                    "construction",
                    "completed",
                    "fm_active"
                  ]
                },
                "occurred_at": {
                  "type": "string"
                },
                "recorded_at": {
                  "type": "string"
                },
                "entered_later": {
                  "type": "boolean"
                },
                "actor": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
                },
                "actor_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_via": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "`integration` when an integration made the change, `app` for an app acting for a person, `agent` for an AI assistant"
                },
                "via_client_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The integration or app that made the change"
                },
                "via_client_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "For `app`: the app's registered name. Show the actor as `{actor_name} · via {via_client_name}`"
                },
                "handover_request_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uuid"
                },
                "handover": {
                  "oneOf": [
                    {
                      "type": "object",
                      "description": "Who handed the project over to whom.",
                      "required": [
                        "from_account_name",
                        "to_account_name",
                        "requested_by_name",
                        "requested_via",
                        "requested_by_client_name",
                        "accepted_by_name",
                        "accepted_by_integration",
                        "accepted_via",
                        "accepted_by_client_name"
                      ],
                      "properties": {
                        "from_account_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "to_account_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "requested_by_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "requested_via": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "`integration` or `app` when the request came through the API"
                        },
                        "requested_by_client_name": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "For `app`: the app's registered name"
                        },
                        "accepted_by_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "accepted_by_integration": {
                          "type": "boolean",
                          "description": "The acceptor is an integration"
                        },
                        "accepted_via": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "`integration` or `app` when the acceptance came through the API"
                        },
                        "accepted_by_client_name": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "For `app`: the app's registered name"
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "pending_handover": {
            "$ref": "#/components/schemas/HandoverRequest"
          },
          "last_handover": {
            "oneOf": [
              {
                "type": "object",
                "description": "The project's latest request that ended without acceptance.",
                "required": [
                  "id",
                  "status",
                  "to_account_name",
                  "decided_by_name",
                  "decided_by_integration",
                  "decided_via",
                  "decided_by_client_name",
                  "ended_at"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "status": {
                    "type": "string",
                    "description": "A last handover status.",
                    "enum": [
                      "rejected",
                      "cancelled",
                      "expired"
                    ]
                  },
                  "to_account_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "decided_by_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "decided_by_integration": {
                    "type": "boolean"
                  },
                  "decided_via": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "`integration` or `app` when the decision came through the API"
                  },
                  "decided_by_client_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "For `app`: the app's registered name"
                  },
                  "ended_at": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "can_request_handover": {
            "type": "boolean"
          }
        }
      },
      "LockedStatus": {
        "type": "string",
        "description": "The status of a locked password.",
        "enum": [
          "password_change_required"
        ]
      },
      "MaintenanceCreatedVia": {
        "type": "string",
        "description": "How an entry was written.",
        "enum": [
          "agent",
          "integration",
          "app"
        ]
      },
      "MaintenanceEntryItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/MaintenanceLogEntry",
            "description": "A live entry."
          },
          {
            "$ref": "#/components/schemas/DeletedMaintenanceLogEntry",
            "description": "A deleted entry."
          }
        ],
        "description": "An item of `GET /v1/maintenance-entries`."
      },
      "MaintenanceEntryPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MaintenanceEntryItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "MaintenanceLogEntry": {
        "type": "object",
        "description": "A live maintenance entry.",
        "required": [
          "id",
          "project_id",
          "global_id",
          "log_type",
          "title",
          "description",
          "occurred_at",
          "recorded_at",
          "entered_later",
          "created_by",
          "created_by_name",
          "created_via",
          "via_client_id",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The entry."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "global_id": {
            "type": "string",
            "description": "The element's IFC GlobalId"
          },
          "log_type": {
            "$ref": "#/components/schemas/MaintenanceLogType",
            "description": "New types may come"
          },
          "title": {
            "type": "string",
            "description": "The title."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "The description."
          },
          "occurred_at": {
            "type": "string",
            "description": "When the work was done"
          },
          "recorded_at": {
            "type": "string",
            "description": "When the entry was written"
          },
          "entered_later": {
            "type": "boolean",
            "description": "true when occurred_at is earlier than the time it was written"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "The user, integration or person who wrote it; null once that user is deleted",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "created_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "created_via": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MaintenanceCreatedVia",
                "description": "null: in the app; agent: an AI assistant; integration or app: through this API"
              },
              {
                "type": "null"
              }
            ]
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The integration's or app's client id when written through this API"
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "MaintenanceLogEntryChanges": {
        "type": "object",
        "description": "The body of `updateMaintenanceEntry`: at least one field.",
        "properties": {
          "log_type": {
            "$ref": "#/components/schemas/MaintenanceLogType",
            "description": "The kind."
          },
          "title": {
            "type": "string",
            "description": "The title, trimmed.",
            "maxLength": 200,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "The description; `null` clears it.",
            "maxLength": 4000
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the work was done."
          }
        },
        "additionalProperties": false
      },
      "MaintenanceLogType": {
        "type": "string",
        "description": "The kind of a maintenance entry.",
        "enum": [
          "routine_check",
          "repair",
          "replacement",
          "incident",
          "certification"
        ]
      },
      "Member": {
        "type": "object",
        "description": "A live member.",
        "required": [
          "project_id",
          "user_id",
          "name",
          "email",
          "project_role",
          "account_id",
          "account_name",
          "external",
          "invited_by",
          "added_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "user_id": {
            "type": "string",
            "description": "The person.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their e-mail, read when answering."
          },
          "project_role": {
            "$ref": "#/components/schemas/MemberProjectRole",
            "description": "Their role on the project."
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Their organisation."
          },
          "account_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when the member's organisation is not readable to the principal"
          },
          "external": {
            "type": "boolean",
            "description": "The member belongs to another organisation than the project's owner"
          },
          "invited_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who added them.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "added_at": {
            "type": "string",
            "description": "When they were added."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "MemberItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Member",
            "description": "A live member."
          },
          {
            "$ref": "#/components/schemas/DeletedMember",
            "description": "A removed member."
          }
        ],
        "description": "An item of `GET /v1/members`."
      },
      "MemberPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "MemberProjectRole": {
        "type": "string",
        "description": "A member's role on the project.",
        "enum": [
          "owner",
          "admin",
          "inspector",
          "viewer"
        ]
      },
      "MemberRoleBody": {
        "type": "object",
        "description": "The body of `updateMemberRole`.",
        "required": [
          "project_role"
        ],
        "properties": {
          "project_role": {
            "type": "string",
            "description": "A role a member route gives.",
            "enum": [
              "viewer",
              "inspector",
              "admin"
            ]
          }
        },
        "additionalProperties": false
      },
      "ModelFileDiff": {
        "type": "object",
        "description": "Elements compared with the previous version: kept, added, removed, and the removed ones with labels, inspections or other data. New counts may come.",
        "properties": {
          "kept": {
            "type": "integer",
            "format": "int64",
            "description": "Kept."
          },
          "added": {
            "type": "integer",
            "format": "int64",
            "description": "Added."
          },
          "removed": {
            "type": "integer",
            "format": "int64",
            "description": "Removed."
          },
          "removed_with_labels": {
            "type": "integer",
            "format": "int64",
            "description": "Removed with labels."
          },
          "removed_with_inspections": {
            "type": "integer",
            "format": "int64",
            "description": "Removed with inspections."
          },
          "removed_with_data": {
            "type": "integer",
            "format": "int64",
            "description": "Removed with other data."
          },
          "skipped_other_model": {
            "type": "integer",
            "format": "int64",
            "description": "Left out as another model's."
          }
        }
      },
      "ModelFileVersion": {
        "type": "object",
        "description": "A live model version.",
        "required": [
          "id",
          "project_id",
          "model_id",
          "filename",
          "status",
          "version",
          "element_count",
          "error",
          "diff",
          "ifc_schema",
          "ifc_file_description",
          "ifc_model_kind",
          "created_at",
          "completed_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The version's id; the upload that made it"
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "model_id": {
            "type": "string",
            "format": "uuid",
            "description": "Every version of one model shares it; the first upload's id"
          },
          "filename": {
            "type": "string",
            "description": "The file's name."
          },
          "status": {
            "$ref": "#/components/schemas/ModelVersionStatus",
            "description": "`pending` until ingestModelVersion, `processing`, then `complete` or `failed`. New statuses may come."
          },
          "version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The version number once complete; the highest complete version is the current model"
          },
          "element_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Elements in the file."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the ingest failed."
          },
          "diff": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ModelFileDiff",
                "description": "Elements compared with the previous version: kept, added, removed, and the removed ones with labels, inspections or other data. New counts may come."
              },
              {
                "type": "null"
              }
            ]
          },
          "ifc_schema": {
            "type": [
              "string",
              "null"
            ],
            "description": "The IFC schema."
          },
          "ifc_file_description": {
            "type": [
              "string",
              "null"
            ],
            "description": "The IFC file description."
          },
          "ifc_model_kind": {
            "type": [
              "string",
              "null"
            ],
            "description": "The kind of model."
          },
          "created_at": {
            "type": "string",
            "description": "When it was uploaded."
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When its ingest finished."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "ModelRemovedElement": {
        "type": "object",
        "description": "A removed element with what is linked to it.",
        "required": [
          "global_id",
          "name",
          "ifc_type",
          "storey_name",
          "archived_at",
          "resolved_at",
          "removed_in_version",
          "label",
          "inspections",
          "inspections_total",
          "plans",
          "plans_total",
          "observations",
          "marked_after_removal"
        ],
        "properties": {
          "global_id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "ifc_type": {
            "type": "string"
          },
          "storey_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived_at": {
            "type": "string"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "removed_in_version": {
            "type": "integer",
            "format": "int64"
          },
          "label": {
            "oneOf": [
              {
                "type": "object",
                "description": "The label of a removed element.",
                "required": [
                  "id",
                  "giai"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The `qr_codes` row."
                  },
                  "giai": {
                    "type": "string",
                    "description": "Its GIAI."
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "inspections": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One inspection of a removed element.",
              "required": [
                "id",
                "template_name",
                "plan_name",
                "status",
                "steps_done",
                "steps_total"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The workflow."
                },
                "template_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Its template's name."
                },
                "plan_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Its plan's name."
                },
                "status": {
                  "type": "string",
                  "description": "The workflow status."
                },
                "steps_done": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Steps marked `ok` or `na`."
                },
                "steps_total": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Every step."
                }
              }
            }
          },
          "inspections_total": {
            "type": "integer",
            "format": "int64"
          },
          "plans": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One plan that names a removed element.",
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The plan."
                },
                "name": {
                  "type": "string",
                  "description": "Its name."
                }
              }
            }
          },
          "plans_total": {
            "type": "integer",
            "format": "int64"
          },
          "observations": {
            "type": "integer",
            "format": "int64"
          },
          "element_events": {
            "type": "integer",
            "format": "int64"
          },
          "marked_after_removal": {
            "type": "boolean"
          },
          "proposal": {
            "oneOf": [
              {
                "type": "object",
                "description": "The proposed target of one removed element.",
                "required": [
                  "global_id",
                  "name",
                  "type_name",
                  "storey_name",
                  "tier"
                ],
                "properties": {
                  "global_id": {
                    "type": "string",
                    "description": "The live element proposed."
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Its name, cut to 200 characters."
                  },
                  "type_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Its type name, cut to 200 characters."
                  },
                  "storey_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Its storey, cut to 200 characters."
                  },
                  "tier": {
                    "$ref": "#/components/schemas/ProposalTier",
                    "description": "The tier."
                  },
                  "conflict": {
                    "$ref": "#/components/schemas/ProposalConflict",
                    "description": "Set when the tier is `ristiriita`."
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Only where the organisation has carry-over: the live element proposed to take the data"
          },
          "carried_to": {
            "oneOf": [
              {
                "type": "object",
                "description": "`CarriedTo`: the live element a removed one's data was carried to.",
                "required": [
                  "global_id",
                  "name",
                  "at",
                  "by",
                  "remap_id",
                  "batch_id",
                  "batch_size"
                ],
                "properties": {
                  "global_id": {
                    "type": "string",
                    "description": "The live element."
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Its name, at most 200 characters."
                  },
                  "at": {
                    "type": "string",
                    "description": "When the carry-over was applied, as PostgreSQL text."
                  },
                  "by": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Who applied it."
                  },
                  "remap_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The `asset_remaps` row."
                  },
                  "batch_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The batch it was applied in."
                  },
                  "batch_size": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Active carry-overs of that batch."
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Only where the organisation has carry-over: where the data went; `remap_id` is the carry-over's id"
          },
          "carry_history": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "`CarryHistoryEntry`: one carry-over of a removed element.",
              "required": [
                "remap_id",
                "global_id",
                "name",
                "applied_at",
                "applied_by",
                "undone_at",
                "undone_by",
                "stayed"
              ],
              "properties": {
                "remap_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The `asset_remaps` row."
                },
                "global_id": {
                  "type": "string",
                  "description": "The element the data went to."
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Its name, at most 200 characters."
                },
                "applied_at": {
                  "type": "string",
                  "description": "As PostgreSQL text."
                },
                "applied_by": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Who applied it."
                },
                "undone_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "As PostgreSQL text; null while active."
                },
                "undone_by": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Who undid it."
                },
                "stayed": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int64",
                  "description": "On an undone carry-over: work recorded on the new element after it, which stayed there."
                }
              }
            }
          }
        }
      },
      "ModelRemovedElementPage": {
        "type": "object",
        "description": "One page of a model's removed elements.",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelRemovedElement"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "batch_max": {
            "type": "integer",
            "format": "int64",
            "description": "Only where the organisation has carry-over: the most pairs one carryOverElements call takes"
          }
        }
      },
      "ModelRemovedSummary": {
        "type": "object",
        "description": "One model's removed elements.",
        "required": [
          "model_id",
          "open",
          "resolved",
          "removed"
        ],
        "properties": {
          "model_id": {
            "type": "string"
          },
          "open": {
            "type": "integer",
            "format": "int64",
            "description": "Removed elements that carry data and are not resolved"
          },
          "resolved": {
            "type": "integer",
            "format": "int64"
          },
          "removed": {
            "type": "integer",
            "format": "int64"
          },
          "proposals": {
            "$ref": "#/components/schemas/ProposalCounts",
            "description": "Only where the organisation has carry-over"
          }
        }
      },
      "ModelUpload": {
        "type": "object",
        "description": "`ModelUpload`: the version and where to upload its file.",
        "required": [
          "model_version",
          "upload_url",
          "method",
          "headers",
          "expires_in"
        ],
        "properties": {
          "model_version": {
            "$ref": "#/components/schemas/ModelFileVersion"
          },
          "upload_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "null on a repeat once the version has left `pending`: its file is in place"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "headers": {
            "type": "object",
            "description": "Send exactly these headers with the PUT",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "expires_in": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds the upload URL stays valid",
            "minimum": 0
          }
        }
      },
      "ModelVersionImpact": {
        "type": "object",
        "description": "`ModelVersionImpact`: what deleting a model version would take.",
        "required": [
          "versions",
          "elements",
          "labels",
          "inspections",
          "delete_refused"
        ],
        "properties": {
          "versions": {
            "type": "integer",
            "format": "int32"
          },
          "elements": {
            "type": "integer",
            "format": "int32"
          },
          "labels": {
            "type": "integer",
            "format": "int32"
          },
          "inspections": {
            "type": "integer",
            "format": "int32"
          },
          "delete_refused": {
            "type": "boolean",
            "description": "true when deleting this unfinished attempt would take elements that carry data; deleteModelVersion then answers 409"
          }
        }
      },
      "ModelVersionItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ModelFileVersion",
            "description": "A live version."
          },
          {
            "$ref": "#/components/schemas/DeletedModelVersion",
            "description": "A deleted version."
          }
        ],
        "description": "An item of `GET /v1/model-versions`."
      },
      "ModelVersionPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelVersionItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ModelVersionStatus": {
        "type": "string",
        "description": "A model version's ingest state.",
        "enum": [
          "pending",
          "processing",
          "complete",
          "failed"
        ]
      },
      "NewCheckList": {
        "type": "object",
        "description": "The body of `createOrganisationCheckList`.",
        "required": [
          "name",
          "items"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NewCheckListItem"
            },
            "maxItems": 100,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "NewCheckListItem": {
        "type": "object",
        "description": "An item of `NewCheckList`.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "required": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "NewExportJob": {
        "type": "object",
        "description": "The body of `createExportJob`.",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "`csv_topics`, `csv_assets`, `csv_inspections`: the app's CSV exports. `as_built_csv`: one row per element with its as-built dates. `report_md`: the inspection report in Markdown. `report_pdf`: the PDF report with each failed step's first photo (the organisation's PDF report). `handover`: the handover package, a ZIP of the BCF file, the CSV files, the report and the finding photos with manifest.json. Each kind needs the project role the app's export of it needs: admin for the CSV exports, as_built_csv and handover; inspector for report_pdf, and for report_md where the organisation has the PDF report, admin otherwise.",
            "enum": [
              "csv_topics",
              "csv_assets",
              "csv_inspections",
              "as_built_csv",
              "report_md",
              "report_pdf",
              "handover"
            ]
          },
          "params": {
            "type": "object",
            "default": {},
            "properties": {
              "language": {
                "type": "string",
                "description": "The report's language; default the organisation's",
                "enum": [
                  "fi",
                  "en"
                ]
              },
              "stages": {
                "$ref": "#/components/schemas/ExportStages"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "NewFailReasonList": {
        "type": "object",
        "description": "The body of `createOrganisationFailReasonList`.",
        "required": [
          "name",
          "reasons"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 120,
              "minLength": 1
            },
            "maxItems": 30,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "NewHandoverRequest": {
        "type": "object",
        "description": "The body of `requestHandover`.",
        "required": [
          "admin_email"
        ],
        "properties": {
          "admin_email": {
            "type": "string",
            "description": "An admin of the receiving organisation; a person, never an integration",
            "maxLength": 320,
            "minLength": 3
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "NewIntegration": {
        "type": "object",
        "description": "The body of `createIntegration`.",
        "required": [
          "name",
          "scopes"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "1 to 100 characters after the trim.",
            "maxLength": 100,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "At most 500 characters after the trim.",
            "maxLength": 500
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "projects:read",
                "projects:write",
                "members:write",
                "organisation:admin",
                "models:read",
                "models:write",
                "models:delete",
                "elements:read",
                "elements:write",
                "elements:delete",
                "element-events:write",
                "schedule:read",
                "schedule:write",
                "inspections:read",
                "inspections:write",
                "inspections:delete",
                "inspections:attest",
                "findings:read",
                "findings:write",
                "findings:delete",
                "finding-drafts:write",
                "maintenance:read",
                "maintenance:write",
                "exports:read"
              ]
            },
            "description": "Only scopes the calling integration holds itself",
            "maxItems": 25
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The organisation's projects it is on.",
            "maxItems": 1000
          },
          "all_projects": {
            "type": "boolean",
            "description": "Every project of the organisation, new ones included."
          }
        },
        "additionalProperties": false
      },
      "NewIntegrationKey": {
        "type": "object",
        "description": "The body of `addIntegrationKey`: `public_jwk` or `public_key_pem`.",
        "properties": {
          "public_jwk": {
            "type": "object",
            "additionalProperties": {}
          },
          "public_key_pem": {
            "type": "string",
            "description": "A PEM `SubjectPublicKeyInfo`.",
            "maxLength": 8192
          },
          "alg": {
            "$ref": "#/components/schemas/IntegrationKeyAlg",
            "description": "`ES256` or `RS256`."
          }
        },
        "additionalProperties": false
      },
      "NewMaintenanceLogEntry": {
        "type": "object",
        "description": "The body of `createMaintenanceEntry`.",
        "required": [
          "global_id",
          "log_type",
          "title"
        ],
        "properties": {
          "global_id": {
            "type": "string",
            "description": "The element's IFC GlobalId",
            "maxLength": 64,
            "minLength": 1
          },
          "log_type": {
            "$ref": "#/components/schemas/MaintenanceLogType",
            "description": "The kind."
          },
          "title": {
            "type": "string",
            "description": "The title, trimmed.",
            "maxLength": 200,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "The description.",
            "maxLength": 4000
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the work was done; default now. An earlier time is recorded as entered later."
          }
        },
        "additionalProperties": false
      },
      "NewOrganisationTemplate": {
        "type": "object",
        "description": "The body of `createOrganisationTemplate`.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "is_default": {
            "type": "boolean",
            "default": false
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NewOrganisationTemplateStep"
            },
            "default": [],
            "maxItems": 100
          }
        },
        "additionalProperties": false
      },
      "NewOrganisationTemplateStep": {
        "type": "object",
        "description": "A step of `NewOrganisationTemplate`.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "required": {
            "type": "boolean",
            "default": true
          },
          "sequential": {
            "type": "boolean",
            "default": true
          },
          "check_group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "NewPerson": {
        "type": "object",
        "description": "The body of `createUser`.",
        "required": [
          "email",
          "name"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "role": {
            "$ref": "#/components/schemas/PersonRole",
            "description": "`viewer` when absent.",
            "default": "viewer"
          }
        },
        "additionalProperties": false
      },
      "NewProjectBody": {
        "type": "object",
        "description": "The body of `createProject`.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": "string",
            "maxLength": 20000
          }
        },
        "additionalProperties": false
      },
      "NewProjectIntegration": {
        "type": "object",
        "description": "The body of `addProjectIntegration`.",
        "required": [
          "client_id",
          "project_role"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "format": "uuid"
          },
          "project_role": {
            "type": "string",
            "description": "A role another organisation's integration holds.",
            "enum": [
              "viewer",
              "inspector"
            ]
          }
        },
        "additionalProperties": false
      },
      "OidcConfiguration": {
        "type": "object",
        "description": "An OpenID Connect configuration.",
        "required": [
          "provider",
          "ssoDomains",
          "issuer",
          "clientId"
        ],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/OidcProtocol"
          },
          "ssoDomains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1
          },
          "defaultRole": {
            "$ref": "#/components/schemas/SsoDefaultRole"
          },
          "issuer": {
            "type": "string",
            "format": "uri"
          },
          "clientId": {
            "type": "string",
            "minLength": 1
          },
          "clientSecret": {
            "type": "string"
          }
        }
      },
      "OidcProtocol": {
        "type": "string",
        "description": "The OpenID Connect discriminator.",
        "enum": [
          "oidc"
        ]
      },
      "OpenInspectionBody": {
        "type": "object",
        "description": "The body of `openInspection`.",
        "required": [
          "global_id"
        ],
        "properties": {
          "global_id": {
            "type": "string",
            "description": "A live element of the project",
            "maxLength": 64,
            "minLength": 1
          },
          "plan_id": {
            "type": "string",
            "format": "uuid",
            "description": "Needed when several active plans cover the element (409 PLAN_CHOICE_REQUIRED)"
          }
        },
        "additionalProperties": false
      },
      "Organisation": {
        "type": "object",
        "description": "`Organisation`: the caller's organisation and its settings.",
        "required": [
          "id",
          "name",
          "gs1_company_prefix",
          "giai_mode",
          "default_language",
          "mcp_enabled",
          "public_api_enabled",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "gs1_company_prefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "giai_mode": {
            "type": "string"
          },
          "default_language": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrganisationLanguage"
              },
              {
                "type": "null"
              }
            ]
          },
          "mcp_enabled": {
            "type": "boolean"
          },
          "public_api_enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          }
        }
      },
      "OrganisationChanges": {
        "type": "object",
        "description": "The body of `updateOrganisation`: at least one field.",
        "properties": {
          "default_language": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrganisationLanguage"
              },
              {
                "type": "null"
              }
            ]
          },
          "gs1_company_prefix": {
            "type": [
              "string",
              "null"
            ],
            "description": "7 to 12 digits; `null` clears it.",
            "pattern": "^\\d{7,12}$"
          },
          "mcp_enabled": {
            "type": "boolean"
          },
          "public_api_enabled": {
            "type": "boolean",
            "description": "false turns the API off for the organisation, this integration included: the next call answers PUBLIC_API_DISABLED"
          }
        },
        "additionalProperties": false
      },
      "OrganisationCheckList": {
        "type": "object",
        "description": "One of the organisation's check lists with its current items.",
        "required": [
          "id",
          "name",
          "description",
          "current_version",
          "created_by",
          "created_at",
          "modified_date",
          "items"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "modified_date": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckListItem"
            }
          }
        }
      },
      "OrganisationFailReasonList": {
        "type": "object",
        "description": "One of the organisation's fail-reason lists; `template_count` for an organisation admin only.",
        "required": [
          "id",
          "name",
          "reasons",
          "is_default",
          "modified_date"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_default": {
            "type": "boolean"
          },
          "modified_date": {
            "type": "string"
          },
          "template_count": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "OrganisationFailReasonLists": {
        "type": "object",
        "description": "`{ data }` of `listOrganisationFailReasonLists`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganisationFailReasonList"
            },
            "description": "The lists, default first, then by name."
          }
        }
      },
      "OrganisationLanguage": {
        "type": "string",
        "description": "An interface language as `/v1` answers it.",
        "enum": [
          "fi",
          "en"
        ]
      },
      "OrganisationReferenceDocument": {
        "type": "object",
        "description": "A reference document of the organisation's templates.",
        "required": [
          "id",
          "filename",
          "content_type",
          "byte_size",
          "uploaded_by",
          "uploaded_by_name",
          "created_at",
          "changed_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "byte_size": {
            "type": "integer",
            "format": "int64"
          },
          "uploaded_by": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "uploaded_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "changed_at": {
            "type": "string"
          }
        }
      },
      "OrganisationTemplate": {
        "type": "object",
        "description": "`shapeTemplate()`: one of the organisation's templates with its steps.",
        "required": [
          "id",
          "name",
          "description",
          "applies_to_types",
          "is_default",
          "fail_reason_list_id",
          "created_by",
          "created_at",
          "modified_date",
          "steps"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "applies_to_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_default": {
            "type": "boolean"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "modified_date": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganisationTemplateStep"
            }
          }
        }
      },
      "OrganisationTemplateChanges": {
        "type": "object",
        "description": "The body of `updateOrganisationTemplate`.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "is_default": {
            "type": "boolean"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganisationTemplateStepChanges"
            },
            "description": "The whole list: a step with `id` is kept and changed, one without is added, one left out is removed",
            "maxItems": 100
          }
        },
        "additionalProperties": false
      },
      "OrganisationTemplateStep": {
        "type": "object",
        "description": "A step of `OrganisationTemplate`.",
        "required": [
          "id",
          "sort_order",
          "name",
          "description",
          "required",
          "sequential",
          "check_group_id",
          "fail_reason_list_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sort_order": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "sequential": {
            "type": "boolean"
          },
          "check_group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "OrganisationTemplateStepChanges": {
        "type": "object",
        "description": "A step of `OrganisationTemplateChanges`; with `id` it is kept and changed.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "required": {
            "type": "boolean",
            "default": true
          },
          "sequential": {
            "type": "boolean",
            "default": true
          },
          "check_group_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "OrganisationTemplateSummary": {
        "type": "object",
        "description": "`pickTemplate()` with `step_count`: one of the organisation's templates in a list.",
        "required": [
          "id",
          "name",
          "description",
          "applies_to_types",
          "is_default",
          "fail_reason_list_id",
          "created_by",
          "created_at",
          "modified_date",
          "step_count"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "applies_to_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "is_default": {
            "type": "boolean"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "modified_date": {
            "type": "string"
          },
          "step_count": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "OrganisationTemplates": {
        "type": "object",
        "description": "`{ data }` of `listOrganisationTemplates`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganisationTemplateSummary"
            },
            "description": "The organisation's own templates, newest first."
          }
        }
      },
      "OrganisationUsage": {
        "type": "object",
        "description": "`getOrganisationAnalytics`: product events counted in `[from, to)` and per UTC day.",
        "required": [
          "from",
          "to",
          "totals",
          "daily"
        ],
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "totals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageTotal"
            }
          },
          "daily": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageDay"
            }
          }
        }
      },
      "OtherProject": {
        "type": "object",
        "description": "A project of another organisation whose project admin added the integration (spec 056 §16, 5b).",
        "required": [
          "project_id",
          "name",
          "owner_account_name",
          "project_role",
          "added_at"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "name": {
            "type": "string",
            "description": "The project's name."
          },
          "owner_account_name": {
            "type": "string",
            "description": "The organisation that owns the project."
          },
          "project_role": {
            "$ref": "#/components/schemas/OtherProjectRole",
            "description": "The role its project admin gave."
          },
          "added_at": {
            "type": "string",
            "description": "When the integration joined it."
          }
        }
      },
      "OtherProjectRole": {
        "type": "string",
        "description": "The role another organisation's project admin gave the integration.",
        "enum": [
          "viewer",
          "inspector"
        ]
      },
      "PasswordChangeRequired": {
        "type": "object",
        "description": "The answer of `requirePasswordChange`.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/LockedStatus"
          }
        }
      },
      "PasswordResetSent": {
        "type": "object",
        "description": "The answer of `resetUserPassword`.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/SentStatus"
          }
        }
      },
      "Person": {
        "type": "object",
        "description": "`Person`: a person of the organisation.",
        "required": [
          "id",
          "email",
          "name",
          "role",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "$ref": "#/components/schemas/PersonRole"
          },
          "created_at": {
            "type": "string"
          }
        }
      },
      "PersonChanges": {
        "type": "object",
        "description": "The body of `updateUser`: `name` or `role`.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "role": {
            "$ref": "#/components/schemas/PersonRole"
          }
        },
        "additionalProperties": false
      },
      "PersonList": {
        "type": "object",
        "description": "The people of the organisation, a page of them.",
        "required": [
          "data",
          "total",
          "limit",
          "offset"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Person"
            }
          },
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "limit": {
            "type": "integer",
            "format": "int64"
          },
          "offset": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PersonRole": {
        "type": "string",
        "description": "An account role.",
        "enum": [
          "admin",
          "inspector",
          "viewer"
        ]
      },
      "PhotoUpload": {
        "type": "object",
        "description": "A signed PUT for one photo.",
        "required": [
          "photo_key",
          "upload_url",
          "method",
          "headers",
          "expires_in"
        ],
        "properties": {
          "photo_key": {
            "type": "string",
            "description": "Pass it to createViewpoint or createFindingDraft once the upload has finished"
          },
          "upload_url": {
            "type": "string",
            "description": "The signed PUT."
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "headers": {
            "type": "object",
            "description": "Send exactly these headers with the PUT",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "expires_in": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds the upload URL stays valid",
            "minimum": 0
          }
        }
      },
      "PhotoUploadBody": {
        "type": "object",
        "required": [
          "content_type",
          "size"
        ],
        "properties": {
          "content_type": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg"
            ]
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes; at most 20971520. S3 refuses an upload of another size.",
            "maximum": 20971520,
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "PlaceBucket": {
        "type": "string",
        "description": "Which level a bucket lacks.",
        "enum": [
          "no_building",
          "no_storey",
          "no_space"
        ]
      },
      "PlaceEntry": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PlaceLevel"
          },
          {
            "type": "object",
            "required": [
              "count",
              "in_progress",
              "open_findings"
            ],
            "properties": {
              "count": {
                "type": "integer",
                "format": "int64",
                "description": "Elements under it"
              },
              "in_progress": {
                "type": "integer",
                "format": "int64",
                "description": "Elements whose latest inspection is in progress"
              },
              "open_findings": {
                "type": "integer",
                "format": "int64"
              },
              "elevation_m": {
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "groups": {
                "type": "integer",
                "format": "int64",
                "description": "The zones or systems a zones or systems row holds"
              },
              "model": {
                "type": "string"
              },
              "model_id": {
                "type": "string",
                "format": "uuid"
              },
              "records": {
                "type": "integer",
                "format": "int64",
                "description": "Inspections, findings and maintenance entries on the place itself"
              }
            }
          }
        ]
      },
      "PlaceFinding": {
        "type": "object",
        "description": "A finding marked at a point on a storey, as *Selaa* lists it.",
        "required": [
          "finding_id",
          "number",
          "title",
          "status",
          "open",
          "created_at"
        ],
        "properties": {
          "finding_id": {
            "type": "string",
            "format": "uuid"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "open": {
            "type": "boolean"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PlaceKind": {
        "type": "string",
        "description": "What a step or a child of *Selaa* is.",
        "enum": [
          "building",
          "storey",
          "space",
          "zones",
          "systems",
          "zone",
          "system",
          "type",
          "bucket"
        ]
      },
      "PlaceLevel": {
        "type": "object",
        "required": [
          "kind",
          "name",
          "node"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/PlaceKind"
          },
          "bucket": {
            "$ref": "#/components/schemas/PlaceBucket",
            "description": "Elements with no building, storey or space"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "long_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "other_names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "A merged building's or storey's names in other models, when they differ"
          },
          "node": {
            "type": "string",
            "description": "Opaque: send it back as `node` to open this place"
          },
          "global_id": {
            "type": "string",
            "description": "A building, storey, space, zone or system: its IFC GlobalId"
          }
        }
      },
      "PlaceTree": {
        "type": "object",
        "required": [
          "project_id",
          "node",
          "kind",
          "path",
          "children"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid"
          },
          "node": {
            "type": [
              "string",
              "null"
            ],
            "description": "The place shown; null is the project. Levels with one child are skipped."
          },
          "kind": {
            "$ref": "#/components/schemas/PlacesKind"
          },
          "path": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaceLevel"
            },
            "description": "The levels above, outermost first"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaceEntry"
            },
            "description": "Empty at a type: list its elements with queryElements by `ifc_type` and `storey_name`"
          },
          "spaces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaceEntry"
            }
          },
          "default_view": {
            "$ref": "#/components/schemas/DefaultView"
          },
          "findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaceFinding"
            },
            "description": "At a storey: findings marked at a point on it, newest first"
          }
        }
      },
      "PlacesKind": {
        "type": "string",
        "description": "What the place shown is.",
        "enum": [
          "project",
          "building",
          "storey",
          "space",
          "zones",
          "systems",
          "zone",
          "system",
          "type",
          "bucket"
        ]
      },
      "PlanAssignFilter": {
        "type": "object",
        "description": "The elements an assignment takes, by IFC type and storey name.",
        "properties": {
          "ifc_type": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          },
          "storey_name": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "PlanCoverage": {
        "type": "object",
        "description": "`PlanCoverage`: the plan's elements per coverage state.",
        "required": [
          "in_scope",
          "not_scanned",
          "in_progress",
          "done",
          "failed"
        ],
        "properties": {
          "in_scope": {
            "type": "integer",
            "format": "int32",
            "description": "Live elements in scope."
          },
          "not_scanned": {
            "type": "integer",
            "format": "int32",
            "description": "No workflow, or one nobody has started."
          },
          "in_progress": {
            "type": "integer",
            "format": "int32",
            "description": "Started, not finished."
          },
          "done": {
            "type": "integer",
            "format": "int32",
            "description": "Completed."
          },
          "failed": {
            "type": "integer",
            "format": "int32",
            "description": "Elements in the `failed` coverage state."
          }
        }
      },
      "PlanCreateBody": {
        "type": "object",
        "description": "The body of `createInspectionPlan`.",
        "required": [
          "template_id",
          "name"
        ],
        "properties": {
          "template_id": {
            "type": "string",
            "format": "uuid",
            "description": "A template of the project or of its organisation"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "scope": {
            "$ref": "#/components/schemas/PlanFilterScopeBody",
            "description": "Default `{}`, the whole project"
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2026-03-15"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2026-03-15"
          },
          "assignee_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A user's id.",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "description": "Project members who can inspect, in priority order",
            "maxItems": 100
          }
        },
        "additionalProperties": false
      },
      "PlanFilterScopeBody": {
        "type": "object",
        "description": "The filter keys of a scope.",
        "properties": {
          "ifc_type": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          },
          "storey_name": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          },
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 1000,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "PlanScope": {
        "type": "object",
        "description": "Keys AND together, values within a key OR; `{}` is the whole project. New keys may come.",
        "properties": {
          "ifc_type": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IFC types."
          },
          "storey_name": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Storey names."
          },
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "GlobalIds."
          },
          "assigned": {
            "type": "boolean",
            "description": "The plan also covers its added elements (listInspectionPlanElements, kind added)",
            "enum": [
              true
            ]
          },
          "excluded": {
            "type": "boolean",
            "description": "The plan leaves out its excluded elements",
            "enum": [
              true
            ]
          }
        }
      },
      "PlanScopeBody": {
        "type": "object",
        "description": "`PlanScopeBody`: the stored scope of a plan as a body takes it.",
        "properties": {
          "ifc_type": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          },
          "storey_name": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          },
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 1000,
            "minItems": 1
          },
          "assigned": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "excluded": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "additionalProperties": false
      },
      "PlanUpdateBody": {
        "type": "object",
        "description": "The body of `updateInspectionPlan`.",
        "properties": {
          "template_id": {
            "type": "string",
            "format": "uuid",
            "description": "Only while the plan has no inspections (409 PLAN_TEMPLATE_LOCKED)"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "scope": {
            "$ref": "#/components/schemas/PlanScopeBody",
            "description": "The filter keys replace the stored ones; `assigned` and `excluded` only as the plan has them"
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2026-03-15"
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2026-03-15"
          },
          "status": {
            "$ref": "#/components/schemas/InspectionPlanStatus",
            "description": "draft → active, active → completed or archived, completed → active or archived"
          },
          "assignee_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A user's id.",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "maxItems": 100
          }
        },
        "additionalProperties": false
      },
      "PointBody": {
        "type": "object",
        "required": [
          "x",
          "y",
          "z"
        ],
        "properties": {
          "x": {
            "type": "number",
            "format": "double",
            "exclusiveMaximum": 10000000,
            "exclusiveMinimum": -10000000
          },
          "y": {
            "type": "number",
            "format": "double",
            "exclusiveMaximum": 10000000,
            "exclusiveMinimum": -10000000
          },
          "z": {
            "type": "number",
            "format": "double",
            "exclusiveMaximum": 10000000,
            "exclusiveMinimum": -10000000
          }
        },
        "additionalProperties": false
      },
      "PreviewInspectionPlanBody": {
        "type": "object",
        "description": "The body of `previewInspectionPlan`.",
        "properties": {
          "ifc_type": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          },
          "storey_name": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          },
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 1000,
            "minItems": 1
          },
          "assigned": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "excluded": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "plan_id": {
            "type": "string",
            "format": "uuid",
            "description": "Resolve against this plan's added and excluded elements"
          }
        },
        "additionalProperties": false
      },
      "Project": {
        "type": "object",
        "description": "A project the principal reaches.",
        "required": [
          "project_id",
          "id",
          "name",
          "description",
          "phase",
          "owner_account_id",
          "owner_account_name",
          "role",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project, again."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "phase": {
            "type": "string",
            "description": "Its phase."
          },
          "owner_account_id": {
            "type": "string",
            "format": "uuid",
            "description": "The owning organisation."
          },
          "owner_account_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its name."
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "The principal's project role."
          },
          "changed_at": {
            "type": "string",
            "description": "The later of the project's and the membership's change."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "ProjectChangesBody": {
        "type": "object",
        "description": "The body of `updateProject`.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": "string",
            "maxLength": 20000
          },
          "allow_inspector_label_linking": {
            "type": "boolean",
            "description": "Inspectors may link QR labels to elements"
          },
          "handoff_approval": {
            "type": "boolean",
            "description": "Zone handoffs end at approved instead of received; only where the organisation uses the takt board"
          }
        },
        "additionalProperties": false
      },
      "ProjectDetails": {
        "type": "object",
        "description": "`ProjectDetails`: one project with its settings.",
        "required": [
          "id",
          "name",
          "description",
          "phase",
          "owner_account_id",
          "owner_account_name",
          "role",
          "allow_inspector_label_linking",
          "handoff_approval",
          "member_count",
          "created_at",
          "changed_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "phase": {
            "type": "string",
            "description": "A project phase.",
            "enum": [
              "construction",
              "completed",
              "fm_active"
            ]
          },
          "owner_account_id": {
            "type": "string",
            "format": "uuid"
          },
          "owner_account_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "The principal's own role on the project; null when it reaches the project as its organisation's admin"
          },
          "allow_inspector_label_linking": {
            "type": "boolean"
          },
          "handoff_approval": {
            "type": "boolean"
          },
          "member_count": {
            "type": "integer",
            "format": "int32",
            "description": "People on the project; integrations are not counted"
          },
          "created_at": {
            "type": "string"
          },
          "changed_at": {
            "type": "string"
          }
        }
      },
      "ProjectIntegrationRoleBody": {
        "type": "object",
        "description": "The body of `setProjectIntegrationRole`.",
        "required": [
          "project_role"
        ],
        "properties": {
          "project_role": {
            "type": "string",
            "description": "A role another organisation's integration holds.",
            "enum": [
              "viewer",
              "inspector"
            ]
          }
        },
        "additionalProperties": false
      },
      "ProjectItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Project",
            "description": "A live project."
          },
          {
            "$ref": "#/components/schemas/DeletedProject",
            "description": "A deleted or lost project."
          }
        ],
        "description": "An item of `GET /v1/projects`."
      },
      "ProjectPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ProjectReferenceDocument": {
        "type": "object",
        "description": "A live reference document.",
        "required": [
          "id",
          "project_id",
          "filename",
          "content_type",
          "byte_size",
          "uploaded_by",
          "uploaded_by_name",
          "created_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The document."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "filename": {
            "type": "string",
            "description": "The file's name."
          },
          "content_type": {
            "type": "string",
            "description": "The file's media type."
          },
          "byte_size": {
            "type": "integer",
            "format": "int64",
            "description": "The file's size."
          },
          "uploaded_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who uploaded it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "uploaded_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name, read when answering."
          },
          "created_at": {
            "type": "string",
            "description": "When it was uploaded."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "ProposalConflict": {
        "type": "string",
        "description": "Why a proposal is `ristiriita`.",
        "enum": [
          "label",
          "inspection"
        ]
      },
      "ProposalCounts": {
        "type": "object",
        "description": "How many removed elements of a model have a proposal of each tier.",
        "required": [
          "varma",
          "todennakoinen",
          "palautus",
          "ristiriita"
        ],
        "properties": {
          "varma": {
            "type": "integer",
            "format": "int64",
            "description": "Without a conflict, `varma`."
          },
          "todennakoinen": {
            "type": "integer",
            "format": "int64",
            "description": "Without a conflict, `todennakoinen`."
          },
          "palautus": {
            "type": "integer",
            "format": "int64",
            "description": "Always 0."
          },
          "ristiriita": {
            "type": "integer",
            "format": "int64",
            "description": "With a conflict."
          }
        }
      },
      "ProposalTier": {
        "type": "string",
        "description": "A proposal's tier; `ristiriita` only after a conflict.",
        "enum": [
          "varma",
          "todennakoinen",
          "ristiriita"
        ]
      },
      "PublicElementEvent": {
        "type": "object",
        "description": "An element event as `/v1` documents it: `created_via` is any text.",
        "required": [
          "id",
          "global_id",
          "kind",
          "occurred_at",
          "recorded_at",
          "entered_later",
          "recorded_by",
          "recorded_by_name",
          "account_name",
          "created_via",
          "via_client_id",
          "load_ref",
          "voided_at",
          "voided_by_name",
          "void_reason"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "global_id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/ElementEventKind"
          },
          "occurred_at": {
            "type": "string"
          },
          "recorded_at": {
            "type": "string"
          },
          "entered_later": {
            "type": "boolean"
          },
          "recorded_by": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "recorded_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "account_name": {
            "type": "string"
          },
          "created_via": {
            "type": [
              "string",
              "null"
            ]
          },
          "via_client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "load_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "voided_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "voided_by_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "void_reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PublicMe": {
        "type": "object",
        "description": "Who the token acts as.",
        "required": [
          "principal",
          "organisation",
          "scopes"
        ],
        "properties": {
          "principal": {
            "$ref": "#/components/schemas/PublicMePrincipal",
            "description": "`integration` for an integration's token; `person` for an app acting for a person"
          },
          "integration": {
            "$ref": "#/components/schemas/PublicMeIntegration",
            "description": "For an integration's token"
          },
          "app": {
            "$ref": "#/components/schemas/PublicMeApp",
            "description": "For an app acting for a person: the registered app and the person's connection to it"
          },
          "organisation": {
            "$ref": "#/components/schemas/PublicMeOrganisation",
            "description": "The principal's organisation."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The token's scopes the principal still holds: an integration's current scopes, an app's within its organisation's cap"
          }
        }
      },
      "PublicMeApp": {
        "type": "object",
        "description": "The app and the person's connection to it.",
        "required": [
          "client_id",
          "name",
          "connection_id"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "format": "uuid",
            "description": "The app's client id."
          },
          "name": {
            "type": "string",
            "description": "The app's name."
          },
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "description": "The person's connection to the app."
          }
        }
      },
      "PublicMeIntegration": {
        "type": "object",
        "description": "The integration of the token.",
        "required": [
          "client_id",
          "name"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "format": "uuid",
            "description": "The integration's id."
          },
          "name": {
            "type": "string",
            "description": "The integration's name."
          }
        }
      },
      "PublicMeKind": {
        "type": "string",
        "description": "The principal's kind.",
        "enum": [
          "integration",
          "person"
        ]
      },
      "PublicMeOrganisation": {
        "type": "object",
        "description": "The principal's organisation.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The account's id."
          },
          "name": {
            "type": "string",
            "description": "The account's name."
          }
        }
      },
      "PublicMePrincipal": {
        "type": "object",
        "description": "Whom the token acts as.",
        "required": [
          "kind",
          "id",
          "name"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/PublicMeKind",
            "description": "`integration` or `person`."
          },
          "id": {
            "type": "string",
            "description": "The principal's `users.id`.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "name": {
            "type": "string",
            "description": "The principal's own name."
          }
        }
      },
      "PublicRecordedEvents": {
        "type": "object",
        "description": "Recorded and refused elements.",
        "required": [
          "kind",
          "recorded",
          "refused"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/ElementEventKind"
          },
          "recorded": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicElementEvent"
            }
          },
          "refused": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicRefusedElement"
            }
          }
        }
      },
      "PublicRefusedElement": {
        "type": "object",
        "description": "An element that took no event.",
        "required": [
          "global_id",
          "code",
          "event"
        ],
        "properties": {
          "global_id": {
            "type": "string"
          },
          "code": {
            "$ref": "#/components/schemas/ElementEventRefusal"
          },
          "event": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PublicElementEvent"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PublishedDraft": {
        "type": "object",
        "description": "The published draft and the finding it became.",
        "required": [
          "draft",
          "finding"
        ],
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/FindingDraftCreated"
          },
          "finding": {
            "$ref": "#/components/schemas/Finding"
          }
        }
      },
      "RecordElementEventsBody": {
        "type": "object",
        "description": "The body of `recordElementEvents`.",
        "required": [
          "kind",
          "global_ids"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/ElementEventKind"
          },
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An element's IFC GlobalId in a list.",
              "maxLength": 64,
              "minLength": 1
            },
            "maxItems": 100,
            "minItems": 1
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened; default now. An earlier time is recorded as entered later."
          },
          "load_ref": {
            "type": "string",
            "description": "Delivery or load reference; delivered and received_on_site only",
            "maxLength": 64,
            "minLength": 1
          }
        },
        "additionalProperties": false
      },
      "RecordHandoffResponse": {
        "type": "object",
        "description": "The answer to `POST …/handoffs`.",
        "required": [
          "kind",
          "replayed",
          "events",
          "defects"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/HandoffKind",
            "description": "The kind stored: a receive with a blocking defect is stored as returned."
          },
          "replayed": {
            "type": "boolean"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HandoffEvent"
            }
          },
          "defects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HandoffDefect"
            }
          }
        }
      },
      "ReferenceDocumentItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProjectReferenceDocument",
            "description": "A live document."
          },
          {
            "$ref": "#/components/schemas/DeletedReferenceDocument",
            "description": "A deleted document."
          }
        ],
        "description": "An item of `GET /v1/reference-documents`."
      },
      "ReferenceDocumentPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferenceDocumentItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ReferenceDocumentUpload": {
        "type": "object",
        "description": "Where to upload.",
        "required": [
          "key",
          "upload_url",
          "method",
          "headers",
          "expires_in"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Pass it to createReferenceDocument, or createOrganisationReferenceDocument, once the upload has finished"
          },
          "upload_url": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "headers": {
            "type": "object",
            "description": "Send exactly these headers with the PUT",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "expires_in": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ReferenceDocumentUploadBody": {
        "type": "object",
        "required": [
          "filename",
          "content_type",
          "byte_size"
        ],
        "properties": {
          "filename": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
          },
          "content_type": {
            "type": "string",
            "enum": [
              "application/pdf"
            ]
          },
          "byte_size": {
            "type": "integer",
            "format": "int64",
            "maximum": 20971520,
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "RelateFindingBody": {
        "type": "object",
        "required": [
          "related_guid"
        ],
        "properties": {
          "related_guid": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "RelatedFinding": {
        "type": "object",
        "description": "A live relation.",
        "required": [
          "link_key",
          "project_id",
          "topic_guid",
          "related_topic_guid",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "link_key": {
            "type": "string",
            "description": "`{topic_guid}:{related_topic_guid}`"
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "topic_guid": {
            "type": "string",
            "format": "uuid",
            "description": "The topic."
          },
          "related_topic_guid": {
            "type": "string",
            "format": "uuid",
            "description": "The topic it relates to."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "RelatedFindingItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/RelatedFinding",
            "description": "A live row."
          },
          {
            "$ref": "#/components/schemas/DeletedRelatedFinding",
            "description": "A deleted row."
          }
        ]
      },
      "RelatedFindingPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RelatedFindingItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ResolveRemovedElementsBody": {
        "type": "object",
        "properties": {
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1
            },
            "maxItems": 200,
            "minItems": 1
          },
          "all": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "additionalProperties": false
      },
      "SamlConfiguration": {
        "type": "object",
        "description": "A SAML configuration: `metadataUrl`, `metadataXml`, or `ssoUrl` with `entityId` and a certificate.",
        "required": [
          "provider",
          "ssoDomains"
        ],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/SamlProtocol"
          },
          "ssoDomains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1
          },
          "defaultRole": {
            "$ref": "#/components/schemas/SsoDefaultRole"
          },
          "ssoUrl": {
            "type": "string",
            "format": "uri"
          },
          "entityId": {
            "type": "string",
            "minLength": 1
          },
          "certificate": {
            "type": "string"
          },
          "metadataUrl": {
            "type": "string",
            "format": "uri"
          },
          "metadataXml": {
            "type": "string"
          }
        }
      },
      "SamlProtocol": {
        "type": "string",
        "description": "The SAML discriminator.",
        "enum": [
          "saml"
        ]
      },
      "ScheduleElementFacts": {
        "type": "object",
        "description": "`ScheduleElementFacts`: per element its installation task and, with the takt switch, its installed, passed and defect days.",
        "required": [
          "actual",
          "tasks",
          "elements",
          "next_cursor"
        ],
        "properties": {
          "actual": {
            "type": "boolean",
            "description": "The project has the takt switch, so the installed, passed and defect columns are filled."
          },
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleFactTask"
            },
            "description": "The effective INSTALLATION tasks of the elements below."
          },
          "elements": {
            "$ref": "#/components/schemas/FactColumns",
            "description": "Columnar: one position per element with an effective installation task, by GlobalId."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `after` of the next page; null on the last page and always without `limit` and `after`."
          }
        }
      },
      "ScheduleFactTask": {
        "type": "object",
        "description": "`ScheduleFactTask`: one effective installation task.",
        "required": [
          "id",
          "name",
          "work_name",
          "start_date",
          "finish_date",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The task."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "work_name": {
            "type": "string",
            "description": "Its work name."
          },
          "start_date": {
            "type": "string",
            "description": "Planned start, YYYY-MM-DD."
          },
          "finish_date": {
            "type": "string",
            "description": "Planned finish, YYYY-MM-DD."
          },
          "source": {
            "type": "string",
            "description": "`ifc_properties`, `ifc_tasks` or `csv`."
          }
        }
      },
      "ScheduleImportItem": {
        "type": "object",
        "description": "A live schedule import.",
        "required": [
          "id",
          "project_id",
          "model_id",
          "source",
          "schedule_kind",
          "model_version_id",
          "filename",
          "summary",
          "imported_at",
          "superseded_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The import."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "model_id": {
            "type": "string",
            "format": "uuid",
            "description": "The model whose versions carry the schedule"
          },
          "source": {
            "$ref": "#/components/schemas/ScheduleSource",
            "description": "`ifc_properties`: the model's `[4D]Task` properties; `ifc_tasks`: its `IfcTask` entities. New sources may come."
          },
          "schedule_kind": {
            "type": "string",
            "description": "`planned` today"
          },
          "model_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The model version the schedule was read from"
          },
          "filename": {
            "type": [
              "string",
              "null"
            ],
            "description": "The file's name."
          },
          "summary": {
            "type": "object",
            "description": "Elements read, tasks, linked elements and the counts of what was left out. New counts may come.",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "imported_at": {
            "type": "string",
            "description": "When it was imported."
          },
          "superseded_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when a later version of the model brought a new import of the same source; null on the live one"
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "ScheduleImportListItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ScheduleImportItem",
            "description": "A live import."
          },
          {
            "$ref": "#/components/schemas/DeletedScheduleImport",
            "description": "A deleted import."
          }
        ],
        "description": "An item of `GET /v1/schedule-imports`."
      },
      "ScheduleImportPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleImportListItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ScheduleSource": {
        "type": "string",
        "description": "Where a schedule was read from.",
        "enum": [
          "ifc_properties",
          "ifc_tasks",
          "csv"
        ]
      },
      "ScheduleTaskElement": {
        "type": "object",
        "description": "`ScheduleTaskElement`: one link of a task.",
        "required": [
          "global_id",
          "effective"
        ],
        "properties": {
          "global_id": {
            "type": "string",
            "description": "The element."
          },
          "effective": {
            "type": "boolean",
            "description": "True on the INSTALLATION link the installation readers take."
          }
        }
      },
      "ScheduleTaskElementsPage": {
        "type": "object",
        "description": "`ScheduleTaskElementsPage`: one page of a task's links.",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleTaskElement"
            },
            "description": "The links, by GlobalId."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The GlobalId to pass as `after`, null on the last page."
          }
        }
      },
      "ScheduleTaskItem": {
        "type": "object",
        "description": "A live schedule task.",
        "required": [
          "id",
          "project_id",
          "model_id",
          "source",
          "name",
          "work_name",
          "start_date",
          "finish_date",
          "task_type",
          "sequence",
          "ifc_guid",
          "zone_id",
          "archived_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The task."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "model_id": {
            "type": "string",
            "format": "uuid",
            "description": "The model."
          },
          "source": {
            "$ref": "#/components/schemas/ScheduleSource",
            "description": "Where the schedule was read from."
          },
          "name": {
            "type": "string",
            "description": "The task's name."
          },
          "work_name": {
            "type": "string",
            "description": "The task name without the zone: the takt board's row"
          },
          "start_date": {
            "type": "string",
            "description": "Planned start, YYYY-MM-DD"
          },
          "finish_date": {
            "type": "string",
            "description": "Planned finish, YYYY-MM-DD"
          },
          "task_type": {
            "type": "string",
            "description": "`INSTALLATION` for installing; other types as the model names them, upper-cased"
          },
          "sequence": {
            "type": "integer",
            "format": "int64",
            "description": "Position in its import"
          },
          "ifc_guid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The IfcTask GlobalId when the task comes from one"
          },
          "zone_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The zone most of its installed elements are in"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when a later import no longer has the task"
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "ScheduleTaskListItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ScheduleTaskItem",
            "description": "A live task."
          },
          {
            "$ref": "#/components/schemas/DeletedScheduleTask",
            "description": "A deleted task."
          }
        ],
        "description": "An item of `GET /v1/schedule-tasks`."
      },
      "ScheduleTaskPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduleTaskListItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ScheduleZone": {
        "type": "object",
        "description": "A live zone.",
        "required": [
          "id",
          "project_id",
          "label",
          "sort_key",
          "element_count",
          "archived_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The zone."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "label": {
            "type": "string",
            "description": "The zone's name: today a storey name of the project's models"
          },
          "sort_key": {
            "type": "string",
            "description": "Sort by it (byte order) for the app's natural order of zones"
          },
          "element_count": {
            "type": "integer",
            "format": "int64",
            "description": "Live elements in the zone; it changes as models change"
          },
          "archived_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set when no live element is left in the zone; cleared when one comes back"
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "SentStatus": {
        "type": "string",
        "description": "The status of a sent password reset.",
        "enum": [
          "sent"
        ]
      },
      "ServiceProvider": {
        "type": "object",
        "description": "What the service provider side of SAML looks like to the identity provider.",
        "required": [
          "acs_url",
          "entity_id",
          "login_url",
          "attribute_mapping",
          "is_placeholder"
        ],
        "properties": {
          "acs_url": {
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "login_url": {
            "type": "string"
          },
          "attribute_mapping": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "is_placeholder": {
            "type": "boolean"
          }
        }
      },
      "SetFindingFilesBody": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "ifc_project": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 255
            },
            "filename": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 512
            },
            "reference": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 2048
            }
          },
          "additionalProperties": false
        },
        "maxItems": 200
      },
      "SetPhaseBody": {
        "type": "object",
        "description": "The body of `setProjectPhase`.",
        "required": [
          "phase"
        ],
        "properties": {
          "phase": {
            "type": "string",
            "description": "A project phase.",
            "enum": [
              "construction",
              "completed",
              "fm_active"
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened; default now. An earlier time is recorded as entered later."
          }
        },
        "additionalProperties": false
      },
      "SkipReason": {
        "type": "string",
        "description": "Why a project's rows were not read.",
        "enum": [
          "FEATURE_OFF",
          "LICENCE_REQUIRED",
          "PUBLIC_API_DISABLED"
        ]
      },
      "SkippedProject": {
        "type": "object",
        "description": "A project of the window whose rows were not read.",
        "required": [
          "project_id",
          "reason"
        ],
        "properties": {
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "reason": {
            "$ref": "#/components/schemas/SkipReason",
            "description": "FEATURE_OFF: the owning organisation lacks the feature this resource needs. PUBLIC_API_DISABLED: the owning organisation has turned the API off"
          }
        }
      },
      "SsoConfiguration": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/SamlConfiguration",
            "description": "SAML."
          },
          {
            "$ref": "#/components/schemas/OidcConfiguration",
            "description": "OpenID Connect."
          }
        ],
        "description": "The body of an SSO configuration, `SsoConfigBody`."
      },
      "SsoDefaultRole": {
        "type": "string",
        "description": "The role new users of the domains get.",
        "enum": [
          "admin",
          "inspector",
          "viewer"
        ]
      },
      "SsoSettings": {
        "type": "object",
        "description": "`SsoSettings`: the organisation's single sign-on.",
        "required": [
          "provider",
          "domains",
          "default_role",
          "config",
          "service_provider"
        ],
        "properties": {
          "provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "default_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "config": {
            "type": [
              "object",
              "null"
            ],
            "description": "Secrets are replaced by has_* markers",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "service_provider": {
            "$ref": "#/components/schemas/ServiceProvider"
          }
        }
      },
      "StepCommentBody": {
        "type": "object",
        "description": "The body of `createStepComment`.",
        "required": [
          "comment"
        ],
        "properties": {
          "comment": {
            "type": "string",
            "maxLength": 20000,
            "minLength": 1
          }
        },
        "additionalProperties": false
      },
      "StepPhotoBody": {
        "type": "object",
        "description": "The body of `createStepViewpoint`.",
        "required": [
          "photo_key"
        ],
        "properties": {
          "photo_key": {
            "type": "string",
            "description": "A key from uploadFindingPhoto, uploaded before this call",
            "maxLength": 1024,
            "minLength": 1
          }
        },
        "additionalProperties": false
      },
      "StepReopenBody": {
        "type": "object",
        "description": "The body of `reopenStep`.",
        "properties": {
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "occurred_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it happened on site, if earlier than now; the answer marks it entered later"
          }
        }
      },
      "StepVerdictBody": {
        "type": "object",
        "description": "The body of `recordStepVerdict`.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "`na`: the step does not apply; its reason goes in `notes`",
            "enum": [
              "ok",
              "failed",
              "na"
            ]
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "fail_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "With `failed`: a reason from listFailReasonLists, or free text",
            "maxLength": 255
          },
          "occurred_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it happened on site, if earlier than now; the answer marks it entered later"
          }
        }
      },
      "Storey": {
        "type": "object",
        "description": "`Storey`: a live storey of the project's current models.",
        "required": [
          "global_id",
          "name",
          "long_name",
          "building_name",
          "elevation_m",
          "elements"
        ],
        "properties": {
          "global_id": {
            "type": "string",
            "description": "Send it as `storey_global_id`"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "long_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "building_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Matches `building_name` on elements"
          },
          "elevation_m": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "elements": {
            "type": "integer",
            "format": "int64",
            "description": "Live elements whose `storey_name` is this storey's name in the same model"
          }
        }
      },
      "Storeys": {
        "type": "object",
        "description": "`Storeys`: the project's live storeys.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Storey"
            }
          }
        }
      },
      "TaktBoardDay": {
        "type": "object",
        "description": "`TaktBoardDay`: zones × work names at the end of one day.",
        "required": [
          "date",
          "zones",
          "work_names",
          "cells"
        ],
        "properties": {
          "date": {
            "type": "string"
          },
          "zones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoardZone"
            }
          },
          "work_names": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BoardWork"
            }
          },
          "cells": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaktCell"
            }
          }
        }
      },
      "TaktCell": {
        "type": "object",
        "description": "A cell of the board: one zone × work name.",
        "required": [
          "late",
          "state",
          "total",
          "company",
          "zone_id",
          "task_ids",
          "days_late",
          "installed",
          "work_name",
          "start_date",
          "task_count",
          "finish_date",
          "defects_open",
          "inspected_ok",
          "blocking_open",
          "handoff_state",
          "model_version_id"
        ],
        "properties": {
          "late": {
            "type": "boolean"
          },
          "state": {
            "$ref": "#/components/schemas/CellState",
            "description": "New states may come"
          },
          "total": {
            "type": "integer",
            "format": "int64"
          },
          "company": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BoardCompany",
                "description": "The organisation that marked the cell done last, else the one that recorded its latest installed event"
              },
              {
                "type": "null"
              }
            ]
          },
          "zone_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null for the elements in no zone"
          },
          "task_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "days_late": {
            "type": "integer",
            "format": "int64"
          },
          "installed": {
            "type": "integer",
            "format": "int64"
          },
          "work_name": {
            "type": "string"
          },
          "start_date": {
            "type": "string"
          },
          "task_count": {
            "type": "integer",
            "format": "int64"
          },
          "finish_date": {
            "type": "string"
          },
          "defects_open": {
            "type": "integer",
            "format": "int64"
          },
          "inspected_ok": {
            "type": "integer",
            "format": "int64"
          },
          "blocking_open": {
            "type": "integer",
            "format": "int64"
          },
          "handoff_state": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/HandoffKind",
                "description": "The least advanced handoff state of the cell's tasks at the end of the day; null while one has none"
              },
              {
                "type": "null"
              }
            ]
          },
          "model_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The current version of the cell's model"
          }
        }
      },
      "Template": {
        "type": "object",
        "description": "A live template.",
        "required": [
          "id",
          "project_id",
          "organisation_id",
          "name",
          "description",
          "is_default",
          "fail_reason_list_id",
          "created_by",
          "created_at",
          "modified_date",
          "steps",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The template."
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null for the organisation's own template"
          },
          "organisation_id": {
            "type": "string",
            "format": "uuid",
            "description": "Its organisation."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "is_default": {
            "type": "boolean",
            "description": "Opened for an element that no plan covers"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Its fail reasons."
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who created it.",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "created_at": {
            "type": "string",
            "description": "When it was created."
          },
          "modified_date": {
            "type": "string",
            "description": "When it was changed last."
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateStep"
            },
            "description": "Its steps."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "TemplateListItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Template",
            "description": "A live row."
          },
          {
            "$ref": "#/components/schemas/DeletedTemplate",
            "description": "A deleted row."
          }
        ]
      },
      "TemplatePage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateListItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "TemplateStep": {
        "type": "object",
        "description": "A step of a template.",
        "required": [
          "id",
          "sort_order",
          "name",
          "description",
          "required",
          "sequential",
          "check_list_id",
          "fail_reason_list_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The step."
          },
          "sort_order": {
            "type": "integer",
            "format": "int32",
            "description": "Its place."
          },
          "name": {
            "type": "string",
            "description": "Its name."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its description."
          },
          "required": {
            "type": "boolean",
            "description": "True when it must pass."
          },
          "sequential": {
            "type": "boolean",
            "description": "The step waits for the required steps before it"
          },
          "check_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A step with a check list is passed by its checks"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Its fail reasons."
          }
        }
      },
      "TemplateStepBody": {
        "type": "object",
        "description": "A step of `UpdateTemplateBody`.",
        "required": [
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "An existing step of this template; leave it out for a new step"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "required": {
            "type": "boolean",
            "description": "Default true"
          },
          "sequential": {
            "type": "boolean",
            "description": "Default true: the step waits for the required steps before it"
          },
          "check_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A check list of the project or the organisation; the step is then passed by its checks"
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "UndoCarryOversBody": {
        "type": "object",
        "properties": {
          "carry_over_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 500,
            "minItems": 1
          },
          "batch_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "UndoCarryOversResult": {
        "type": "object",
        "required": [
          "carry_overs",
          "totals",
          "stayed"
        ],
        "properties": {
          "carry_overs": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One carry-over of an undo's answer.",
              "required": [
                "carry_over_id",
                "from",
                "to",
                "status"
              ],
              "properties": {
                "carry_over_id": {
                  "type": "string"
                },
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "description": "An undo's status.",
                  "enum": [
                    "undone",
                    "refused"
                  ]
                },
                "moved_back": {
                  "$ref": "#/components/schemas/CarryOverMovedBack"
                },
                "stayed": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Work recorded on the new element after the carry-over; it stays there"
                },
                "code": {
                  "type": "string",
                  "description": "Why a pair was refused.",
                  "enum": [
                    "LABEL_ON_BOTH",
                    "INSPECTION_ON_BOTH",
                    "REMAP_STALE"
                  ]
                }
              }
            }
          },
          "totals": {
            "$ref": "#/components/schemas/CarryOverMovedBack"
          },
          "stayed": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "UpdateCheckListBody": {
        "type": "object",
        "description": "The body of `updateCheckList`.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckBody"
            },
            "description": "The whole list. A list that differs from the current version makes a new version; results keep the version they were recorded against. A version holds at most 256 KiB of checks serialized as JSON; more answers 400 VALIDATION_ERROR.",
            "maxItems": 100,
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "UpdateFindingBody": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000
          },
          "topic_type": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "topic_status": {
            "type": "string",
            "description": "For example Open, Closed or Resolved",
            "maxLength": 255
          },
          "priority": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "assigned_to": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255,
              "minLength": 1
            },
            "maxItems": 100
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "due_date": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          }
        },
        "additionalProperties": false
      },
      "UpdateTemplateBody": {
        "type": "object",
        "description": "The body of `updateTemplate`.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "description": {
            "type": "string",
            "maxLength": 20000
          },
          "is_default": {
            "type": "boolean",
            "description": "Makes this the project's default template",
            "enum": [
              true
            ]
          },
          "fail_reason_list_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateStepBody"
            },
            "description": "The whole list in its new order. A step with `id` keeps its results; a step left out is removed with its open results.",
            "maxItems": 100
          }
        },
        "additionalProperties": false
      },
      "UsageDay": {
        "type": "object",
        "description": "One event's count on one UTC day.",
        "required": [
          "date",
          "event",
          "count"
        ],
        "properties": {
          "date": {
            "type": "string",
            "description": "The UTC day, YYYY-MM-DD"
          },
          "event": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "UsageTotal": {
        "type": "object",
        "description": "One event's count in the window.",
        "required": [
          "event",
          "count"
        ],
        "properties": {
          "event": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "Viewpoint": {
        "type": "object",
        "description": "A live viewpoint.",
        "required": [
          "guid",
          "project_id",
          "topic_guid",
          "elements",
          "point",
          "components",
          "camera",
          "has_photo",
          "photo_type",
          "creation_author",
          "creation_date",
          "entered_later",
          "recorded_at",
          "changed_at",
          "deleted"
        ],
        "properties": {
          "guid": {
            "type": "string",
            "format": "uuid",
            "description": "The viewpoint."
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "description": "The project."
          },
          "topic_guid": {
            "type": "string",
            "format": "uuid",
            "description": "Its topic."
          },
          "elements": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The GlobalIds the viewpoint selects"
          },
          "point": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ViewpointPoint",
                "description": "A point on a storey, metres in the model's coordinates (spec 054 §3.8)"
              },
              {
                "type": "null"
              }
            ]
          },
          "components": {
            "type": [
              "object",
              "null"
            ],
            "description": "The BCF components as stored",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "camera": {
            "type": [
              "object",
              "null"
            ],
            "description": "The BCF camera as stored",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "has_photo": {
            "type": "boolean",
            "description": "Download it from getViewpointPhoto"
          },
          "photo_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The photo's type."
          },
          "creation_author": {
            "type": "string",
            "description": "Who created it."
          },
          "creation_date": {
            "type": "string",
            "description": "When it was created."
          },
          "entered_later": {
            "type": "boolean",
            "description": "True when recorded after the fact."
          },
          "recorded_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was recorded."
          },
          "changed_at": {
            "type": "string",
            "description": "The row's change time."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "ViewpointItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Viewpoint",
            "description": "A live row."
          },
          {
            "$ref": "#/components/schemas/DeletedViewpoint",
            "description": "A deleted row."
          }
        ]
      },
      "ViewpointPage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewpointItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ViewpointPoint": {
        "type": "object",
        "description": "A point on a storey.",
        "required": [
          "x",
          "y",
          "z"
        ],
        "properties": {
          "x": {
            "type": "number",
            "format": "double",
            "description": "Metres east."
          },
          "y": {
            "type": "number",
            "format": "double",
            "description": "Metres north."
          },
          "z": {
            "type": "number",
            "format": "double",
            "description": "Metres up."
          }
        }
      },
      "WarningCode": {
        "type": "string",
        "description": "The code of an invitation warning.",
        "enum": [
          "SSO_DOMAIN_OWN",
          "SSO_DOMAIN_OTHER"
        ]
      },
      "WarningDetail": {
        "type": "object",
        "description": "One invitation warning.",
        "required": [
          "code",
          "domain"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/WarningCode"
          },
          "domain": {
            "type": "string"
          }
        }
      },
      "Window": {
        "type": "object",
        "description": "The bounds a page was read with.",
        "required": [
          "modified_from",
          "modified_to"
        ],
        "properties": {
          "modified_from": {
            "type": [
              "string",
              "null"
            ],
            "description": "The lower bound used, normalised to UTC with microseconds; null without modified_from"
          },
          "modified_to": {
            "type": "string",
            "description": "The upper bound the server used. The next window starts here."
          }
        }
      },
      "ZoneElementPage": {
        "type": "object",
        "description": "`ZoneElementPage`: one page of a zone's GlobalIds.",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "GlobalIds, in GlobalId order"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ZoneHandoffBody": {
        "type": "object",
        "description": "The body of `recordZoneHandoff`.",
        "required": [
          "zone_id",
          "kind"
        ],
        "properties": {
          "zone_id": {
            "type": "string",
            "format": "uuid"
          },
          "task_id": {
            "type": "string",
            "format": "uuid",
            "description": "One task of the zone; leave it out to hand off every task of `work_name` in the zone"
          },
          "work_name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "description": "A handoff transition.",
            "enum": [
              "done",
              "received",
              "returned",
              "approved",
              "reopened"
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          },
          "note": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1
          },
          "defects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ZoneHandoffDefectInput"
            },
            "maxItems": 10
          }
        },
        "additionalProperties": false
      },
      "ZoneHandoffDefectInput": {
        "type": "object",
        "description": "A defect of `recordZoneHandoff`.",
        "required": [
          "title",
          "blocking"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1
          },
          "description": {
            "type": "string",
            "maxLength": 5000
          },
          "global_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64,
              "minLength": 1
            },
            "description": "Elements of the zone the defect is on; none for a defect of the whole zone.",
            "maxItems": 50
          },
          "blocking": {
            "type": "boolean",
            "description": "Blocks the next work from starting; a receive with one is recorded as returned."
          },
          "responsible_account_id": {
            "type": "string",
            "format": "uuid",
            "description": "The organisation responsible; by default the one that marked the task done."
          }
        },
        "additionalProperties": false
      },
      "ZoneItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ScheduleZone",
            "description": "A live zone."
          },
          {
            "$ref": "#/components/schemas/DeletedZone",
            "description": "A deleted zone."
          }
        ],
        "description": "An item of `GET /v1/zones`."
      },
      "ZonePage": {
        "type": "object",
        "description": "One page of the list.",
        "required": [
          "data",
          "window",
          "skipped_projects",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ZoneItem"
            },
            "description": "The rows."
          },
          "window": {
            "$ref": "#/components/schemas/Window",
            "description": "The bounds used."
          },
          "skipped_projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedProject"
            },
            "description": "Projects whose rows were not read."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page."
          }
        }
      },
      "ZoneScheme": {
        "type": "object",
        "description": "`ZoneScheme`: the project's live zones and the elements in none.",
        "required": [
          "keys",
          "zones",
          "unzoned_count"
        ],
        "properties": {
          "keys": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "additionalProperties": {},
              "propertyNames": {
                "type": "string"
              }
            },
            "description": "What divides the project into zones: today `[{ \"source\": \"storey_name\" }]`; null before the first model"
          },
          "zones": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A live zone with its element count.",
              "required": [
                "id",
                "label",
                "element_count"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "label": {
                  "type": "string"
                },
                "element_count": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            },
            "description": "The live zones in the app's natural order"
          },
          "unzoned_count": {
            "type": "integer",
            "format": "int64",
            "description": "Live elements in no zone"
          }
        }
      }
    },
    "securitySchemes": {
      "integration": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.whatsbuilt.fi/oauth/authorize",
            "tokenUrl": "https://api.whatsbuilt.fi/oauth/token",
            "refreshUrl": "https://api.whatsbuilt.fi/oauth/token",
            "scopes": {
              "element-events:write": "Record and void element events; gives the inspector role",
              "elements:delete": "Delete labels; gives the admin role",
              "elements:read": "Elements and element events",
              "elements:write": "Create and assign labels; gives the inspector role",
              "finding-drafts:write": "Create finding drafts for the project's inspectors",
              "findings:delete": "Delete findings and import BCF; gives the admin role",
              "findings:read": "Findings and other topics, and finding drafts",
              "findings:write": "Create and change findings, comments, viewpoints and photos; gives the inspector role",
              "inspections:read": "Inspections with their steps and checks",
              "members:write": "Add, change and remove project members, decide access requests and handovers of the project; gives the admin role",
              "offline_access": "A rotating refresh token, so the app keeps working until its connection ends",
              "organisation:admin": "Act as the organisation's admin: projects, people, settings, single sign-on, the organisation's templates, check lists and fail-reason lists, integrations and their keys, and handover decisions",
              "projects:read": "Projects",
              "projects:write": "Change projects and their phase; gives the admin role",
              "read": "Every read scope below",
              "schedule:read": "Zones, schedule imports and tasks, the takt board, zone handoffs and deviations"
            }
          },
          "clientCredentials": {
            "tokenUrl": "https://api.whatsbuilt.fi/oauth/token",
            "scopes": {
              "element-events:write": "Record and void element events; gives the inspector role",
              "elements:delete": "Delete labels; gives the admin role",
              "elements:read": "Elements and element events",
              "elements:write": "Create and assign labels; gives the inspector role",
              "finding-drafts:write": "Create finding drafts for the project's inspectors",
              "findings:delete": "Delete findings and import BCF; gives the admin role",
              "findings:read": "Findings and other topics, and finding drafts",
              "findings:write": "Create and change findings, comments, viewpoints and photos; gives the inspector role",
              "inspections:read": "Inspections with their steps and checks",
              "members:write": "Add, change and remove project members, decide access requests and handovers of the project; gives the admin role",
              "organisation:admin": "Act as the organisation's admin: projects, people, settings, single sign-on, the organisation's templates, check lists and fail-reason lists, integrations and their keys, and handover decisions",
              "projects:read": "Projects",
              "projects:write": "Change projects and their phase; gives the admin role",
              "read": "Every read scope below",
              "schedule:read": "Zones, schedule imports and tasks, the takt board, zone handoffs and deviations"
            }
          }
        },
        "description": "An integration: client credentials with a client assertion (`private_key_jwt`, RFC 7523) signed with its key; see *Get an access token*. An app acting for a person: authorization code with PKCE; see *Apps acting for a person*."
      }
    }
  },
  "tags": [
    {
      "name": "Integration",
      "description": "Who the token acts as"
    },
    {
      "name": "Changes",
      "description": "Lists with a modification window, deletions included"
    },
    {
      "name": "Writes",
      "description": "Element events, findings, finding drafts and labels, with Idempotency-Key"
    },
    {
      "name": "Projects",
      "description": "Projects, their phase and handovers"
    },
    {
      "name": "People",
      "description": "Project members, access requests and other organisations' integrations; integrations are never listed as people"
    },
    {
      "name": "Organisation",
      "description": "The organisation's settings, people, single sign-on and integrations, with organisation:admin"
    },
    {
      "name": "Library",
      "description": "The organisation's own inspection templates, check lists, fail-reason lists and reference documents"
    },
    {
      "name": "Exports",
      "description": "Export and report jobs: start, poll, download"
    }
  ]
}
