{
  "components": {
    "parameters": {
      "BatteryId": {
        "in": "path",
        "name": "batteryId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "Cursor": {
        "description": "Opaque cursor from a previous page's `next_cursor`.",
        "in": "query",
        "name": "cursor",
        "required": false,
        "schema": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        }
      },
      "EvidenceId": {
        "in": "path",
        "name": "evidenceId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "FieldKey": {
        "description": "Registry field key, e.g. `performance.nominal_voltage`.",
        "in": "path",
        "name": "fieldKey",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/FieldKey"
        }
      },
      "IfMatch": {
        "description": "The `row_version` the client last read, as a quoted string, e.g. `\"3\"`.",
        "in": "header",
        "name": "If-Match",
        "required": true,
        "schema": {
          "pattern": "^\"[1-9][0-9]{0,17}\"$",
          "type": "string"
        }
      },
      "ImportId": {
        "in": "path",
        "name": "importId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "Limit": {
        "description": "Maximum number of items to return.",
        "in": "query",
        "name": "limit",
        "required": false,
        "schema": {
          "default": 50,
          "maximum": 200,
          "minimum": 1,
          "type": "integer"
        }
      },
      "ModelId": {
        "in": "path",
        "name": "modelId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "PassportId": {
        "description": "The UUID of the passport identifier `urn:dpp:{uuid}`.",
        "in": "path",
        "name": "passportId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "VersionId": {
        "in": "path",
        "name": "versionId",
        "required": true,
        "schema": {
          "format": "uuid",
          "type": "string"
        }
      },
      "VersionNo": {
        "in": "path",
        "name": "versionNo",
        "required": true,
        "schema": {
          "minimum": 1,
          "type": "integer"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "The request is malformed or failed validation (`validation_error`), or a token is invalid or expired (`invalid_token`)."
      },
      "Conflict": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "The request conflicts with the current state (`conflict`), e.g. a stale `If-Match` version."
      },
      "Forbidden": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "The API key may not perform this action (`forbidden`): it lacks the operation's scope, or the action\nneeds more than a viewer's rights.\n"
      },
      "NotFound": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "The resource does not exist in the organisation of the API key, or the public passport is unknown (`not_found`)."
      },
      "PayloadTooLarge": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "The request body exceeds the size limit (`payload_too_large`)."
      },
      "Problem": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "Any other problem, e.g. `internal_error`."
      },
      "TooManyRequests": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "Too many attempts (`rate_limited`); retry after the number of seconds in the `Retry-After` header."
      },
      "Unauthenticated": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "The API key is missing, unknown or revoked (`unauthenticated`)."
      }
    },
    "schemas": {
      "Address": {
        "additionalProperties": false,
        "description": "A postal address (ADR-022). `street` is the first address line, street and house number as written in\nthe country; `extra_line` the second (building, floor, c/o). `region` is the administrative area where\nthe country's format has one (`getAddressFormats`; required for IT and ES). Postal codes are checked\nagainst the country's pattern. `place_id` and `confirmed_source` say how the address was entered; they\nare never part of signed or public passports.\n",
        "properties": {
          "city": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "confirmed_source": {
            "$ref": "#/components/schemas/AddressSource"
          },
          "country": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "extra_line": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "place_id": {
            "$ref": "#/components/schemas/GooglePlaceId"
          },
          "postal_code": {
            "maxLength": 20,
            "minLength": 1,
            "type": "string"
          },
          "region": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "street": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "street",
          "postal_code",
          "city",
          "country"
        ],
        "type": "object"
      },
      "AddressSource": {
        "description": "How the address was confirmed: typed by hand (`manual`), chosen from the lookup's suggestions\n(`autocomplete`, with `place_id`) or confirmed by the address validation (`validated`).\n",
        "enum": [
          "manual",
          "autocomplete",
          "validated"
        ],
        "type": "string"
      },
      "ApiKeyRef": {
        "description": "An organisation API key (ADR-017) that reported an event (source `api`) or staged an import (ADR-026).",
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "BaseRequirement": {
        "enum": [
          "required",
          "optional",
          "hidden",
          "later_required"
        ],
        "type": "string"
      },
      "Battery": {
        "properties": {
          "battery_model_id": {
            "format": "uuid",
            "type": "string"
          },
          "battery_status": {
            "$ref": "#/components/schemas/BatteryStatus"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "facility_id": {
            "format": "uuid",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "identifiers_locked_at": {
            "description": "Set when the identifiers were locked (pre-print) or first published; serial and model are fixed afterwards.",
            "format": "date-time",
            "type": "string"
          },
          "import_id": {
            "description": "The import that created the unit.",
            "format": "uuid",
            "type": "string"
          },
          "manufacturing_date": {
            "format": "date",
            "type": "string"
          },
          "model_version_id": {
            "format": "uuid",
            "type": "string"
          },
          "passport_status": {
            "$ref": "#/components/schemas/PassportStatus"
          },
          "predecessor_battery_id": {
            "description": "Second life: the unit this battery was repurposed, reused or remanufactured from.",
            "format": "uuid",
            "type": "string"
          },
          "putting_into_service": {
            "format": "date",
            "type": "string"
          },
          "row_version": {
            "$ref": "#/components/schemas/RowVersion"
          },
          "serial_number": {
            "type": "string"
          },
          "successor_battery_ids": {
            "description": "Second life: the units made from this battery.",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "battery_model_id",
          "model_version_id",
          "serial_number",
          "battery_status",
          "passport_status",
          "row_version",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "BatteryCategory": {
        "description": "Battery category per Regulation (EU) 2023/1542; drives registry requirements.",
        "enum": [
          "ev",
          "lmt",
          "industrial",
          "stationary",
          "industrial_without_bms"
        ],
        "type": "string"
      },
      "BatteryModel": {
        "properties": {
          "archived_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "category": {
            "$ref": "#/components/schemas/BatteryCategory"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "gtin": {
            "description": "GTIN-14 (normalised, check digit valid).",
            "nullable": true,
            "pattern": "^[0-9]{14}$",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "row_version": {
            "$ref": "#/components/schemas/RowVersion"
          },
          "sku": {
            "maxLength": 100,
            "nullable": true,
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "sku",
          "gtin",
          "category",
          "archived_at",
          "row_version",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "BatteryModelPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/BatteryModel"
            },
            "type": "array"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "BatteryPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Battery"
            },
            "type": "array"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "BatteryStatus": {
        "enum": [
          "original",
          "repurposed",
          "reused",
          "remanufactured",
          "waste"
        ],
        "type": "string"
      },
      "Change": {
        "description": "One change of the organisation's data, without values, actors or personal data: read the entity to\nget its current state.\n",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/ChangeAction"
          },
          "entity_id": {
            "format": "uuid",
            "type": "string"
          },
          "entity_type": {
            "$ref": "#/components/schemas/ChangeEntityType"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "occurred_at",
          "entity_type",
          "entity_id",
          "action"
        ],
        "type": "object"
      },
      "ChangeAction": {
        "description": "What changed (ADR-026): `battery.created` (a unit was created), `passport.published` (a unit's\nfirst passport version), `passport.republished` (a later version), `passport.withdrawn`,\n`model_version.approved`, `import.committed` (its units exist), `import.approved` (its values were\napproved), `lifecycle_event.recorded` (an event other than a condition update),\n`condition.updated` (measured condition data was accepted).\n",
        "enum": [
          "battery.created",
          "passport.published",
          "passport.republished",
          "passport.withdrawn",
          "model_version.approved",
          "import.committed",
          "import.approved",
          "lifecycle_event.recorded",
          "condition.updated"
        ],
        "type": "string"
      },
      "ChangeEntityType": {
        "description": "The resource to read after a change: `battery` (`getBattery`, `getPassport`, `listLifecycleEvents`,\n`getCondition`), `model_version` (`getModelVersion`) or `import` (`getImport`). Passport changes name\nthe unit.\n",
        "enum": [
          "battery",
          "model_version",
          "import"
        ],
        "type": "string"
      },
      "ChangePage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Change"
            },
            "type": "array"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "ColumnMapping": {
        "additionalProperties": false,
        "properties": {
          "auto": {
            "description": "Proposed by the server from the header.",
            "type": "boolean"
          },
          "column": {
            "description": "The 0-based column of the file.",
            "maximum": 199,
            "minimum": 0,
            "type": "integer"
          },
          "header": {
            "description": "The column's header (set by the server).",
            "type": "string"
          },
          "target": {
            "description": "A target of `listImportTargets`: a field key, `key[n].property` (list item n, 1-based),\n`key.property` (object property) or `model_version`. Empty or missing: the column is ignored.\n",
            "maxLength": 120,
            "type": "string"
          },
          "unit": {
            "description": "The unit the column's numbers are written in when it differs from the field's (e.g. `kWh` for a field in Wh).",
            "maxLength": 20,
            "type": "string"
          }
        },
        "required": [
          "column"
        ],
        "type": "object"
      },
      "Completeness": {
        "properties": {
          "category": {
            "$ref": "#/components/schemas/BatteryCategory"
          },
          "fields": {
            "description": "Visible fields in registry order (hidden fields are left out).",
            "items": {
              "$ref": "#/components/schemas/FieldCompleteness"
            },
            "type": "array"
          },
          "model_version": {
            "$ref": "#/components/schemas/CompletenessSummary"
          },
          "reference_date": {
            "description": "The placed-on-market date obligations were evaluated for.",
            "format": "date",
            "type": "string"
          },
          "registry": {
            "$ref": "#/components/schemas/RegistryRef"
          },
          "summary": {
            "$ref": "#/components/schemas/CompletenessSummary"
          },
          "target": {
            "$ref": "#/components/schemas/TargetRef"
          }
        },
        "required": [
          "target",
          "registry",
          "category",
          "summary",
          "fields"
        ],
        "type": "object"
      },
      "CompletenessSummary": {
        "properties": {
          "blocking": {
            "description": "Fields that count against publishing (required_missing + required_pending_review).",
            "type": "integer"
          },
          "counts": {
            "$ref": "#/components/schemas/StatusCounts"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "counts",
          "blocking",
          "total"
        ],
        "type": "object"
      },
      "Condition": {
        "properties": {
          "battery_id": {
            "format": "uuid",
            "type": "string"
          },
          "field_keys": {
            "description": "The dynamic fields visible for the unit, in registry order.",
            "items": {
              "$ref": "#/components/schemas/FieldKey"
            },
            "type": "array"
          },
          "republish": {
            "$ref": "#/components/schemas/ConditionRepublish"
          },
          "values": {
            "description": "Current values of these fields.",
            "items": {
              "$ref": "#/components/schemas/FieldValue"
            },
            "type": "array"
          }
        },
        "required": [
          "battery_id",
          "field_keys",
          "values",
          "republish"
        ],
        "type": "object"
      },
      "ConditionPublication": {
        "properties": {
          "blockers": {
            "items": {
              "$ref": "#/components/schemas/PublishBlocker"
            },
            "type": "array"
          },
          "outcome": {
            "description": "`published` / `unchanged`: published immediately (or nothing changed); `blocked`: the gate refused,\nthe passport is `update_needed`; `scheduled`: the daily job publishes it; `not_published`: the unit\nhas no published passport.\n",
            "enum": [
              "published",
              "unchanged",
              "blocked",
              "scheduled",
              "not_published"
            ],
            "type": "string"
          },
          "version": {
            "$ref": "#/components/schemas/PassportVersionSummary"
          }
        },
        "required": [
          "outcome"
        ],
        "type": "object"
      },
      "ConditionRepublish": {
        "description": "When accepted condition data reaches a published passport (ADR-016): `immediate` or `daily` (02:00 UTC).",
        "enum": [
          "immediate",
          "daily"
        ],
        "type": "string"
      },
      "ConditionSkip": {
        "properties": {
          "field_key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "reason": {
            "description": "`older_measurement`: the stored value was measured later; `unchanged`: same value and time.",
            "enum": [
              "older_measurement",
              "unchanged"
            ],
            "type": "string"
          }
        },
        "required": [
          "field_key",
          "reason"
        ],
        "type": "object"
      },
      "ConditionUpdate": {
        "additionalProperties": false,
        "properties": {
          "measured_at": {
            "description": "The measurement time of values without their own.",
            "format": "date-time",
            "type": "string"
          },
          "note": {
            "description": "Becomes the description of the lifecycle event.",
            "maxLength": 500,
            "type": "string"
          },
          "values": {
            "items": {
              "$ref": "#/components/schemas/ConditionValueInput"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "values"
        ],
        "type": "object"
      },
      "ConditionUpdateResult": {
        "properties": {
          "accepted": {
            "items": {
              "$ref": "#/components/schemas/FieldValue"
            },
            "type": "array"
          },
          "event": {
            "$ref": "#/components/schemas/LifecycleEvent"
          },
          "publication": {
            "$ref": "#/components/schemas/ConditionPublication"
          },
          "skipped": {
            "items": {
              "$ref": "#/components/schemas/ConditionSkip"
            },
            "type": "array"
          }
        },
        "required": [
          "accepted",
          "skipped",
          "publication"
        ],
        "type": "object"
      },
      "ConditionValueInput": {
        "additionalProperties": false,
        "properties": {
          "field_key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "measured_at": {
            "description": "When the value was measured; defaults to the update's `measured_at`.",
            "format": "date-time",
            "type": "string"
          },
          "value": {
            "description": "The value as JSON; null clears the field.",
            "nullable": true
          }
        },
        "required": [
          "field_key",
          "value"
        ],
        "type": "object"
      },
      "CountryCode": {
        "description": "ISO 3166-1 alpha-2 country code.",
        "pattern": "^[A-Z]{2}$",
        "type": "string"
      },
      "DisplayStatus": {
        "description": "Combined status shown to users (docs/domain-model.md §5).",
        "enum": [
          "required_missing",
          "required_pending_review",
          "ok",
          "not_applicable",
          "later_required",
          "optional_missing"
        ],
        "type": "string"
      },
      "EmailAddress": {
        "format": "email",
        "maxLength": 254,
        "minLength": 3,
        "type": "string"
      },
      "EventSource": {
        "description": "`manual` (a member), `supplier` (a service-partner link), `api` (an API key, M7), `system`.",
        "enum": [
          "manual",
          "supplier",
          "api",
          "system"
        ],
        "type": "string"
      },
      "Evidence": {
        "properties": {
          "access_tier": {
            "$ref": "#/components/schemas/Tier"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/EvidenceKind"
          },
          "mime": {
            "type": "string"
          },
          "revision": {
            "minimum": 1,
            "type": "integer"
          },
          "revisions": {
            "description": "All revisions of the document, newest first (getEvidence only).",
            "items": {
              "$ref": "#/components/schemas/EvidenceRef"
            },
            "type": "array"
          },
          "sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "source": {
            "$ref": "#/components/schemas/EvidenceSource"
          },
          "superseded": {
            "$ref": "#/components/schemas/EvidenceSupersession"
          },
          "supersedes": {
            "description": "The previous revision of this document.",
            "format": "uuid",
            "type": "string"
          },
          "supplier_request_id": {
            "format": "uuid",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "uploaded_by": {
            "$ref": "#/components/schemas/UserRef"
          },
          "usages": {
            "description": "Where the document is linked or used as a value (getEvidence only).",
            "items": {
              "$ref": "#/components/schemas/EvidenceUsage"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "filename",
          "mime",
          "size_bytes",
          "sha256",
          "revision",
          "access_tier",
          "source",
          "created_at"
        ],
        "type": "object"
      },
      "EvidenceKind": {
        "enum": [
          "declaration_of_conformity",
          "test_report",
          "dismantling_manual",
          "safety_instructions",
          "datasheet",
          "diagnostic_report",
          "study",
          "image",
          "other"
        ],
        "type": "string"
      },
      "EvidenceLink": {
        "properties": {
          "declared_value": {
            "description": "The value the document states for the field, if recorded.",
            "nullable": true
          },
          "evidence": {
            "$ref": "#/components/schemas/EvidenceRef"
          },
          "field_key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "linked_at": {
            "format": "date-time",
            "type": "string"
          },
          "linked_by": {
            "$ref": "#/components/schemas/UserRef"
          }
        },
        "required": [
          "id",
          "field_key",
          "evidence",
          "linked_at"
        ],
        "type": "object"
      },
      "EvidencePage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Evidence"
            },
            "type": "array"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "EvidenceRef": {
        "properties": {
          "access_tier": {
            "$ref": "#/components/schemas/Tier"
          },
          "filename": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/EvidenceKind"
          },
          "revision": {
            "minimum": 1,
            "type": "integer"
          },
          "superseded": {
            "type": "boolean"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "filename",
          "access_tier",
          "revision",
          "superseded"
        ],
        "type": "object"
      },
      "EvidenceSource": {
        "enum": [
          "manual",
          "supplier"
        ],
        "type": "string"
      },
      "EvidenceSupersession": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "by": {
            "$ref": "#/components/schemas/UserRef"
          },
          "reason": {
            "type": "string"
          },
          "replaced_by": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "at",
          "reason"
        ],
        "type": "object"
      },
      "EvidenceUsage": {
        "properties": {
          "declared_value": {
            "description": "The value the document states (links only).",
            "nullable": true
          },
          "field_key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "target": {
            "$ref": "#/components/schemas/TargetRef"
          },
          "target_label": {
            "description": "Model name and version label, or the unit's serial number.",
            "type": "string"
          },
          "via": {
            "description": "`link`: an evidence link; `value`: the current value of a `file` field is this document.",
            "enum": [
              "link",
              "value"
            ],
            "type": "string"
          }
        },
        "required": [
          "target",
          "target_label",
          "field_key",
          "via"
        ],
        "type": "object"
      },
      "ExportSummary": {
        "description": "What a full organisation export contains.",
        "properties": {
          "bytes": {
            "description": "Size of the ZIP.",
            "format": "int64",
            "type": "integer"
          },
          "files": {
            "description": "Evidence files in the ZIP.",
            "type": "integer"
          },
          "format": {
            "description": "`batterypass.org-export/1`",
            "type": "string"
          },
          "records": {
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Records per entity file, e.g. `{\"batteries\": 417}`.",
            "type": "object"
          }
        },
        "required": [
          "format",
          "records",
          "files",
          "bytes"
        ],
        "type": "object"
      },
      "Facility": {
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "gln": {
            "$ref": "#/components/schemas/Gln"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "row_version": {
            "$ref": "#/components/schemas/RowVersion"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "address",
          "row_version",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "FacilityPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Facility"
            },
            "type": "array"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "FieldCompleteness": {
        "properties": {
          "applies_from": {
            "format": "date",
            "type": "string"
          },
          "display": {
            "$ref": "#/components/schemas/DisplayStatus"
          },
          "field_key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "not_applicable_reason": {
            "type": "string"
          },
          "reason": {
            "$ref": "#/components/schemas/RequirementReason"
          },
          "requirement": {
            "$ref": "#/components/schemas/RequirementStatus"
          },
          "section": {
            "type": "string"
          },
          "trigger": {
            "$ref": "#/components/schemas/LabelText"
          },
          "value_status": {
            "$ref": "#/components/schemas/ValueStatus"
          }
        },
        "required": [
          "field_key",
          "section",
          "requirement",
          "reason",
          "display",
          "value_status"
        ],
        "type": "object"
      },
      "FieldError": {
        "properties": {
          "code": {
            "description": "Stable reason code, e.g. `required`, `too_long`, `invalid_format`, `invalid_check_digit`.",
            "type": "string"
          },
          "field": {
            "description": "Name of the offending body field (dotted for nested fields, e.g. `address.country`) or parameter, e.g. `gtin` or `limit`; `body` when the body as a whole is invalid.",
            "type": "string"
          },
          "message": {
            "description": "Human-readable explanation (English); clients localise by `code`.",
            "type": "string"
          }
        },
        "required": [
          "field",
          "code",
          "message"
        ],
        "type": "object"
      },
      "FieldExport": {
        "properties": {
          "batterypass_v2": {
            "type": "string"
          },
          "csv": {
            "type": "string"
          },
          "csv_aliases": {
            "description": "Further spreadsheet headers the importer maps to the field.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "FieldKey": {
        "maxLength": 100,
        "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$",
        "type": "string"
      },
      "FieldLevel": {
        "enum": [
          "model",
          "unit"
        ],
        "type": "string"
      },
      "FieldRequirement": {
        "properties": {
          "applies_from": {
            "format": "date",
            "type": "string"
          },
          "base": {
            "$ref": "#/components/schemas/BaseRequirement"
          },
          "condition": {
            "$ref": "#/components/schemas/LabelText"
          },
          "conditional": {
            "type": "boolean"
          },
          "trigger": {
            "$ref": "#/components/schemas/LabelText"
          }
        },
        "required": [
          "base",
          "conditional"
        ],
        "type": "object"
      },
      "FieldValue": {
        "properties": {
          "checks": {
            "items": {
              "$ref": "#/components/schemas/ValueCheck"
            },
            "type": "array"
          },
          "evidence": {
            "description": "Documents this revision rests on (set on approved revisions and supplier submissions).",
            "items": {
              "$ref": "#/components/schemas/EvidenceRef"
            },
            "type": "array"
          },
          "field_key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "measured_at": {
            "description": "When a measured value (condition data, ADR-016) was measured.",
            "format": "date-time",
            "type": "string"
          },
          "recorded_at": {
            "format": "date-time",
            "type": "string"
          },
          "recorded_by": {
            "$ref": "#/components/schemas/UserRef"
          },
          "registry_version": {
            "type": "string"
          },
          "responsible": {
            "$ref": "#/components/schemas/UserRef"
          },
          "review_note": {
            "type": "string"
          },
          "review_status": {
            "$ref": "#/components/schemas/ReviewStatus"
          },
          "reviewed_at": {
            "format": "date-time",
            "type": "string"
          },
          "reviewed_by": {
            "$ref": "#/components/schemas/UserRef"
          },
          "revision": {
            "minimum": 1,
            "type": "integer"
          },
          "source": {
            "$ref": "#/components/schemas/ValueSource"
          },
          "superseded_at": {
            "format": "date-time",
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "value": {
            "description": "The value as JSON; null when the field was cleared.",
            "nullable": true
          }
        },
        "required": [
          "field_key",
          "value",
          "revision",
          "source",
          "review_status",
          "recorded_at",
          "registry_version",
          "checks"
        ],
        "type": "object"
      },
      "FieldValueHistory": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FieldValue"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "FieldValueList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/FieldValue"
            },
            "type": "array"
          },
          "links": {
            "description": "Active evidence links of the target, per field.",
            "items": {
              "$ref": "#/components/schemas/EvidenceLink"
            },
            "type": "array"
          },
          "registry": {
            "$ref": "#/components/schemas/RegistryRef"
          },
          "target": {
            "$ref": "#/components/schemas/TargetRef"
          }
        },
        "required": [
          "target",
          "registry",
          "items",
          "links"
        ],
        "type": "object"
      },
      "Gln": {
        "description": "GS1 Global Location Number, 13 digits with a valid check digit.",
        "pattern": "^[0-9]{13}$",
        "type": "string"
      },
      "GooglePlaceId": {
        "description": "The Google place ID of an address chosen from the lookup.",
        "maxLength": 300,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]+$",
        "type": "string"
      },
      "Import": {
        "description": "Either `created_by` (a member uploaded the file) or `created_by_api_key` (an integration staged\nit with an API key of scope `import`, ADR-026) is set.\n",
        "properties": {
          "approved_at": {
            "format": "date-time",
            "type": "string"
          },
          "approved_by": {
            "format": "uuid",
            "type": "string"
          },
          "committed_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "$ref": "#/components/schemas/UserRef"
          },
          "created_by_api_key": {
            "$ref": "#/components/schemas/ApiKeyRef"
          },
          "filename": {
            "type": "string"
          },
          "format": {
            "$ref": "#/components/schemas/ImportFormat"
          },
          "headers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "mapping": {
            "items": {
              "$ref": "#/components/schemas/ColumnMapping"
            },
            "type": "array"
          },
          "options": {
            "$ref": "#/components/schemas/ImportOptions"
          },
          "preset": {
            "$ref": "#/components/schemas/ImportPresetId"
          },
          "row_count": {
            "description": "Data rows (empty rows are left out).",
            "type": "integer"
          },
          "row_version": {
            "$ref": "#/components/schemas/RowVersion"
          },
          "sample_rows": {
            "description": "The first data rows of the file as read (at most 5), to show example values while mapping.",
            "items": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "array"
          },
          "sheet": {
            "description": "The XLSX worksheet that was read.",
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/ImportStatus"
          },
          "summary": {
            "$ref": "#/components/schemas/ImportSummary"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "validated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "filename",
          "format",
          "size_bytes",
          "row_count",
          "headers",
          "sample_rows",
          "mapping",
          "options",
          "created_at",
          "updated_at",
          "row_version"
        ],
        "type": "object"
      },
      "ImportApprovalReasons": {
        "description": "Imported values left for individual review, by reason.",
        "properties": {
          "checks_failed": {
            "type": "integer"
          },
          "conflict": {
            "type": "integer"
          },
          "evidence_required": {
            "type": "integer"
          },
          "four_eyes": {
            "type": "integer"
          },
          "import_warning": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ImportApprovalSummary": {
        "properties": {
          "approved": {
            "type": "integer"
          },
          "not_approved": {
            "type": "integer"
          },
          "reasons": {
            "$ref": "#/components/schemas/ImportApprovalReasons"
          },
          "units": {
            "type": "integer"
          }
        },
        "required": [
          "units",
          "approved",
          "not_approved",
          "reasons"
        ],
        "type": "object"
      },
      "ImportFormat": {
        "enum": [
          "csv",
          "xlsx"
        ],
        "type": "string"
      },
      "ImportMappingUpdate": {
        "additionalProperties": false,
        "description": "Either `mapping` or `preset`; a preset maps the columns it knows by their headers.",
        "properties": {
          "mapping": {
            "items": {
              "$ref": "#/components/schemas/ColumnMapping"
            },
            "maxItems": 200,
            "type": "array"
          },
          "options": {
            "$ref": "#/components/schemas/ImportOptions"
          },
          "preset": {
            "$ref": "#/components/schemas/ImportPresetId"
          }
        },
        "type": "object"
      },
      "ImportOptions": {
        "additionalProperties": false,
        "properties": {
          "battery_model_id": {
            "description": "The model of rows without a model column.",
            "format": "uuid",
            "type": "string"
          },
          "facility_id": {
            "description": "The place of manufacture of rows without one.",
            "format": "uuid",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ImportPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Import"
            },
            "type": "array"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "ImportPresetId": {
        "description": "An import preset of the ERP registry (`getErpRegistry`, ADR-026): which column header of an ERP\nexport maps to which registry field.\n",
        "maxLength": 60,
        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
        "type": "string"
      },
      "ImportStatus": {
        "description": "`uploaded` (mapping can change) → `validating` → `validated` → `committing` → `committed`;\n`failed` when the file could not be validated (validate again). A changed mapping sends a\nvalidated import back to `uploaded`.\n",
        "enum": [
          "uploaded",
          "validating",
          "validated",
          "committing",
          "committed",
          "failed"
        ],
        "type": "string"
      },
      "ImportSummary": {
        "properties": {
          "approved": {
            "description": "Imported values approved by import approvals.",
            "type": "integer"
          },
          "created": {
            "description": "Units the commit created.",
            "type": "integer"
          },
          "duplicates": {
            "description": "Rows whose serial number repeats an earlier row or an existing unit; not imported.",
            "type": "integer"
          },
          "errors": {
            "description": "Rows with errors; not imported.",
            "type": "integer"
          },
          "not_approved": {
            "description": "Imported values the last approval left for individual review.",
            "type": "integer"
          },
          "rows": {
            "type": "integer"
          },
          "valid": {
            "description": "Rows without messages.",
            "type": "integer"
          },
          "warnings": {
            "description": "Rows with warnings only; they are imported.",
            "type": "integer"
          }
        },
        "required": [
          "rows",
          "valid",
          "warnings",
          "errors",
          "duplicates",
          "created",
          "approved",
          "not_approved"
        ],
        "type": "object"
      },
      "ImportUpload": {
        "properties": {
          "file": {
            "format": "binary",
            "type": "string"
          },
          "preset": {
            "$ref": "#/components/schemas/ImportPresetId"
          },
          "sheet": {
            "description": "The XLSX worksheet to read (the first one when omitted).",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "type": "object"
      },
      "JSONDocument": {
        "additionalProperties": true,
        "description": "A JSON document whose shape is described elsewhere (snapshot, BatteryPass v2.0 export).",
        "type": "object"
      },
      "Job": {
        "description": "`created_by` names the member who started the job, `created_by_api_key` the API key that started an\nimport validation (ADR-026); a job without either was started by the system (the registry\nre-evaluation).\n",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "$ref": "#/components/schemas/UserRef"
          },
          "created_by_api_key": {
            "$ref": "#/components/schemas/ApiKeyRef"
          },
          "error_code": {
            "$ref": "#/components/schemas/JobErrorCode"
          },
          "file": {
            "$ref": "#/components/schemas/JobFile"
          },
          "finished_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "import_id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/JobKind"
          },
          "progress": {
            "$ref": "#/components/schemas/JobProgress"
          },
          "result": {
            "$ref": "#/components/schemas/JobResult"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "progress",
          "created_at"
        ],
        "type": "object"
      },
      "JobErrorCode": {
        "description": "Why a job failed (`forbidden`: the member who started it lost the role or left).",
        "enum": [
          "forbidden",
          "not_found",
          "conflict",
          "invalid",
          "internal_error"
        ],
        "type": "string"
      },
      "JobFile": {
        "properties": {
          "content_type": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "filename",
          "content_type",
          "size",
          "expires_at"
        ],
        "type": "object"
      },
      "JobKind": {
        "enum": [
          "import_validate",
          "import_commit",
          "import_approve",
          "bulk_publish",
          "qr_export",
          "registry_reevaluate",
          "org_export"
        ],
        "type": "string"
      },
      "JobOutcomeCounts": {
        "properties": {
          "blocked": {
            "type": "integer"
          },
          "exported": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "published": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "unchanged": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "JobProgress": {
        "properties": {
          "done": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": [
          "done",
          "total"
        ],
        "type": "object"
      },
      "JobResult": {
        "description": "The summary of a finished job; which members are set depends on the kind.",
        "properties": {
          "approval": {
            "$ref": "#/components/schemas/ImportApprovalSummary"
          },
          "detail": {
            "description": "Why a failed job failed (English).",
            "type": "string"
          },
          "export": {
            "$ref": "#/components/schemas/ExportSummary"
          },
          "import_summary": {
            "$ref": "#/components/schemas/ImportSummary"
          },
          "outcomes": {
            "$ref": "#/components/schemas/JobOutcomeCounts"
          },
          "reevaluation": {
            "$ref": "#/components/schemas/ReevaluationSummary"
          },
          "units": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "JobStatus": {
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed"
        ],
        "type": "string"
      },
      "LabelText": {
        "description": "Text in German and English (ADR-010); clients pick the locale.",
        "properties": {
          "de": {
            "type": "string"
          },
          "en": {
            "type": "string"
          }
        },
        "required": [
          "de",
          "en"
        ],
        "type": "object"
      },
      "LifecycleEvent": {
        "properties": {
          "api_key": {
            "$ref": "#/components/schemas/ApiKeyRef"
          },
          "battery_id": {
            "format": "uuid",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "evidence": {
            "items": {
              "$ref": "#/components/schemas/EvidenceRef"
            },
            "type": "array"
          },
          "field_keys": {
            "description": "The condition fields this event updated.",
            "items": {
              "$ref": "#/components/schemas/FieldKey"
            },
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "occurred_on": {
            "format": "date",
            "type": "string"
          },
          "partner": {
            "$ref": "#/components/schemas/ServicePartnerRef"
          },
          "related_battery_id": {
            "description": "Second life: the successor (on the predecessor's event) or the predecessor (on the successor's).",
            "format": "uuid",
            "type": "string"
          },
          "related_serial_number": {
            "type": "string"
          },
          "reported_by": {
            "$ref": "#/components/schemas/UserRef"
          },
          "source": {
            "$ref": "#/components/schemas/EventSource"
          },
          "type": {
            "$ref": "#/components/schemas/LifecycleEventType"
          }
        },
        "required": [
          "id",
          "battery_id",
          "type",
          "occurred_on",
          "source",
          "field_keys",
          "evidence",
          "created_at"
        ],
        "type": "object"
      },
      "LifecycleEventCreate": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "maxLength": 2000,
            "type": "string"
          },
          "evidence_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 20,
            "type": "array",
            "uniqueItems": true
          },
          "occurred_on": {
            "format": "date",
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/ReportedEventType"
          }
        },
        "required": [
          "type",
          "occurred_on"
        ],
        "type": "object"
      },
      "LifecycleEventPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/LifecycleEvent"
            },
            "type": "array"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "LifecycleEventType": {
        "description": "What happened to a unit. `condition_update` is recorded by condition updates, `repurposed`, `reused`\nand `remanufactured` by `createSecondLifeBattery`; the others are reported.\n",
        "enum": [
          "placed_on_market",
          "put_into_service",
          "inspection",
          "repair",
          "component_replaced",
          "condition_update",
          "repurposed",
          "reused",
          "remanufactured",
          "waste",
          "recycled",
          "custom"
        ],
        "type": "string"
      },
      "Locale": {
        "description": "Preferred language for emails and the portal.",
        "enum": [
          "de",
          "en"
        ],
        "type": "string"
      },
      "ModelVersion": {
        "properties": {
          "approved_at": {
            "format": "date-time",
            "type": "string"
          },
          "approved_by_name": {
            "type": "string"
          },
          "battery_model_id": {
            "format": "uuid",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "effective_from": {
            "format": "date",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "registry_version": {
            "description": "Registry version of the last evaluation after a change.",
            "type": "string"
          },
          "row_version": {
            "$ref": "#/components/schemas/RowVersion"
          },
          "status": {
            "$ref": "#/components/schemas/ModelVersionStatus"
          },
          "unit_count": {
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version_label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "battery_model_id",
          "version_label",
          "effective_from",
          "status",
          "unit_count",
          "row_version",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ModelVersionList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ModelVersion"
            },
            "maxItems": 200,
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "ModelVersionStatus": {
        "enum": [
          "draft",
          "approved",
          "superseded"
        ],
        "type": "string"
      },
      "NextCursor": {
        "description": "Cursor for the next page, or null when this is the last page.",
        "nullable": true,
        "type": "string"
      },
      "Passport": {
        "description": "The passport of one unit (one per unit, ADR-002).",
        "properties": {
          "battery_id": {
            "format": "uuid",
            "type": "string"
          },
          "current_version": {
            "$ref": "#/components/schemas/PassportVersionSummary"
          },
          "first_published_at": {
            "format": "date-time",
            "type": "string"
          },
          "gs1_digital_link": {
            "description": "`{RESOLVER_BASE_URL}/01/{gtin}/21/{serial}`; fixed once the identifiers are locked, a preview before.",
            "type": "string"
          },
          "gtin": {
            "description": "The model's GTIN-14.",
            "type": "string"
          },
          "identifiers_locked_at": {
            "format": "date-time",
            "type": "string"
          },
          "passport_id": {
            "description": "Permanent passport identifier `urn:dpp:{uuid}`, assigned when the identifiers are locked or at the first publication.",
            "type": "string"
          },
          "public_url": {
            "description": "The public passport page, once published.",
            "type": "string"
          },
          "row_version": {
            "$ref": "#/components/schemas/RowVersion"
          },
          "serial_number": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PassportStatus"
          },
          "withdrawn_at": {
            "format": "date-time",
            "type": "string"
          },
          "withdrawn_reason": {
            "type": "string"
          }
        },
        "required": [
          "battery_id",
          "status",
          "serial_number"
        ],
        "type": "object"
      },
      "PassportCategory": {
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "$ref": "#/components/schemas/LabelText"
          }
        },
        "required": [
          "key",
          "label"
        ],
        "type": "object"
      },
      "PassportDiff": {
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/PassportFieldChange"
            },
            "type": "array"
          },
          "from_version_no": {
            "description": "Absent when there is nothing to compare with (the first publication).",
            "type": "integer"
          },
          "metadata": {
            "items": {
              "$ref": "#/components/schemas/PassportMetaChange"
            },
            "type": "array"
          },
          "to": {
            "enum": [
              "version",
              "preview"
            ],
            "type": "string"
          },
          "to_version_no": {
            "description": "Absent in a publish preview.",
            "type": "integer"
          }
        },
        "required": [
          "to",
          "fields",
          "metadata"
        ],
        "type": "object"
      },
      "PassportDiffValue": {
        "properties": {
          "documents": {
            "description": "Titles of the documents the value is or rests on.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "measured_at": {
            "format": "date-time",
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "source": {
            "$ref": "#/components/schemas/ValueSource"
          },
          "status": {
            "enum": [
              "provided",
              "later_required",
              "not_applicable"
            ],
            "type": "string"
          },
          "tier": {
            "$ref": "#/components/schemas/Tier"
          },
          "unit": {
            "type": "string"
          },
          "value": {
            "description": "The approved value (JSON)."
          }
        },
        "required": [
          "status",
          "tier"
        ],
        "type": "object"
      },
      "PassportDocument": {
        "description": "A passport version projected to an access tier. The `public` projection is stored and signed at\npublication (ADR-013); verify it by canonicalising this object with RFC 8785 (JCS), hashing it with\nSHA-256 and checking the Ed25519 signature.\n",
        "properties": {
          "category": {
            "$ref": "#/components/schemas/PassportCategory"
          },
          "economic_operator": {
            "$ref": "#/components/schemas/PublicProfile"
          },
          "gs1_digital_link": {
            "type": "string"
          },
          "gtin": {
            "type": "string"
          },
          "model_name": {
            "description": "The name of the battery model (the product name), for headings.",
            "type": "string"
          },
          "passport_id": {
            "description": "Absent only in a preview of a passport that has no identifier yet.",
            "type": "string"
          },
          "predecessor_passport_id": {
            "description": "Second life: the passport identifier of the battery this one was repurposed, reused or remanufactured from.",
            "type": "string"
          },
          "restricted_fields_present": {
            "description": "Keys of fields with a value above this tier. Keys only, never values.",
            "items": {
              "$ref": "#/components/schemas/FieldKey"
            },
            "type": "array"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/PassportSection"
            },
            "type": "array"
          },
          "serial_number": {
            "type": "string"
          },
          "tier": {
            "$ref": "#/components/schemas/PassportTier"
          },
          "version": {
            "$ref": "#/components/schemas/PassportDocumentVersion"
          }
        },
        "required": [
          "gtin",
          "serial_number",
          "gs1_digital_link",
          "model_name",
          "tier",
          "version",
          "category",
          "sections",
          "restricted_fields_present"
        ],
        "type": "object"
      },
      "PassportDocumentRef": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/EvidenceKind"
          },
          "mime": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "size_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "description": "Public download link; only documents of the `public` tier have one.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "title",
          "kind",
          "mime",
          "size_bytes",
          "sha256"
        ],
        "type": "object"
      },
      "PassportDocumentVersion": {
        "properties": {
          "no": {
            "minimum": 1,
            "type": "integer"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "registry_version": {
            "type": "string"
          }
        },
        "required": [
          "no",
          "published_at",
          "registry_version"
        ],
        "type": "object"
      },
      "PassportField": {
        "properties": {
          "documents": {
            "items": {
              "$ref": "#/components/schemas/PassportDocumentRef"
            },
            "type": "array"
          },
          "key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "label": {
            "$ref": "#/components/schemas/LabelText"
          },
          "legal": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Legal references from the registry (`annex_xiii`, `article`, …).",
            "type": "object"
          },
          "level": {
            "enum": [
              "model",
              "unit"
            ],
            "type": "string"
          },
          "schema": {
            "$ref": "#/components/schemas/ValueSchema"
          },
          "status": {
            "description": "`provided` (approved value), `later_required` (an obligation that starts later), `not_applicable`.",
            "enum": [
              "provided",
              "later_required",
              "not_applicable"
            ],
            "type": "string"
          },
          "tier": {
            "$ref": "#/components/schemas/Tier"
          },
          "trigger": {
            "$ref": "#/components/schemas/LabelText"
          },
          "unit": {
            "type": "string"
          },
          "value": {
            "description": "The approved value (JSON); for `file` fields an evidence id described in `documents`."
          }
        },
        "required": [
          "key",
          "label",
          "tier",
          "level",
          "status"
        ],
        "type": "object"
      },
      "PassportFieldChange": {
        "properties": {
          "after": {
            "$ref": "#/components/schemas/PassportDiffValue"
          },
          "before": {
            "$ref": "#/components/schemas/PassportDiffValue"
          },
          "change": {
            "description": "`provenance`: same value, a newer revision (re-approved, re-measured).",
            "enum": [
              "added",
              "removed",
              "changed",
              "provenance"
            ],
            "type": "string"
          },
          "key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "level": {
            "enum": [
              "model",
              "unit"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "level",
          "change"
        ],
        "type": "object"
      },
      "PassportMetaChange": {
        "properties": {
          "after": {
            "type": "string"
          },
          "before": {
            "type": "string"
          },
          "key": {
            "enum": [
              "model_version",
              "registry_version",
              "category",
              "facility",
              "operator",
              "predecessor"
            ],
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "type": "object"
      },
      "PassportSection": {
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/PassportField"
            },
            "type": "array"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "$ref": "#/components/schemas/LabelText"
          }
        },
        "required": [
          "key",
          "label",
          "fields"
        ],
        "type": "object"
      },
      "PassportSignature": {
        "properties": {
          "algorithm": {
            "enum": [
              "Ed25519"
            ],
            "type": "string"
          },
          "canonicalization": {
            "enum": [
              "RFC8785"
            ],
            "type": "string"
          },
          "hash": {
            "description": "`sha256:\u003chex\u003e` of the canonical `document`.",
            "type": "string"
          },
          "key_id": {
            "type": "string"
          },
          "keys_url": {
            "type": "string"
          },
          "signature": {
            "description": "Ed25519 signature of the canonical `document` bytes (base64url, no padding).",
            "type": "string"
          },
          "signed_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "algorithm",
          "canonicalization",
          "hash",
          "signature",
          "key_id",
          "signed_at",
          "keys_url"
        ],
        "type": "object"
      },
      "PassportStatus": {
        "description": "Status of a unit's passport (`docs/domain-model.md` §7).",
        "enum": [
          "draft",
          "qr_locked",
          "published",
          "update_needed",
          "suspended",
          "withdrawn",
          "deleted_recycled"
        ],
        "type": "string"
      },
      "PassportTier": {
        "description": "The access tier a passport document is projected to; each includes the tiers before it.",
        "enum": [
          "public",
          "legitimate_interest",
          "authority"
        ],
        "type": "string"
      },
      "PassportVerification": {
        "properties": {
          "checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "key_id": {
            "type": "string"
          },
          "public_document_valid": {
            "type": "boolean"
          },
          "signed_at": {
            "format": "date-time",
            "type": "string"
          },
          "snapshot_valid": {
            "type": "boolean"
          },
          "valid": {
            "description": "Both signatures verify and both hashes match the stored documents.",
            "type": "boolean"
          },
          "version_no": {
            "type": "integer"
          }
        },
        "required": [
          "valid",
          "version_no",
          "key_id",
          "public_document_valid",
          "snapshot_valid",
          "signed_at",
          "checked_at"
        ],
        "type": "object"
      },
      "PassportVersion": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PassportVersionSummary"
          },
          {
            "properties": {
              "batterypass_v2": {
                "$ref": "#/components/schemas/SchemaReport"
              },
              "public_document": {
                "$ref": "#/components/schemas/PassportDocument"
              },
              "public_signature": {
                "description": "Ed25519 signature of the canonical public document bytes (base64url, no padding).",
                "type": "string"
              },
              "registry_hash": {
                "type": "string"
              },
              "signature": {
                "description": "Ed25519 signature of the canonical snapshot bytes (base64url, no padding).",
                "type": "string"
              },
              "snapshot": {
                "$ref": "#/components/schemas/JSONDocument"
              }
            },
            "required": [
              "registry_hash",
              "signature",
              "public_signature",
              "snapshot",
              "public_document",
              "batterypass_v2"
            ],
            "type": "object"
          }
        ]
      },
      "PassportVersionPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PassportVersionSummary"
            },
            "type": "array"
          },
          "next_cursor": {
            "$ref": "#/components/schemas/NextCursor"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "PassportVersionSummary": {
        "properties": {
          "batterypass_v2_issue_count": {
            "type": "integer"
          },
          "batterypass_v2_valid": {
            "description": "Whether the BatteryPass v2.0 export passed its schema (advisory, ADR-012).",
            "type": "boolean"
          },
          "canonical_hash": {
            "description": "`sha256:\u003chex\u003e` of the JCS-canonical snapshot (ADR-004).",
            "type": "string"
          },
          "key_id": {
            "type": "string"
          },
          "public_hash": {
            "description": "`sha256:\u003chex\u003e` of the JCS-canonical public document (ADR-013).",
            "type": "string"
          },
          "published_at": {
            "format": "date-time",
            "type": "string"
          },
          "published_by": {
            "format": "uuid",
            "type": "string"
          },
          "published_by_name": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "registry_version": {
            "type": "string"
          },
          "valid_until": {
            "description": "When a later version replaced this one.",
            "format": "date-time",
            "type": "string"
          },
          "version_no": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "version_no",
          "published_at",
          "reason",
          "registry_version",
          "canonical_hash",
          "public_hash",
          "key_id",
          "batterypass_v2_valid",
          "batterypass_v2_issue_count"
        ],
        "type": "object"
      },
      "Problem": {
        "description": "RFC 9457 Problem Details with a stable application `code`.",
        "properties": {
          "blockers": {
            "description": "For `publish_blocked`, everything that prevents publication.",
            "items": {
              "$ref": "#/components/schemas/PublishBlocker"
            },
            "type": "array"
          },
          "code": {
            "$ref": "#/components/schemas/ProblemCode"
          },
          "detail": {
            "description": "Human-readable explanation specific to this occurrence (English).",
            "type": "string"
          },
          "errors": {
            "description": "Field-level details for `validation_error`, and for `conflict` when a value must be unique.",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            },
            "type": "array"
          },
          "instance": {
            "description": "URI reference of the request that caused the problem.",
            "type": "string"
          },
          "request_id": {
            "description": "Request id, also returned in the `X-Request-Id` header.",
            "type": "string"
          },
          "status": {
            "maximum": 599,
            "minimum": 100,
            "type": "integer"
          },
          "title": {
            "description": "Short summary; for `about:blank` the HTTP status phrase.",
            "type": "string"
          },
          "type": {
            "description": "Problem type URI reference; `about:blank` unless a specific type is documented.",
            "example": "about:blank",
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code"
        ],
        "type": "object"
      },
      "ProblemCode": {
        "description": "Stable, machine-readable problem code (`docs/api-design.md` §1).",
        "enum": [
          "validation_error",
          "invalid_token",
          "unauthenticated",
          "invalid_credentials",
          "forbidden",
          "email_not_verified",
          "not_found",
          "method_not_allowed",
          "conflict",
          "identifiers_locked",
          "payload_too_large",
          "publish_blocked",
          "rate_limited",
          "request_closed",
          "internal_error",
          "address_lookup_unavailable"
        ],
        "type": "string"
      },
      "PublicPassport": {
        "description": "The public passport JSON. `document` is the signed public projection (ADR-013); the other members\ncan change over the passport's life and are not signed.\n",
        "properties": {
          "document": {
            "$ref": "#/components/schemas/PassportDocument"
          },
          "links": {
            "$ref": "#/components/schemas/PublicPassportLinks"
          },
          "passport_id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/PassportStatus"
          },
          "valid_until": {
            "description": "Set when this version was replaced by a later one (history by date).",
            "format": "date-time",
            "type": "string"
          },
          "verification": {
            "$ref": "#/components/schemas/PassportSignature"
          }
        },
        "required": [
          "passport_id",
          "status",
          "links"
        ],
        "type": "object"
      },
      "PublicPassportLinks": {
        "properties": {
          "gs1_digital_link": {
            "type": "string"
          },
          "json": {
            "type": "string"
          },
          "keys": {
            "type": "string"
          },
          "page": {
            "type": "string"
          },
          "predecessor": {
            "description": "Second life: the public JSON of the passport of the battery this one was made from.",
            "type": "string"
          },
          "restricted": {
            "description": "The page where authorised parties sign in to read restricted tiers; only while the portal is enabled (ADR-018).",
            "type": "string"
          },
          "successors": {
            "description": "Second life: the public JSON of the passports of batteries made from this one.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "page",
          "json",
          "keys"
        ],
        "type": "object"
      },
      "PublicProfile": {
        "additionalProperties": false,
        "description": "The economic operator as shown on public passports. Every property is optional; publishing (M4) requires a complete profile.",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "contact_person": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "spare_parts_contact": {
            "description": "Where to obtain spare parts (email, phone or URL).",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "support_email": {
            "$ref": "#/components/schemas/EmailAddress"
          },
          "website": {
            "description": "Absolute http or https URL.",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      },
      "PublishBlocker": {
        "properties": {
          "check_key": {
            "type": "string"
          },
          "code": {
            "$ref": "#/components/schemas/PublishBlockerCode"
          },
          "field_key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "target": {
            "$ref": "#/components/schemas/TargetRef"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "PublishBlockerCode": {
        "description": "Why a unit cannot be published yet; the client localises by code.",
        "enum": [
          "organization_identifier_missing",
          "public_profile_incomplete",
          "model_version_not_approved",
          "gtin_missing",
          "required_missing",
          "pending_review",
          "check_failed",
          "invalid_value",
          "manufacturing_date_in_future",
          "identifier_in_use",
          "passport_withdrawn"
        ],
        "type": "string"
      },
      "ReevaluationSummary": {
        "properties": {
          "checked": {
            "type": "integer"
          },
          "registry_version": {
            "type": "string"
          },
          "update_needed": {
            "type": "integer"
          }
        },
        "required": [
          "checked",
          "update_needed"
        ],
        "type": "object"
      },
      "RegistryCategory": {
        "properties": {
          "key": {
            "$ref": "#/components/schemas/BatteryCategory"
          },
          "label": {
            "$ref": "#/components/schemas/LabelText"
          }
        },
        "required": [
          "key",
          "label"
        ],
        "type": "object"
      },
      "RegistryCheck": {
        "properties": {
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldKey"
            },
            "type": "array"
          },
          "key": {
            "type": "string"
          },
          "level": {
            "$ref": "#/components/schemas/FieldLevel"
          },
          "message": {
            "$ref": "#/components/schemas/LabelText"
          },
          "severity": {
            "enum": [
              "fail",
              "warn"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "level",
          "severity",
          "fields",
          "message"
        ],
        "type": "object"
      },
      "RegistryField": {
        "description": "`schema` is always present (optional only because the schema type is recursive).",
        "properties": {
          "column": {
            "type": "string"
          },
          "evidence_required": {
            "type": "boolean"
          },
          "export": {
            "$ref": "#/components/schemas/FieldExport"
          },
          "help": {
            "$ref": "#/components/schemas/LabelText"
          },
          "key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "label": {
            "$ref": "#/components/schemas/LabelText"
          },
          "legal": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "level": {
            "$ref": "#/components/schemas/FieldLevel"
          },
          "requirement": {
            "$ref": "#/components/schemas/FieldRequirement"
          },
          "schema": {
            "$ref": "#/components/schemas/ValueSchema"
          },
          "storage": {
            "description": "`column` fields live on the model or unit itself and are edited there.",
            "enum": [
              "value",
              "column"
            ],
            "type": "string"
          },
          "tier": {
            "$ref": "#/components/schemas/Tier"
          },
          "type": {
            "$ref": "#/components/schemas/ValueType"
          },
          "unit": {
            "type": "string"
          },
          "verification": {
            "description": "Outcome of the registry verification (docs/registry/verification-log.md); `added` marks a field the\nverification found missing.\n",
            "enum": [
              "confirmed",
              "corrected",
              "added",
              "unresolved"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "level",
          "storage",
          "type",
          "label",
          "tier",
          "requirement",
          "evidence_required"
        ],
        "type": "object"
      },
      "RegistryInfo": {
        "properties": {
          "hash": {
            "description": "SHA-256 of the canonical registry content.",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RegistryStatus"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "hash",
          "status"
        ],
        "type": "object"
      },
      "RegistryOrgFact": {
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "$ref": "#/components/schemas/LabelText"
          },
          "type": {
            "enum": [
              "boolean"
            ],
            "type": "string"
          }
        },
        "required": [
          "key",
          "type",
          "label"
        ],
        "type": "object"
      },
      "RegistryRef": {
        "properties": {
          "hash": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/RegistryStatus"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "hash",
          "status"
        ],
        "type": "object"
      },
      "RegistrySchema": {
        "properties": {
          "categories": {
            "items": {
              "$ref": "#/components/schemas/RegistryCategory"
            },
            "type": "array"
          },
          "category": {
            "$ref": "#/components/schemas/BatteryCategory"
          },
          "checks": {
            "items": {
              "$ref": "#/components/schemas/RegistryCheck"
            },
            "type": "array"
          },
          "hash": {
            "type": "string"
          },
          "org_facts": {
            "items": {
              "$ref": "#/components/schemas/RegistryOrgFact"
            },
            "type": "array"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/RegistrySection"
            },
            "type": "array"
          },
          "status": {
            "$ref": "#/components/schemas/RegistryStatus"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "hash",
          "status",
          "category",
          "categories",
          "sections",
          "org_facts",
          "checks"
        ],
        "type": "object"
      },
      "RegistrySection": {
        "properties": {
          "din_spec": {
            "type": "string"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/RegistryField"
            },
            "type": "array"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "$ref": "#/components/schemas/LabelText"
          },
          "order": {
            "type": "integer"
          }
        },
        "required": [
          "key",
          "order",
          "label",
          "fields"
        ],
        "type": "object"
      },
      "RegistryStatus": {
        "description": "`seed` until verified against primary sources (docs/registry/verification-log.md).",
        "enum": [
          "seed",
          "verified"
        ],
        "type": "string"
      },
      "RegistrySubmissionState": {
        "description": "`not_available`: the registry has no interface yet, nothing is submitted. The other states belong to a\nregistry adapter that does not exist yet: `not_submitted` (available, nothing sent for this passport),\n`pending` (queued), `submitted` (sent, no answer), `confirmed` (the registry confirmed receipt), `failed`.\n",
        "enum": [
          "not_available",
          "not_submitted",
          "pending",
          "submitted",
          "confirmed",
          "failed"
        ],
        "type": "string"
      },
      "RegistrySubmissionStatus": {
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "available": {
            "description": "Whether the platform can submit to the registry at all.",
            "type": "boolean"
          },
          "detail": {
            "description": "Why the registration is not available or failed (English).",
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "last_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "passport_version": {
            "description": "The version the latest submission concerns.",
            "type": "integer"
          },
          "registry": {
            "enum": [
              "eu_dpp"
            ],
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/RegistrySubmissionState"
          }
        },
        "required": [
          "registry",
          "available",
          "state"
        ],
        "type": "object"
      },
      "RegistryUpdateStatus": {
        "properties": {
          "reevaluation": {
            "$ref": "#/components/schemas/Job"
          },
          "registry_hash": {
            "type": "string"
          },
          "registry_status": {
            "$ref": "#/components/schemas/RegistryStatus"
          },
          "registry_version": {
            "type": "string"
          },
          "update_needed": {
            "description": "The organisation's passports in status `update_needed`.",
            "type": "integer"
          }
        },
        "required": [
          "registry_version",
          "registry_hash",
          "registry_status",
          "update_needed"
        ],
        "type": "object"
      },
      "ReportedEventType": {
        "description": "The event types members and service partners report.",
        "enum": [
          "placed_on_market",
          "put_into_service",
          "inspection",
          "repair",
          "component_replaced",
          "condition_update",
          "waste",
          "recycled",
          "custom"
        ],
        "type": "string"
      },
      "RequirementReason": {
        "description": "Why the field has its requirement: `rule` (registry rule for the category), `condition_met`,\n`condition_open` (cannot be decided yet; treated as required), `condition_not_met`,\n`applies_from` (obligation starts after the reference date), `trigger` (a legal act is still\npending), `marked_not_applicable` (a user recorded a reason).\n",
        "enum": [
          "rule",
          "condition_met",
          "condition_open",
          "condition_not_met",
          "applies_from",
          "trigger",
          "marked_not_applicable"
        ],
        "type": "string"
      },
      "RequirementStatus": {
        "enum": [
          "required",
          "conditional",
          "optional",
          "not_applicable",
          "later_required"
        ],
        "type": "string"
      },
      "ReviewStatus": {
        "enum": [
          "captured",
          "auto_checked",
          "approved",
          "rejected"
        ],
        "type": "string"
      },
      "RowVersion": {
        "description": "Optimistic-concurrency version; send it back as `If-Match` when updating.",
        "format": "int64",
        "minimum": 1,
        "type": "integer"
      },
      "SchemaIssue": {
        "properties": {
          "field_key": {
            "$ref": "#/components/schemas/FieldKey"
          },
          "kind": {
            "enum": [
              "missing",
              "type",
              "enum",
              "format",
              "range",
              "other"
            ],
            "type": "string"
          },
          "message": {
            "description": "The validator's technical message (English).",
            "type": "string"
          },
          "path": {
            "description": "JSON pointer into the export, e.g. `/batteryPassportData/performanceAndDurability/capacityFade`.",
            "type": "string"
          }
        },
        "required": [
          "path",
          "kind",
          "message"
        ],
        "type": "object"
      },
      "SchemaReport": {
        "description": "Result of validating a BatteryPass v2.0 export against its schema (advisory, ADR-012).",
        "properties": {
          "issues": {
            "items": {
              "$ref": "#/components/schemas/SchemaIssue"
            },
            "type": "array"
          },
          "schema": {
            "description": "The schema file, e.g. `Stationary_Industrial_Above_2kWh_Feb27_2.0.1.json`.",
            "type": "string"
          },
          "valid": {
            "type": "boolean"
          }
        },
        "required": [
          "schema",
          "valid",
          "issues"
        ],
        "type": "object"
      },
      "ServicePartnerRef": {
        "properties": {
          "email": {
            "$ref": "#/components/schemas/EmailAddress"
          },
          "name": {
            "type": "string"
          },
          "request_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "email"
        ],
        "type": "object"
      },
      "SpreadsheetFormat": {
        "description": "The file format of a spreadsheet download.",
        "enum": [
          "xlsx",
          "csv"
        ],
        "type": "string"
      },
      "StatusCounts": {
        "properties": {
          "later_required": {
            "type": "integer"
          },
          "not_applicable": {
            "type": "integer"
          },
          "ok": {
            "type": "integer"
          },
          "optional_missing": {
            "type": "integer"
          },
          "required_missing": {
            "type": "integer"
          },
          "required_pending_review": {
            "type": "integer"
          }
        },
        "required": [
          "required_missing",
          "required_pending_review",
          "ok",
          "not_applicable",
          "later_required",
          "optional_missing"
        ],
        "type": "object"
      },
      "TargetRef": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "type": {
            "enum": [
              "model_version",
              "battery"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "type": "object"
      },
      "Tier": {
        "description": "Access tier of a field on the passport (Art. 77(2), Annex XIII).",
        "enum": [
          "public",
          "legitimate_interest",
          "authority",
          "internal"
        ],
        "type": "string"
      },
      "UserRef": {
        "properties": {
          "display_name": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "display_name"
        ],
        "type": "object"
      },
      "ValueCheck": {
        "properties": {
          "check_key": {
            "description": "`format` or a registry check key.",
            "type": "string"
          },
          "message": {
            "$ref": "#/components/schemas/LabelText"
          },
          "result": {
            "enum": [
              "pass",
              "warn",
              "fail"
            ],
            "type": "string"
          }
        },
        "required": [
          "check_key",
          "result",
          "message"
        ],
        "type": "object"
      },
      "ValueProperty": {
        "description": "`schema` is always present (optional only because the schema type is recursive).",
        "properties": {
          "name": {
            "type": "string"
          },
          "schema": {
            "$ref": "#/components/schemas/ValueSchema"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "ValueSchema": {
        "description": "Validation schema of a value, a list item or an object property.",
        "properties": {
          "enum": {
            "description": "Allowed values (strings or integers).",
            "items": {},
            "type": "array"
          },
          "enum_labels": {
            "description": "Labels of `enum`, same order.",
            "items": {
              "$ref": "#/components/schemas/LabelText"
            },
            "type": "array"
          },
          "items": {
            "$ref": "#/components/schemas/ValueSchema"
          },
          "label": {
            "$ref": "#/components/schemas/LabelText"
          },
          "max": {
            "type": "number"
          },
          "max_bytes": {
            "description": "Largest document a `file` field accepts.",
            "format": "int64",
            "type": "integer"
          },
          "max_items": {
            "type": "integer"
          },
          "max_length": {
            "type": "integer"
          },
          "mime": {
            "description": "Media types a document of a `file` field may have (empty = any accepted upload type).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "min": {
            "type": "number"
          },
          "pattern": {
            "type": "string"
          },
          "properties": {
            "items": {
              "$ref": "#/components/schemas/ValueProperty"
            },
            "type": "array"
          },
          "type": {
            "$ref": "#/components/schemas/ValueType"
          },
          "unit": {
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "ValueSource": {
        "enum": [
          "manual",
          "import",
          "supplier",
          "api",
          "system"
        ],
        "type": "string"
      },
      "ValueStatus": {
        "enum": [
          "missing",
          "captured",
          "auto_checked",
          "approved",
          "rejected"
        ],
        "type": "string"
      },
      "ValueType": {
        "enum": [
          "string",
          "text",
          "integer",
          "number",
          "boolean",
          "date",
          "datetime",
          "enum",
          "url",
          "file",
          "list",
          "object",
          "country"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "description": "Organisation API key sent as `Authorization: Bearer bp_live_…` (ADR-017). Accepted only by the\noperations that list this scheme, with the scope in their `x-api-key-scope`.\n",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "API of the BatteryPass platform for EU digital battery passports, for integrations: read battery\nmodels, units, values, documents, passports and their exports, follow the organisation's changes,\nstage spreadsheet imports of units, report condition data and lifecycle events, and read public\npassports.\n\n- Authentication: an API key of the organisation in the header `Authorization: Bearer bp_live_…`.\n  The organisation's owners create and revoke keys in the BatteryPass settings; a key is shown once.\n  Each operation names the scope it needs in `x-api-key-scope`: `read` (read data and the change\n  feed), `condition` (report condition data and lifecycle events) or `import` (upload, map and\n  validate spreadsheet imports of units). Operations with the tag `public` need no key.\n- A key acts in its organisation with the rights of a viewer: where a description names a role\n  (\"any member\", \"editors and above\"), a key counts as a viewer. Keys never commit or approve an\n  import, approve values or publish: a key with `import` stages an import, and members of the\n  organisation commit and approve it in the portal.\n- Limits: all keys of an organisation together may make 600 requests per minute; unknown or revoked\n  keys 30 attempts per 15 minutes per client address; public passport reads 300 per minute per client\n  address. `429 rate_limited` responses carry a `Retry-After` header (seconds).\n- Errors are RFC 9457 Problem Details (`application/problem+json`) with a stable `code` and a\n  `request_id` to quote when you contact support.\n- Lists use keyset pagination: `?limit=\u0026cursor=` returning `{items, next_cursor}`. Ids are UUIDs,\n  timestamps UTC.\n- Outside this API: the QR codes carry GS1 Digital Links `/01/{gtin}/21/{serial}`, which send\n  browsers to the public page and, with `?linkType=describedby`, clients to the public JSON; the\n  public signing keys that verify passport signatures offline are at\n  `/.well-known/batterypass/keys.json`.\n- This document lists every operation integrations can use; operations not listed here belong to\n  the BatteryPass portal and may change without notice.\n",
    "title": "BatteryPass API",
    "version": "0.10.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/batteries": {
      "get": {
        "description": "Any member. Ordered by serial number, then id; filter by model, version, passport status,\nserial number prefix or the import that created the units.\n",
        "operationId": "listBatteries",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "in": "query",
            "name": "battery_model_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "model_version_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "passport_status",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PassportStatus"
            }
          },
          {
            "in": "query",
            "name": "serial_prefix",
            "required": false,
            "schema": {
              "maxLength": 50,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "import_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatteryPage"
                }
              }
            },
            "description": "One page of units."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Units (individual batteries) of the active organisation",
        "tags": [
          "catalog"
        ],
        "x-api-key-scope": "read"
      }
    },
    "/batteries/export": {
      "get": {
        "description": "Any member. The units matching the filters (at most 10 000) with the columns of an import:\nmodel, version, the unit's fields and every unit-level field with a value, so the file can be\nedited and imported again (`docs/architecture.md` §7). XLSX by default.\n",
        "operationId": "exportUnits",
        "parameters": [
          {
            "in": "query",
            "name": "battery_model_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "model_version_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "passport_status",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PassportStatus"
            }
          },
          {
            "in": "query",
            "name": "serial_prefix",
            "required": false,
            "schema": {
              "maxLength": 50,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "import_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SpreadsheetFormat"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The spreadsheet.",
            "headers": {
              "Content-Disposition": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The units as a spreadsheet with the import's columns",
        "tags": [
          "catalog"
        ],
        "x-api-key-scope": "read"
      }
    },
    "/batteries/{batteryId}": {
      "get": {
        "description": "Any member.",
        "operationId": "getBattery",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Battery"
                }
              }
            },
            "description": "The unit."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "A unit",
        "tags": [
          "catalog"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ]
    },
    "/batteries/{batteryId}/completeness": {
      "get": {
        "description": "Any member. Evaluated against the category, the unit's putting-into-service date (else its manufacturing date, else the version's effective date) and the organisation's facts; includes the summary of its model version.",
        "operationId": "getBatteryCompleteness",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Completeness"
                }
              }
            },
            "description": "The evaluation."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Registry evaluation of the unit-level fields",
        "tags": [
          "values"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ]
    },
    "/batteries/{batteryId}/condition": {
      "get": {
        "description": "Any member. The dynamic fields visible for the unit and their current values with `measured_at`.",
        "operationId": "getCondition",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Condition"
                }
              }
            },
            "description": "The condition data."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The condition data of a unit (the registry's dynamic fields)",
        "tags": [
          "lifecycle"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ],
      "patch": {
        "description": "Editor and above, or an API key with the `condition` scope (source `api`, ADR-016, ADR-017). Merge\nsemantics: only the named fields change, `null` clears a field.\nEach value has a `measured_at` (its own or the request's), which must not lie in the future or before\nthe manufacturing date. Fields that are not dynamic fields of the unit are refused (`unknown_field`);\nso is the whole update when a value is invalid or the merged condition data fails a cross-field\ncheck. A value older than the stored one, or equal to it, is skipped and listed. Accepted values are\nstored as approved measurements and recorded as a `condition_update` lifecycle event; a published\npassport is re-published as the organisation's `condition_republish` setting says (immediately in\nthis request, or by the daily job).\n",
        "operationId": "updateCondition",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConditionUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConditionUpdateResult"
                }
              }
            },
            "description": "What was accepted, what was skipped, and the publication."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Report measured condition data (merge)",
        "tags": [
          "lifecycle"
        ],
        "x-api-key-scope": "condition"
      }
    },
    "/batteries/{batteryId}/lifecycle-events": {
      "get": {
        "description": "Any member. Events recorded by members, service-partner reports, condition updates and second life.",
        "operationId": "listLifecycleEvents",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleEventPage"
                }
              }
            },
            "description": "A page of events."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The lifecycle of a unit, newest first",
        "tags": [
          "lifecycle"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ],
      "post": {
        "description": "Editor and above, or an API key with the `condition` scope (source `api`, ADR-017). `occurred_on` lies\nbetween the manufacturing date and today. `evidence_ids` name\ndocuments of the evidence library (a diagnostic report, a repair protocol). Events are records: they\ndo not change the unit's data; condition values are reported with `updateCondition`, second life with\n`createSecondLifeBattery`.\n",
        "operationId": "createLifecycleEvent",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LifecycleEventCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleEvent"
                }
              }
            },
            "description": "The event."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Record an event in the life of a unit",
        "tags": [
          "lifecycle"
        ],
        "x-api-key-scope": "condition"
      }
    },
    "/batteries/{batteryId}/passport": {
      "get": {
        "description": "Any member. A unit whose identifiers are not locked and that was never published has a passport\nin status `draft` without `passport_id`.\n",
        "operationId": "getPassport",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Passport"
                }
              }
            },
            "description": "The passport."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The passport of a unit",
        "tags": [
          "passports"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ]
    },
    "/batteries/{batteryId}/passport/qr": {
      "get": {
        "description": "Any member. Rendered on demand from `gs1_digital_link` (error correction M, quiet zone of four\nmodules). Only once the identifiers are locked (`409 conflict` before).\n",
        "operationId": "getPassportQr",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "png",
              "enum": [
                "png",
                "svg"
              ],
              "type": "string"
            }
          },
          {
            "description": "Width and height of the PNG in pixels (ignored for SVG, which scales).",
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "default": 512,
              "maximum": 2048,
              "minimum": 128,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The image.",
            "headers": {
              "Content-Disposition": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The QR code of the unit's GS1 Digital Link",
        "tags": [
          "passports"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ]
    },
    "/batteries/{batteryId}/passport/registration": {
      "get": {
        "description": "Any member. The EU digital product passport registry has no interface for economic operators yet\n(`docs/regulatory-reference.md`), so the registration is `not_available` and nothing is submitted. A\npassport is never shown as registered without the registry's confirmation.\n",
        "operationId": "getRegistrySubmissionStatus",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrySubmissionStatus"
                }
              }
            },
            "description": "The registration status."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The passport's registration with the EU registry",
        "tags": [
          "passports"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ]
    },
    "/batteries/{batteryId}/passport/versions": {
      "get": {
        "description": "Any member. With `at`, only versions published at or before that instant: the first item is the\nversion that was valid then (history by date for the portal, with every tier).\n",
        "operationId": "listPassportVersions",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "in": "query",
            "name": "at",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassportVersionPage"
                }
              }
            },
            "description": "A page of versions."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The published versions of a unit's passport, newest first",
        "tags": [
          "passports"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ]
    },
    "/batteries/{batteryId}/passport/versions/{versionNo}": {
      "get": {
        "description": "Any member.",
        "operationId": "getPassportVersion",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassportVersion"
                }
              }
            },
            "description": "The version."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "One published version with its signed snapshot and validation report",
        "tags": [
          "passports"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        },
        {
          "$ref": "#/components/parameters/VersionNo"
        }
      ]
    },
    "/batteries/{batteryId}/passport/versions/{versionNo}/batterypass-v2": {
      "get": {
        "description": "Any member. The stored export, including restricted data; sent as an attachment. Its schema report\nis in `getPassportVersion` (advisory, ADR-012).\n",
        "operationId": "exportPassportJson",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JSONDocument"
                }
              }
            },
            "description": "The export.",
            "headers": {
              "Content-Disposition": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The BatteryPass v2.0 export of a version (all tiers)",
        "tags": [
          "passports"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        },
        {
          "$ref": "#/components/parameters/VersionNo"
        }
      ]
    },
    "/batteries/{batteryId}/passport/versions/{versionNo}/diff": {
      "get": {
        "description": "Any member. Compares the signed snapshots field by field; `against` defaults to the previous version.",
        "operationId": "getPassportVersionDiff",
        "parameters": [
          {
            "in": "query",
            "name": "against",
            "required": false,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassportDiff"
                }
              }
            },
            "description": "The changes."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "What changed from an earlier version to this one",
        "tags": [
          "passports"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        },
        {
          "$ref": "#/components/parameters/VersionNo"
        }
      ]
    },
    "/batteries/{batteryId}/passport/versions/{versionNo}/pdf": {
      "get": {
        "description": "Any member.",
        "operationId": "exportPassportPdf",
        "parameters": [
          {
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Locale"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The PDF.",
            "headers": {
              "Content-Disposition": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "A PDF of a version with every tier, restricted rows tagged, the signature and the QR code",
        "tags": [
          "passports"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        },
        {
          "$ref": "#/components/parameters/VersionNo"
        }
      ]
    },
    "/batteries/{batteryId}/values": {
      "get": {
        "description": "Any member. One entry per field that has (or had) a value; `value` is null when it was cleared.",
        "operationId": "listBatteryValues",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValueList"
                }
              }
            },
            "description": "The current values."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Current unit-level values of a unit",
        "tags": [
          "values"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        }
      ]
    },
    "/batteries/{batteryId}/values/{fieldKey}/history": {
      "get": {
        "description": "Any member.",
        "operationId": "listBatteryValueHistory",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValueHistory"
                }
              }
            },
            "description": "The revisions."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "All revisions of one unit-level value, newest first",
        "tags": [
          "values"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/BatteryId"
        },
        {
          "$ref": "#/components/parameters/FieldKey"
        }
      ]
    },
    "/battery-models": {
      "get": {
        "description": "Any member. Ordered by name, then id. Archived models only with `include_archived=true`.",
        "operationId": "listBatteryModels",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "in": "query",
            "name": "include_archived",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatteryModelPage"
                }
              }
            },
            "description": "One page of battery models."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "List the battery models of the active organisation",
        "tags": [
          "catalog"
        ],
        "x-api-key-scope": "read"
      }
    },
    "/battery-models/{modelId}": {
      "get": {
        "description": "Any member.",
        "operationId": "getBatteryModel",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatteryModel"
                }
              }
            },
            "description": "The battery model."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "A battery model",
        "tags": [
          "catalog"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ModelId"
        }
      ]
    },
    "/battery-models/{modelId}/versions": {
      "get": {
        "description": "Any member. At most 200.",
        "operationId": "listModelVersions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelVersionList"
                }
              }
            },
            "description": "The versions."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Versions of a battery model, newest effective date first",
        "tags": [
          "catalog"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ModelId"
        }
      ]
    },
    "/changes": {
      "get": {
        "description": "Any member, or an API key with the `read` scope (ADR-026). The organisation's changes in the order\nthey became visible, oldest first, as `{id, occurred_at, entity_type, entity_id, action}`: no values,\nno actors, no personal data; read the entity for its current state. Keep `next_cursor` of the last\npage and ask again later: a change appears only once every transaction that started before it has\nfinished, so a cursor never skips a change that commits late. `next_cursor` is set whenever the page\nhas items, also on the last page; an empty page keeps the cursor you sent (`next_cursor` null). Without\n`cursor` the feed starts at the beginning of the organisation's history.\n",
        "operationId": "listChanges",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "description": "Only these actions (all when omitted).",
            "explode": false,
            "in": "query",
            "name": "types",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/ChangeAction"
              },
              "maxItems": 9,
              "type": "array"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangePage"
                }
              }
            },
            "description": "One page of changes."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The organisation's changes, oldest first, for polling",
        "tags": [
          "changes"
        ],
        "x-api-key-scope": "read"
      }
    },
    "/evidence": {
      "get": {
        "description": "Any member. Superseded revisions are left out unless `include_superseded=true`.",
        "operationId": "listEvidence",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EvidenceKind"
            }
          },
          {
            "in": "query",
            "name": "include_superseded",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvidencePage"
                }
              }
            },
            "description": "A page of documents."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The evidence library, newest first",
        "tags": [
          "evidence"
        ],
        "x-api-key-scope": "read"
      }
    },
    "/evidence/{evidenceId}": {
      "get": {
        "description": "Any member.",
        "operationId": "getEvidence",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Evidence"
                }
              }
            },
            "description": "The document."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "One document with its revisions and where it is used",
        "tags": [
          "evidence"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/EvidenceId"
        }
      ]
    },
    "/evidence/{evidenceId}/download": {
      "get": {
        "description": "Documents of the tiers `public` and `legitimate_interest` can be downloaded by any member;\n`authority` and `internal` documents by editors and above. Always sent as an attachment.\n",
        "operationId": "downloadEvidence",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file.",
            "headers": {
              "Content-Disposition": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Download the file",
        "tags": [
          "evidence"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/EvidenceId"
        }
      ]
    },
    "/facilities": {
      "get": {
        "description": "Any member. Ordered by name, then id.",
        "operationId": "listFacilities",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FacilityPage"
                }
              }
            },
            "description": "One page of facilities."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Manufacturing facilities of the active organisation",
        "tags": [
          "facilities"
        ],
        "x-api-key-scope": "read"
      }
    },
    "/imports": {
      "get": {
        "description": "Any member, or an API key with the `import` scope (ADR-026). An import staged with a key names\nthe key in `created_by_api_key` instead of `created_by`.\n",
        "operationId": "listImports",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPage"
                }
              }
            },
            "description": "One page of imports."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Imports of the active organisation, newest first",
        "tags": [
          "imports"
        ],
        "x-api-key-scope": "import"
      },
      "post": {
        "description": "Editor and above, or an API key with the `import` scope (ADR-026). A CSV (UTF-8, UTF-16 or\nWindows-1252; `;`, `,`, tab or `|` separated) or XLSX file of at most 10 MB, 10 000 rows and 200\ncolumns; the first non-empty row holds the headers. The answer is the import with a mapping\nproposed from the headers (registry CSV headers, aliases, labels; units such as `(kWh)` are\nconverted), or taken from the import preset named in `preset` (the ERP registry): a preset maps\nthe columns it knows by their headers and leaves the others unmapped.\n\nA key stages the import only: members of the organisation commit it and approve its values in\nthe portal, so declared data still enters through a member's decision.\n",
        "operationId": "createImport",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImportUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Import"
                }
              }
            },
            "description": "The import."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Upload a spreadsheet of units",
        "tags": [
          "imports"
        ],
        "x-api-key-scope": "import"
      }
    },
    "/imports/{importId}": {
      "get": {
        "description": "Any member, or an API key with the `import` scope (ADR-026). Poll it after `validateImport`: the\nstatus becomes `validated` (or `failed`) and `summary` counts valid, warning, error and duplicate\nrows.\n",
        "operationId": "getImport",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Import"
                }
              }
            },
            "description": "The import."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "One import with its mapping and summary",
        "tags": [
          "imports"
        ],
        "x-api-key-scope": "import"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ImportId"
        }
      ]
    },
    "/imports/{importId}/mapping": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ImportId"
        }
      ],
      "put": {
        "description": "Editor and above, or an API key with the `import` scope (ADR-026), while the import is not being\nprocessed or committed. Each target at most once; `unit` is the unit a column's numbers are\nwritten in when it differs from the field's. With `preset` (an import preset of the ERP\nregistry) the mapping is taken from the preset by the file's headers and `mapping` must be\nempty. A validated import must be validated again.\n",
        "operationId": "updateImportMapping",
        "parameters": [
          {
            "$ref": "#/components/parameters/IfMatch"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportMappingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Import"
                }
              }
            },
            "description": "The import."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Map the columns of an import",
        "tags": [
          "imports"
        ],
        "x-api-key-scope": "import"
      }
    },
    "/imports/{importId}/validate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ImportId"
        }
      ],
      "post": {
        "description": "Editor and above, or an API key with the `import` scope (ADR-026). A job reads every row with the\nmapping, validates it with the editor's validators and finds duplicate serial numbers in the file\nand in the database (after removing surrounding spaces and invisible characters). Requires a\nserial number column and a model column or `options.battery_model_id`. Follow the import with\n`getImport` until its status is `validated` or `failed`.\n",
        "operationId": "validateImport",
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            },
            "description": "The validation job."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Start validating every row of an import",
        "tags": [
          "imports"
        ],
        "x-api-key-scope": "import"
      }
    },
    "/model-versions/{versionId}": {
      "get": {
        "description": "Any member.",
        "operationId": "getModelVersion",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelVersion"
                }
              }
            },
            "description": "The version."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "A model version",
        "tags": [
          "catalog"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/VersionId"
        }
      ]
    },
    "/model-versions/{versionId}/completeness": {
      "get": {
        "description": "Any member. Evaluated against the category, the version's effective date and the organisation's facts.",
        "operationId": "getModelVersionCompleteness",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Completeness"
                }
              }
            },
            "description": "The evaluation."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Registry evaluation of the model-level fields",
        "tags": [
          "values"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/VersionId"
        }
      ]
    },
    "/model-versions/{versionId}/values": {
      "get": {
        "description": "Any member. One entry per field that has (or had) a value; `value` is null when it was cleared.",
        "operationId": "listModelVersionValues",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValueList"
                }
              }
            },
            "description": "The current values."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Current model-level values of a version",
        "tags": [
          "values"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/VersionId"
        }
      ]
    },
    "/model-versions/{versionId}/values/{fieldKey}/history": {
      "get": {
        "description": "Any member.",
        "operationId": "listModelVersionValueHistory",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValueHistory"
                }
              }
            },
            "description": "The revisions."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "All revisions of one model-level value, newest first",
        "tags": [
          "values"
        ],
        "x-api-key-scope": "read"
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/VersionId"
        },
        {
          "$ref": "#/components/parameters/FieldKey"
        }
      ]
    },
    "/public/dpps/by-product-id/{productId}": {
      "get": {
        "description": "No authentication. Same response as `getPublicPassport`.",
        "operationId": "getPublicPassportByProductId",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPassport"
                }
              }
            },
            "description": "The passport.",
            "headers": {
              "Cache-Control": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [],
        "summary": "The public passport of a unit, looked up by GTIN and serial number",
        "tags": [
          "public"
        ]
      },
      "parameters": [
        {
          "description": "`{gtin}:{serial}` (EN 18222 style), e.g. `04012345000023:SV2027-000184`; the GTIN may have 8, 12, 13 or 14 digits.",
          "in": "path",
          "name": "productId",
          "required": true,
          "schema": {
            "maxLength": 70,
            "minLength": 10,
            "type": "string"
          }
        }
      ]
    },
    "/public/passports/{passportId}": {
      "get": {
        "description": "No authentication. Only the `public` tier, as stored when the version was published (ADR-013).\nPassports that are not public (`qr_locked`, `withdrawn`, `suspended`, `deleted_recycled`) answer\nwith their status and no content. Cached for 5 minutes; rate-limited per client address.\n",
        "operationId": "getPublicPassport",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPassport"
                }
              }
            },
            "description": "The passport.",
            "headers": {
              "Cache-Control": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [],
        "summary": "The public passport (current version)",
        "tags": [
          "public"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/PassportId"
        }
      ]
    },
    "/public/passports/{passportId}/documents/{documentId}": {
      "get": {
        "description": "No authentication. Only documents of the `public` tier that a public field of a published version\nnames (for example the EU declaration of conformity); everything else is `404`.\n",
        "operationId": "downloadPublicPassportDocument",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "The file.",
            "headers": {
              "Cache-Control": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [],
        "summary": "A public document of a public passport",
        "tags": [
          "public"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/PassportId"
        },
        {
          "in": "path",
          "name": "documentId",
          "required": true,
          "schema": {
            "format": "uuid",
            "type": "string"
          }
        }
      ]
    },
    "/public/passports/{passportId}/verify": {
      "get": {
        "description": "No authentication. A convenience: the same check works offline with the public JSON and\n`/.well-known/batterypass/keys.json` (ADR-004, ADR-013). Without `version_no`, the current version.\n",
        "operationId": "verifyPassport",
        "parameters": [
          {
            "in": "query",
            "name": "version_no",
            "required": false,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PassportVerification"
                }
              }
            },
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [],
        "summary": "Check the signatures of a version on the server",
        "tags": [
          "public"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/PassportId"
        }
      ]
    },
    "/public/passports/{passportId}/version": {
      "get": {
        "description": "No authentication. The version with `published_at ≤ at \u003c valid_until`; `404` before the first\npublication. Versions are immutable, so the response is cached for a day.\n",
        "operationId": "getPublicPassportVersion",
        "parameters": [
          {
            "in": "query",
            "name": "at",
            "required": true,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPassport"
                }
              }
            },
            "description": "The version.",
            "headers": {
              "Cache-Control": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [],
        "summary": "The public passport as it was at a point in time",
        "tags": [
          "public"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/PassportId"
        }
      ]
    },
    "/registry": {
      "get": {
        "description": "Any signed-in user.",
        "operationId": "getRegistryInfo",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryInfo"
                }
              }
            },
            "description": "The registry identity."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Version, content hash and status of the field registry in use",
        "tags": [
          "registry"
        ],
        "x-api-key-scope": "read"
      }
    },
    "/registry/schema": {
      "get": {
        "description": "Any signed-in user. Sections and fields with bilingual labels, help, tier, the requirement rule\nfor the category (before dates, conditions and values are applied; per-target status comes from\nthe completeness operations), validation schema and export paths.\n",
        "operationId": "getRegistrySchema",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BatteryCategory"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistrySchema"
                }
              }
            },
            "description": "The schema."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The editor schema of a battery category",
        "tags": [
          "registry"
        ],
        "x-api-key-scope": "read"
      }
    },
    "/registry/status": {
      "get": {
        "description": "Any member. After a new registry version is deployed, a job re-evaluates the organisation's published\npassports; passports with a newly missing required value become `update_needed` (they stay online)\nand their versions get an `update_passports` task.\n",
        "operationId": "getRegistryStatus",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryUpdateStatus"
                }
              }
            },
            "description": "The status."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "The registry in use and how many of the organisation's passports need an update",
        "tags": [
          "registry"
        ],
        "x-api-key-scope": "read"
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "servers": [
    {
      "url": "/api/v1"
    }
  ],
  "tags": [
    {
      "description": "Manufacturing facilities of the active organisation.",
      "name": "facilities"
    },
    {
      "description": "Battery models, model versions and units.",
      "name": "catalog"
    },
    {
      "description": "The field registry (ADR-003) that drives fields, labels, requirements and validation.",
      "name": "registry"
    },
    {
      "description": "Field values with provenance, completeness and not-applicable reasons.",
      "name": "values"
    },
    {
      "description": "Evidence documents, their revisions and their links to fields.",
      "name": "evidence"
    },
    {
      "description": "Publishing signed passport versions, identifiers, QR codes and exports.",
      "name": "passports"
    },
    {
      "description": "The public passport of a unit (no authentication, `public` tier only).",
      "name": "public"
    },
    {
      "description": "Spreadsheet imports of units (CSV, XLSX), their mapping, validation, commit and approval.",
      "name": "imports"
    },
    {
      "description": "Lifecycle events, condition data, service-partner reports, second life and change impact.",
      "name": "lifecycle"
    },
    {
      "description": "The organisation's change feed, for integrations that poll instead of scanning everything (ADR-026).",
      "name": "changes"
    }
  ]
}
