{
  "openapi": "3.1.0",
  "info": {
    "title": "Axiospec Public API",
    "description": "The Axiospec Public API lets you read and write your calibration program from your own systems: list and create instruments, log calibrations to the tamper-evident ledger, and read your sites and selected compliance standards.\n\nBase URL: `https://axiospec.com/api/public/v1`\n\n**Authentication.** Create a key in the app under Settings then API Keys (workspace admins only). Send it on every request as either `Authorization: Bearer <key>` or `X-API-Key: <key>`. Keys are prefixed `ctk_`.\n\n**Access.** The API is available on the Professional and Scale plans. Keys on the Free or Starter plans receive `403 API_ACCESS_TIER_REQUIRED`.\n\n**Scopes.** A key has the `read` scope, or the `write` scope (which implies `read`). A read-only key that attempts a write receives `403 INSUFFICIENT_SCOPE`.\n\n**Idempotency.** Logging a calibration (`POST /instruments/{id}/calibrations`) requires an `Idempotency-Key` header. The ledger is append-only, so a retried request with the same key returns the original record instead of writing a duplicate.\n\n**Pagination.** List endpoints return `{data: [...], pagination: {limit, offset, total, has_more}}`. Page with `limit` and `offset`.\n\n**Errors.** Errors are JSON with a machine-readable `code`, a human-readable `message`, and optional `details` (for example the `missing_fields` list on `422 FIELD_REQUIREMENTS_UNMET`).",
    "version": "1.0.0"
  },
  "paths": {
    "/api/public/v1/instruments": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List instruments (paginated)",
        "operationId": "list_instruments_api_public_v1_instruments_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 64
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by asset status.",
              "title": "Status"
            },
            "description": "Filter by asset status."
          },
          {
            "name": "site_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to a single site (UUID).",
              "title": "Site Id"
            },
            "description": "Filter to a single site (UUID)."
          },
          {
            "name": "location_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to a single location (UUID).",
              "title": "Location Id"
            },
            "description": "Filter to a single location (UUID)."
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Incremental sync: only instruments modified at/after this ISO-8601 timestamp.",
              "title": "Updated Since"
            },
            "description": "Incremental sync: only instruments modified at/after this ISO-8601 timestamp."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort order: one of created_at, -created_at, updated_at, -updated_at.",
              "title": "Sort"
            },
            "description": "Sort order: one of created_at, -created_at, updated_at, -updated_at."
          },
          {
            "name": "asset_tag",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 255
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact asset-tag lookup (resolve your key to our record).",
              "title": "Asset Tag"
            },
            "description": "Exact asset-tag lookup (resolve your key to our record)."
          },
          {
            "name": "serial_number",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 255
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact serial-number lookup.",
              "title": "Serial Number"
            },
            "description": "Exact serial-number lookup."
          },
          {
            "name": "compliance_status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 32
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by derived compliance token: NOT_CALIBRATED, COMPLIANT, WARNING, NON_COMPLIANT, or OUT_FOR_CALIBRATION. An unknown token returns 422. This is a computed (non-column) filter: if the candidate set (after the SQL filters) is very large, the request returns 422 asking you to narrow first with status/location_id/site_id/updated_since.",
              "title": "Compliance Status"
            },
            "description": "Filter by derived compliance token: NOT_CALIBRATED, COMPLIANT, WARNING, NON_COMPLIANT, or OUT_FOR_CALIBRATION. An unknown token returns 422. This is a computed (non-column) filter: if the candidate set (after the SQL filters) is very large, the request returns 422 asking you to narrow first with status/location_id/site_id/updated_since."
          },
          {
            "name": "next_due_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only instruments whose next calibration is due before this ISO date. Computed (non-column) filter: a very large candidate set returns 422 (narrow first with status/location_id/site_id/updated_since).",
              "title": "Next Due Before"
            },
            "description": "Only instruments whose next calibration is due before this ISO date. Computed (non-column) filter: a very large candidate set returns 422 (narrow first with status/location_id/site_id/updated_since)."
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Opt-in tombstones for delta sync. include=retired surfaces retired (decommissioned) instruments \u2014 flagged deleted=true with a retired_at timestamp \u2014 so a mirror learns a row died instead of watching it silently drop from the active list. Omitted = active-only (unchanged).",
              "title": "Include"
            },
            "description": "Opt-in tombstones for delta sync. include=retired surfaces retired (decommissioned) instruments \u2014 flagged deleted=true with a retired_at timestamp \u2014 so a mirror learns a row died instead of watching it silently drop from the active list. Omitted = active-only (unchanged)."
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_InstrumentSummary_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "public-api"
        ],
        "summary": "Create an instrument",
        "operationId": "create_instrument_api_public_v1_instruments_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstrumentCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/instruments/{instrument_id}": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "Get an instrument",
        "operationId": "get_instrument_api_public_v1_instruments__instrument_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "public-api"
        ],
        "summary": "Update an instrument (partial)",
        "operationId": "update_instrument_api_public_v1_instruments__instrument_id__patch",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstrumentUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/instruments/{instrument_id}/retire": {
      "post": {
        "tags": [
          "public-api"
        ],
        "summary": "Retire (decommission) an instrument",
        "description": "Decommission an instrument via the SAME internal, ledger-safe retire path\nthe first-party app uses (``app.api.v1.routes.assets.retire_asset``): a soft\narchive (status='retired' + deleted_at set), never a hard DELETE, so the\nimmutable calibration ledger is untouched.\n\nRBAC: reuses the internal manager/admin gate (``get_current_manager``, which\nalso forbids super-admin), so a read-only or technician key cannot retire.\nTenant + per-site scope come from ``resolve_asset`` (get_asset_or_404).\n\nIdempotent: retiring an already-retired instrument is a no-op 200 returning\nthe same retired detail (the internal retire sets deleted_at, which would\notherwise make a second call 404 \u2014 so we detect the already-retired asset\nexplicitly and short-circuit).",
        "operationId": "retire_instrument_api_public_v1_instruments__instrument_id__retire_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/instruments/{instrument_id}/calibrations": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List an instrument's calibration records (paginated)",
        "operationId": "list_instrument_calibrations_api_public_v1_instruments__instrument_id__calibrations_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Incremental sync: only records appended at/after this ISO-8601 timestamp.",
              "title": "Updated Since"
            },
            "description": "Incremental sync: only records appended at/after this ISO-8601 timestamp."
          },
          {
            "name": "performed_after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only records performed at/after this ISO-8601 timestamp.",
              "title": "Performed After"
            },
            "description": "Only records performed at/after this ISO-8601 timestamp."
          },
          {
            "name": "performed_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only records performed at/before this ISO-8601 timestamp.",
              "title": "Performed Before"
            },
            "description": "Only records performed at/before this ISO-8601 timestamp."
          },
          {
            "name": "result",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict to one or more calibration results (comma-separated, case-insensitive): one of PASS, PASS_WITH_ADJUSTMENT, LIMITED_CALIBRATION, FAIL, DAMAGED. Unknown token -> 422.",
              "title": "Result"
            },
            "description": "Restrict to one or more calibration results (comma-separated, case-insensitive): one of PASS, PASS_WITH_ADJUSTMENT, LIMITED_CALIBRATION, FAIL, DAMAGED. Unknown token -> 422."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort order: one of performed_at, -performed_at, updated_at, -updated_at.",
              "title": "Sort"
            },
            "description": "Sort order: one of performed_at, -performed_at, updated_at, -updated_at."
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Opt-in tombstones for delta sync. include=voided surfaces void records (record_type='void', with voids_id pointing at the calibration killed) so a mirror learns a calibration was invalidated. Omitted = unchanged (voids hidden).",
              "title": "Include"
            },
            "description": "Opt-in tombstones for delta sync. include=voided surfaces void records (record_type='void', with voids_id pointing at the calibration killed) so a mirror learns a calibration was invalidated. Omitted = unchanged (voids hidden)."
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_CalibrationRecord_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "public-api"
        ],
        "summary": "Log a calibration for an instrument",
        "operationId": "log_calibration_api_public_v1_instruments__instrument_id__calibrations_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalibrationLogRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalibrationRecord"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/calibrations": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List all calibration records across the workspace (tenant-wide feed)",
        "description": "Tenant-wide calibration feed so a warehouse/BI job can stream \"all\ncalibrations since X\" in one paginated pass instead of an N-call per-instrument\nfan-out. Tenant isolation comes from the session ORM filter (the explicit\ntenant_id filter is belt-and-suspenders); per-site scope is intersected in so a\nsite-restricted key (future) can never see out-of-scope instruments' records.",
        "operationId": "list_calibrations_feed_api_public_v1_calibrations_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Incremental sync: only records appended at/after this ISO-8601 timestamp.",
              "title": "Updated Since"
            },
            "description": "Incremental sync: only records appended at/after this ISO-8601 timestamp."
          },
          {
            "name": "performed_after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only records performed at/after this ISO-8601 timestamp.",
              "title": "Performed After"
            },
            "description": "Only records performed at/after this ISO-8601 timestamp."
          },
          {
            "name": "performed_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only records performed at/before this ISO-8601 timestamp.",
              "title": "Performed Before"
            },
            "description": "Only records performed at/before this ISO-8601 timestamp."
          },
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict the feed to a single instrument (UUID).",
              "title": "Instrument Id"
            },
            "description": "Restrict the feed to a single instrument (UUID)."
          },
          {
            "name": "result",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict to one or more calibration results (comma-separated, case-insensitive): one of PASS, PASS_WITH_ADJUSTMENT, LIMITED_CALIBRATION, FAIL, DAMAGED. Unknown token -> 422.",
              "title": "Result"
            },
            "description": "Restrict to one or more calibration results (comma-separated, case-insensitive): one of PASS, PASS_WITH_ADJUSTMENT, LIMITED_CALIBRATION, FAIL, DAMAGED. Unknown token -> 422."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort order: one of performed_at, -performed_at, updated_at, -updated_at.",
              "title": "Sort"
            },
            "description": "Sort order: one of performed_at, -performed_at, updated_at, -updated_at."
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Opt-in tombstones for delta sync. include=voided surfaces void records (record_type='void', with voids_id pointing at the calibration killed) across the whole workspace \u2014 the primary tombstone channel for a full mirror. Omitted = unchanged (voids hidden).",
              "title": "Include"
            },
            "description": "Opt-in tombstones for delta sync. include=voided surfaces void records (record_type='void', with voids_id pointing at the calibration killed) across the whole workspace \u2014 the primary tombstone channel for a full mirror. Omitted = unchanged (voids hidden)."
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_CalibrationRecord_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/calibrations/{calibration_id}": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "Get a single calibration record",
        "operationId": "get_calibration_api_public_v1_calibrations__calibration_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "calibration_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Calibration Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalibrationRecord"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/calibrations/{calibration_id}/certificate": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "Download the calibration certificate PDF for a calibration record",
        "description": "Stream a branded PDF calibration certificate (Content-Type\napplication/pdf) for a SINGLE calibration record.\n\nReuses the internal single-calibration renderer\n``app.services.export_service.build_asset_certificate_pdf`` (the SAME\ntoolchain the first-party ``/db/assets/{id}/certificate`` uses) so the public\ndocument is byte-for-byte the app's certificate \u2014 no new PDF renderer.\n\nTenant + scope: the calibration id is first resolved on the tenant-scoped\nsession (a cross-tenant / non-calibration id 404s, INDISTINGUISHABLE from\nmissing), then the owning instrument is re-resolved through\n``_resolve_asset_including_retired`` (tenant + per-site scope, but INCLUDING\nretired instruments) so a site-scoped caller cannot pull a certificate for an\nout-of-scope instrument yet a historical certificate on a RETIRED instrument\nstays downloadable. The renderer itself re-verifies the entry is an APPROVED,\nnon-superseded calibration (a VOIDED / superseded / non-cal id yields\n``LookupError`` -> 404 CERTIFICATE_UNAVAILABLE), so a record that \"should not\nexist\" can never be certified.",
        "operationId": "get_calibration_certificate_api_public_v1_calibrations__calibration_id__certificate_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "calibration_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Calibration Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF certificate",
            "content": {
              "application/pdf": {}
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/instruments/{instrument_id}/documents/upload-url": {
      "post": {
        "tags": [
          "public-api"
        ],
        "summary": "Get a presigned URL to upload a document",
        "operationId": "create_document_upload_url_api_public_v1_instruments__instrument_id__documents_upload_url_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentUploadUrlRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentUploadUrlResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/instruments/{instrument_id}/documents": {
      "post": {
        "tags": [
          "public-api"
        ],
        "summary": "Register an uploaded document",
        "operationId": "register_document_api_public_v1_instruments__instrument_id__documents_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentRegisterRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentRecord"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List an instrument's documents",
        "operationId": "list_documents_api_public_v1_instruments__instrument_id__documents_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "calibration_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to one calibration's documents (UUID).",
              "title": "Calibration Id"
            },
            "description": "Filter to one calibration's documents (UUID)."
          },
          {
            "name": "document_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to one document type (one of certificate, report, procedure, photo, other).",
              "title": "Document Type"
            },
            "description": "Filter to one document type (one of certificate, report, procedure, photo, other)."
          },
          {
            "name": "uploaded_since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Incremental sync: only documents uploaded at/after this ISO-8601 timestamp. Note this is a NEW-upload cursor keyed on upload_date and does not reflect later archive/soft-delete changes.",
              "title": "Uploaded Since"
            },
            "description": "Incremental sync: only documents uploaded at/after this ISO-8601 timestamp. Note this is a NEW-upload cursor keyed on upload_date and does not reflect later archive/soft-delete changes."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort order: upload_date or -upload_date (default: -upload_date).",
              "title": "Sort"
            },
            "description": "Sort order: upload_date or -upload_date (default: -upload_date)."
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include archived documents (default: active only).",
              "default": false,
              "title": "Include Archived"
            },
            "description": "Include archived documents (default: active only)."
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_DocumentRecord_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/instruments/{instrument_id}/documents/{document_id}/download": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "Get a short-lived download URL for a document",
        "operationId": "get_document_download_url_api_public_v1_instruments__instrument_id__documents__document_id__download_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "instrument_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instrument Id"
            }
          },
          {
            "name": "document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Document Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentDownloadResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/due": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List due / overdue instruments (worklist)",
        "operationId": "list_due_api_public_v1_due_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "horizon_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "description": "Future window in days (1-365). Everything due within this many days is included; the OVERDUE backlog is ALWAYS included regardless of it.",
              "default": 30,
              "title": "Horizon Days"
            },
            "description": "Future window in days (1-365). Everything due within this many days is included; the OVERDUE backlog is ALWAYS included regardless of it."
          },
          {
            "name": "site_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to a single site (UUID). Intersects your site scope.",
              "title": "Site Id"
            },
            "description": "Filter to a single site (UUID). Intersects your site scope."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 32
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by compliance token (case-insensitive): NOT_CALIBRATED, COMPLIANT, WARNING, NON_COMPLIANT, or OUT_FOR_CALIBRATION.",
              "title": "Status"
            },
            "description": "Filter by compliance token (case-insensitive): NOT_CALIBRATED, COMPLIANT, WARNING, NON_COMPLIANT, or OUT_FOR_CALIBRATION."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_DueInstrument_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks/events": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List the webhook event catalog",
        "description": "The machine-readable v1 event vocabulary an endpoint can subscribe to.",
        "operationId": "list_event_catalog_api_public_v1_webhooks_events_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventCatalogResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks": {
      "post": {
        "tags": [
          "public-api"
        ],
        "summary": "Subscribe a webhook endpoint",
        "operationId": "subscribe_webhook_api_public_v1_webhooks_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreatedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List webhook endpoints",
        "operationId": "list_webhooks_api_public_v1_webhooks_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_WebhookRead_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks/{endpoint_id}": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "Get a webhook endpoint",
        "operationId": "get_webhook_api_public_v1_webhooks__endpoint_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "public-api"
        ],
        "summary": "Update a webhook endpoint",
        "operationId": "update_webhook_api_public_v1_webhooks__endpoint_id__patch",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "public-api"
        ],
        "summary": "Unsubscribe (soft-disable) a webhook endpoint",
        "operationId": "unsubscribe_webhook_api_public_v1_webhooks__endpoint_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks/{endpoint_id}/rotate-secret": {
      "post": {
        "tags": [
          "public-api"
        ],
        "summary": "Rotate a webhook endpoint's signing secret",
        "operationId": "rotate_webhook_secret_api_public_v1_webhooks__endpoint_id__rotate_secret_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretRotatedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks/{endpoint_id}/deliveries": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List an endpoint's delivery log",
        "operationId": "list_deliveries_api_public_v1_webhooks__endpoint_id__deliveries_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 32
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by delivery status: pending, failed, succeeded, exhausted.",
              "title": "Status"
            },
            "description": "Filter by delivery status: pending, failed, succeeded, exhausted."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_WebhookDeliveryRead_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/webhooks/{endpoint_id}/deliveries/{delivery_id}/retry": {
      "post": {
        "tags": [
          "public-api"
        ],
        "summary": "Manually replay a delivery",
        "operationId": "retry_delivery_api_public_v1_webhooks__endpoint_id__deliveries__delivery_id__retry_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Endpoint Id"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Delivery Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/sites": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List the workspace's sites",
        "operationId": "list_sites_api_public_v1_sites_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SiteSummary"
                  },
                  "title": "Response List Sites Api Public V1 Sites Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/locations": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List the workspace's locations",
        "operationId": "list_locations_api_public_v1_locations_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "site_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to a single site (UUID). Intersects your site scope.",
              "title": "Site Id"
            },
            "description": "Filter to a single site (UUID). Intersects your site scope."
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LocationSummary"
                  },
                  "title": "Response List Locations Api Public V1 Locations Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/standards": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "List the compliance standards this workspace has selected",
        "operationId": "list_standards_api_public_v1_standards_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StandardSummary"
                  },
                  "title": "Response List Standards Api Public V1 Standards Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/standards/field-requirements": {
      "get": {
        "tags": [
          "public-api"
        ],
        "summary": "The standard-driven field requirements for a calibration/instrument",
        "operationId": "field_requirements_api_public_v1_standards_field_requirements_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "standards",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional comma-separated standard keys to PREVIEW (e.g. 'iso_17025,as9100'). Omit to reflect the workspace's selected standards (what the public calibration POST is actually judged against). An unknown key returns 422.",
              "title": "Standards"
            },
            "description": "Optional comma-separated standard keys to PREVIEW (e.g. 'iso_17025,as9100'). Omit to reflect the workspace's selected standards (what the public calibration POST is actually judged against). An unknown key returns 422."
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldRequirementsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CalibrationLogRequest": {
        "properties": {
          "result": {
            "type": "string",
            "enum": [
              "PASS",
              "PASS_WITH_ADJUSTMENT",
              "LIMITED_CALIBRATION",
              "FAIL",
              "DAMAGED"
            ],
            "title": "Result",
            "description": "One of PASS, PASS_WITH_ADJUSTMENT, LIMITED_CALIBRATION, FAIL, DAMAGED."
          },
          "performed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Performed At",
            "description": "When the calibration was performed. Defaults to now (UTC) if omitted."
          },
          "nominal_value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Nominal Value"
          },
          "tolerance": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Tolerance"
          },
          "as_found_reading": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "As Found Reading"
          },
          "as_left_reading": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "As Left Reading"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "humidity": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Humidity"
          },
          "reference_standard": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Standard"
          },
          "reference_standard_asset_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Standard Asset Id"
          },
          "certificate_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate Number"
          },
          "traceability_reference": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Traceability Reference"
          },
          "service_provider": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Provider"
          },
          "measurement_uncertainty": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Measurement Uncertainty"
          },
          "coverage_factor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Coverage Factor"
          },
          "confidence_level": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence Level"
          },
          "decision_rule": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Decision Rule"
          },
          "conformity_statement": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Conformity Statement"
          },
          "reference_standard_certificate_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Standard Certificate Number"
          },
          "restriction_notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Restriction Notes"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "result"
        ],
        "title": "CalibrationLogRequest",
        "description": "Log a calibration for an instrument. Curated subset of the internal\nCalibrationEventCreate; unknown keys rejected (422). Routed through the SAME\nvalidated ledger write path (numeric validation + hash-chain + maker-checker)\nwith server-side standards field-requirements enforcement."
      },
      "CalibrationRecord": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "instrument_id": {
            "type": "string",
            "format": "uuid",
            "title": "Instrument Id"
          },
          "result": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result"
          },
          "performed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Performed At"
          },
          "performed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Performed By"
          },
          "nominal_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nominal Value"
          },
          "tolerance": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tolerance"
          },
          "as_found_reading": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "As Found Reading"
          },
          "as_left_reading": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "As Left Reading"
          },
          "reference_standard": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Standard"
          },
          "certificate_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Certificate Number"
          },
          "traceability_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Traceability Reference"
          },
          "service_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Provider"
          },
          "measurement_uncertainty": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Measurement Uncertainty"
          },
          "coverage_factor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coverage Factor"
          },
          "confidence_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence Level"
          },
          "decision_rule": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decision Rule"
          },
          "conformity_statement": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conformity Statement"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "approval_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approval Status"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "superseded_by_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded By Id"
          },
          "record_type": {
            "type": "string",
            "enum": [
              "calibration",
              "void"
            ],
            "title": "Record Type",
            "description": "'calibration' for a normal record, or 'void' for an appended void tombstone (surfaced via ?include=voided).",
            "default": "calibration"
          },
          "voids_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voids Id",
            "description": "On a void tombstone (record_type='void'): the id of the calibration record this void kills. Null on a normal record."
          },
          "voided_by_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voided By Id",
            "description": "On a still-visible original calibration that has since been voided: the id of the void tombstone that killed it. Null when the record is not voided."
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "instrument_id"
        ],
        "title": "CalibrationRecord",
        "description": "A curated, read-only projection of an immutable ledger calibration entry."
      },
      "DocumentDownloadResponse": {
        "properties": {
          "download_url": {
            "type": "string",
            "title": "Download Url"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "download_url",
          "expires_in",
          "expires_at"
        ],
        "title": "DocumentDownloadResponse",
        "description": "A short-lived presigned GET URL for a document. The URL forces an\n``attachment`` download (never inline render) and expires quickly, so an\nintegrator should fetch it on demand rather than cache it. The internal\n``s3_key`` is never exposed."
      },
      "DocumentRecord": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "instrument_id": {
            "type": "string",
            "format": "uuid",
            "title": "Instrument Id"
          },
          "file_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Name"
          },
          "document_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Type"
          },
          "calibration_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calibration Id",
            "description": "The calibration record this document is attached to, or null."
          },
          "uploaded_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uploaded At"
          },
          "uploaded_by": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uploaded By"
          },
          "is_archived": {
            "type": "boolean",
            "title": "Is Archived",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "instrument_id"
        ],
        "title": "DocumentRecord",
        "description": "A curated, read-only projection of an attached document.\n\nDeliberately OMITS the internal ``s3_key`` and bucket so the public contract\nnever leaks storage layout / enumeration hints. Documents are referenced only\nby their opaque ``id``; the client mints a download URL on demand."
      },
      "DocumentRegisterRequest": {
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "Key"
          },
          "file_name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "File Name"
          },
          "document_type": {
            "type": "string",
            "enum": [
              "certificate",
              "report",
              "procedure",
              "photo",
              "other"
            ],
            "title": "Document Type",
            "description": "One of certificate, report, procedure, photo, other.",
            "default": "other"
          },
          "calibration_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calibration Id",
            "description": "Optional: attach the document to a specific calibration record on THIS instrument. Must be a calibration id belonging to this instrument."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "key",
          "file_name"
        ],
        "title": "DocumentRegisterRequest",
        "description": "Register an object that was uploaded via the presigned POST as a document\non this instrument (optionally attached to one of its calibration records).\n\n``key`` MUST be the exact server-built key returned by the upload-url call\n(asset-prefixed); any other key is rejected so a caller cannot register a\npointer to another asset's or another tenant's object."
      },
      "DocumentUploadUrlRequest": {
        "properties": {
          "file_name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "File Name"
          },
          "content_type": {
            "type": "string",
            "maxLength": 255,
            "title": "Content Type",
            "description": "MIME type of the file. Must be an allow-listed type (PDF or an image); active content such as text/html or image/svg+xml is rejected.",
            "default": "application/octet-stream"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 26214400.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes",
            "description": "Optional declared file size. Rejected (422) if it exceeds the maximum; the presigned POST also caps the actual upload at S3."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "file_name"
        ],
        "title": "DocumentUploadUrlRequest",
        "description": "Ask for a short-lived, size-capped presigned S3 POST to upload a document.\n\nThe server builds the object key (asset-prefixed) \u2014 it is NEVER client\nsupplied. ``file_name`` is reduced to its basename before it enters the key."
      },
      "DocumentUploadUrlResponse": {
        "properties": {
          "method": {
            "type": "string",
            "const": "POST",
            "title": "Method",
            "default": "POST"
          },
          "upload_url": {
            "type": "string",
            "title": "Upload Url"
          },
          "fields": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Fields"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In"
          },
          "max_size_bytes": {
            "type": "integer",
            "title": "Max Size Bytes"
          }
        },
        "type": "object",
        "required": [
          "upload_url",
          "fields",
          "key",
          "expires_in",
          "max_size_bytes"
        ],
        "title": "DocumentUploadUrlResponse",
        "description": "A presigned S3 POST the client submits the raw bytes to. ``key`` is the\nserver-built object key to pass back to POST /instruments/{id}/documents."
      },
      "DueInstrument": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "asset_tag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Tag"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "due_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due At"
          },
          "due_date": {
            "type": "string",
            "title": "Due Date"
          },
          "compliance_status": {
            "type": "string",
            "title": "Compliance Status"
          },
          "interval_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Interval Label"
          },
          "site_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site Name"
          },
          "location_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location Name"
          }
        },
        "type": "object",
        "required": [
          "id",
          "due_date",
          "compliance_status"
        ],
        "title": "DueInstrument",
        "description": "One worklist row: an instrument that is coming due (within the requested\nhorizon) or already overdue.\n\nEvery value is projected straight from ``build_due_calendar``'s authoritative\nper-asset event \u2014 the route NEVER re-derives a due date or a status token.\n\n``compliance_status`` is the AUTHORITATIVE token from\n``compute_compliance_status`` (COMPLIANT / WARNING / NON_COMPLIANT /\nNOT_CALIBRATED), plus ``OUT_FOR_CALIBRATION`` when the instrument is currently\nshipped to a vendor (exactly how the app surfaces that state). It is therefore\na SUPERSET of ``InstrumentSummary.compliance_status`` (which never emits\nOUT_FOR_CALIBRATION). ``due_date`` is ``YYYY-MM-DD`` in the asset's SITE\ntimezone (the shared timezone contract \u2014 bucket by this, not by deriving a day\nfrom ``due_at`` in local time); ``due_at`` is the full ISO-8601 UTC instant.\nA never-calibrated instrument with an active plan is surfaced as a due-now\n``NOT_CALIBRATED`` needs-first-calibration item."
      },
      "EventCatalogEntry": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type"
          },
          "description": {
            "type": "string",
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "type",
          "description"
        ],
        "title": "EventCatalogEntry",
        "description": "One machine-readable event-type descriptor for integrator discovery."
      },
      "EventCatalogResponse": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/EventCatalogEntry"
            },
            "type": "array",
            "title": "Events"
          }
        },
        "type": "object",
        "required": [
          "events"
        ],
        "title": "EventCatalogResponse",
        "description": "The v1 event catalog: the full set of ``type`` values a webhook can carry."
      },
      "FieldRequirement": {
        "properties": {
          "field": {
            "type": "string",
            "title": "Field"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "requirement": {
            "type": "string",
            "title": "Requirement"
          },
          "required_by": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required By"
          },
          "request_field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Field"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "type": "object",
        "required": [
          "field",
          "label",
          "requirement"
        ],
        "title": "FieldRequirement",
        "description": "How a single standard-driven field is treated for the resolved standards.\n\n``requirement`` is the strictest-wins level across the resolved standards\n(``required`` > ``recommended`` > ``optional`` > ``hidden``). ``required_by``\nlists the labels of the resolved standards that make it REQUIRED (empty when\nonly the base floor requires it); it matches the write gate's 422 body\nverbatim. ``request_field`` (calibration scope only) is the POST body key that\nsatisfies the field, or ``null`` when it is set server-side or not settable via\nthe public API; ``note`` explains such cases."
      },
      "FieldRequirementsResponse": {
        "properties": {
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "source": {
            "type": "string",
            "enum": [
              "workspace",
              "query"
            ],
            "title": "Source"
          },
          "standards": {
            "items": {
              "$ref": "#/components/schemas/StandardSummary"
            },
            "type": "array",
            "title": "Standards"
          },
          "available_standards": {
            "items": {
              "$ref": "#/components/schemas/StandardSummary"
            },
            "type": "array",
            "title": "Available Standards"
          },
          "calibration": {
            "$ref": "#/components/schemas/FieldRequirementsScope"
          },
          "asset": {
            "$ref": "#/components/schemas/FieldRequirementsScope"
          }
        },
        "type": "object",
        "required": [
          "version",
          "source",
          "standards",
          "available_standards",
          "calibration",
          "asset"
        ],
        "title": "FieldRequirementsResponse",
        "description": "The machine-readable, standard-driven field requirements an integrator uses\nto pre-validate a calibration (or instrument) write before the server's\nenforcement gate rejects it.\n\n``source`` is ``workspace`` when the requirements reflect the workspace's\nselected standards, or ``query`` when they preview an explicit ``?standards=``\nset. ``available_standards`` is the full selectable catalog (for discovering\nvalid ``?standards=`` keys)."
      },
      "FieldRequirementsScope": {
        "properties": {
          "enforced": {
            "type": "boolean",
            "title": "Enforced"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/FieldRequirement"
            },
            "type": "array",
            "title": "Fields"
          }
        },
        "type": "object",
        "required": [
          "enforced",
          "fields"
        ],
        "title": "FieldRequirementsScope",
        "description": "The field-requirements for one scope (calibration or asset).\n\n``enforced`` states honestly whether the server REJECTS a public write that\nomits a REQUIRED field: the calibration POST does (422 FIELD_REQUIREMENTS_UNMET),\nbut POST /instruments does NOT enforce asset requirements (advisory only), so an\nintegrator must not rely on a rejection that won't happen."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InstrumentCreate": {
        "properties": {
          "asset_tag": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Asset Tag"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "manufacturer": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Manufacturer"
          },
          "model": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Model"
          },
          "serial_number": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Serial Number"
          },
          "category": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "department": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Department"
          },
          "location": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Location"
          },
          "tolerance_spec": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Tolerance Spec"
          },
          "unit_of_measure": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Of Measure"
          },
          "is_reference_standard": {
            "type": "boolean",
            "title": "Is Reference Standard",
            "default": false
          },
          "calibration_interval_value": {
            "type": "integer",
            "maximum": 100000.0,
            "minimum": 1.0,
            "title": "Calibration Interval Value"
          },
          "calibration_interval_unit": {
            "type": "string",
            "enum": [
              "days",
              "months",
              "years"
            ],
            "title": "Calibration Interval Unit",
            "description": "One of days, months, years.",
            "default": "months"
          },
          "last_calibration_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Calibration Date",
            "description": "Optional baseline: when the instrument was last calibrated. When provided, an approved baseline record is created so compliance is computed from it; when omitted the asset is 'Not Yet Calibrated'."
          },
          "customFields": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Customfields",
            "description": "Optional workspace-defined custom fields as a flat map of label -> value. Labels are stored exactly as sent. A blank value is dropped rather than stored."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "asset_tag",
          "name",
          "manufacturer",
          "model",
          "serial_number",
          "calibration_interval_value"
        ],
        "title": "InstrumentCreate",
        "description": "Create body for POST /instruments. Curated subset of the internal\nAssetCreate; unknown keys are rejected (422) so nothing leaks toward the\ninternal write path."
      },
      "InstrumentDetail": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "asset_tag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Tag"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "manufacturer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manufacturer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "serial_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serial Number"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "is_quarantined": {
            "type": "boolean",
            "title": "Is Quarantined",
            "default": false
          },
          "site_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site Id"
          },
          "location_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location Id"
          },
          "compliance_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliance Status"
          },
          "last_calibration_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Calibration At"
          },
          "next_due_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Due At"
          },
          "retired_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retired At",
            "description": "Tombstone marker: the ISO-8601 instant this instrument was retired (decommissioned), or null while active. Populated on retired rows surfaced via ?include=retired."
          },
          "deleted": {
            "type": "boolean",
            "title": "Deleted",
            "description": "Tombstone marker: true when this instrument has been retired (soft-archived) and should be treated as removed by a mirror. Always false on the default active-only list.",
            "default": false
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "department": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Department"
          },
          "location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location"
          },
          "tolerance_spec": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tolerance Spec"
          },
          "unit_of_measure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Of Measure"
          },
          "is_reference_standard": {
            "type": "boolean",
            "title": "Is Reference Standard",
            "default": false
          },
          "calibration_interval_value": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calibration Interval Value"
          },
          "calibration_interval_unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calibration Interval Unit"
          },
          "grace_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Days"
          },
          "customFields": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Customfields",
            "description": "Workspace-defined custom fields as a flat map of label -> value. Returned on the single-instrument detail only (not on the list)."
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "InstrumentDetail",
        "description": "The single-instrument projection: everything in the summary plus the\ncurated descriptive/scheduling fields."
      },
      "InstrumentSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "asset_tag": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Tag"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "manufacturer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Manufacturer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "serial_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serial Number"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "is_quarantined": {
            "type": "boolean",
            "title": "Is Quarantined",
            "default": false
          },
          "site_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site Id"
          },
          "location_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location Id"
          },
          "compliance_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliance Status"
          },
          "last_calibration_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Calibration At"
          },
          "next_due_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Due At"
          },
          "retired_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retired At",
            "description": "Tombstone marker: the ISO-8601 instant this instrument was retired (decommissioned), or null while active. Populated on retired rows surfaced via ?include=retired."
          },
          "deleted": {
            "type": "boolean",
            "title": "Deleted",
            "description": "Tombstone marker: true when this instrument has been retired (soft-archived) and should be treated as removed by a mirror. Always false on the default active-only list.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "InstrumentSummary",
        "description": "The list projection of an instrument \u2014 the identity + compliance state a\nclient needs to render a row without a second fetch."
      },
      "InstrumentUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "manufacturer": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Manufacturer"
          },
          "model": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "serial_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Serial Number"
          },
          "category": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "department": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Department"
          },
          "location": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Location"
          },
          "tolerance_spec": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Tolerance Spec"
          },
          "unit_of_measure": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit Of Measure"
          },
          "is_reference_standard": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Reference Standard"
          },
          "calibration_interval_value": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Calibration Interval Value"
          },
          "calibration_interval_unit": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "days",
                  "months",
                  "years"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Calibration Interval Unit"
          },
          "customFields": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customfields",
            "description": "Workspace-defined custom fields to set, as a flat map of label -> value. MERGES into the instrument's existing custom fields: labels you do not send are left alone, and sending a blank value removes that label. Omit the key entirely, or send null, to change nothing."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "InstrumentUpdate",
        "description": "Partial update body for PATCH /instruments/{id}. Only sent keys are\ntouched; unknown keys are rejected (422)."
      },
      "LocationSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "site_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Site Id"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "LocationSummary",
        "description": "A location within the workspace \u2014 the resolver for the ``location_id`` that\nthe instrument projections return and the ``location_id`` filter accepts. Each\nlocation rolls up to a ``site_id`` (its site), the multi-site access boundary."
      },
      "Page_CalibrationRecord_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/CalibrationRecord"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[CalibrationRecord]"
      },
      "Page_DocumentRecord_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/DocumentRecord"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[DocumentRecord]"
      },
      "Page_DueInstrument_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/DueInstrument"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[DueInstrument]"
      },
      "Page_InstrumentSummary_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/InstrumentSummary"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[InstrumentSummary]"
      },
      "Page_WebhookDeliveryRead_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryRead"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[WebhookDeliveryRead]"
      },
      "Page_WebhookRead_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WebhookRead"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[WebhookRead]"
      },
      "Pagination": {
        "properties": {
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          }
        },
        "type": "object",
        "required": [
          "limit",
          "offset",
          "total",
          "has_more"
        ],
        "title": "Pagination",
        "description": "Offset/limit pagination metadata returned alongside every list."
      },
      "SecretRotatedResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "secret": {
            "type": "string",
            "title": "Secret",
            "description": "The new signing secret, shown ONLY here."
          },
          "secret_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Prefix"
          }
        },
        "type": "object",
        "required": [
          "id",
          "secret"
        ],
        "title": "SecretRotatedResponse",
        "description": "The rotate-secret response \u2014 the new raw ``secret`` shown once."
      },
      "SiteSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timezone"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "SiteSummary"
      },
      "StandardSummary": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "label": {
            "type": "string",
            "title": "Label"
          }
        },
        "type": "object",
        "required": [
          "key",
          "label"
        ],
        "title": "StandardSummary",
        "description": "A compliance standard the workspace has selected."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WebhookCreate": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "title": "Url",
            "description": "HTTPS delivery URL. Validated for SSRF (must resolve to a public address; private/loopback/link-local/metadata targets are rejected)."
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events",
            "description": "Subset of the v1 event catalog to receive. Omit or send an empty list to subscribe to ALL events. Unknown types are rejected (422)."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Optional human-readable label for this endpoint."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "url"
        ],
        "title": "WebhookCreate",
        "description": "Subscribe request. ``events`` omitted/empty means \"all catalog events\"."
      },
      "WebhookCreatedResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events",
            "description": "Subscribed event types, or null for all catalog events."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "secret_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Prefix",
            "description": "Non-secret leading fragment of the signing secret (display only)."
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled At"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "secret": {
            "type": "string",
            "title": "Secret",
            "description": "The HMAC signing secret, shown ONLY here. Store it now \u2014 it cannot be retrieved again. Use it to verify the Axiospec-Signature header."
          }
        },
        "type": "object",
        "required": [
          "id",
          "url",
          "secret"
        ],
        "title": "WebhookCreatedResponse",
        "description": "The subscribe response \u2014 carries the raw ``secret`` EXACTLY ONCE."
      },
      "WebhookDeliveryRead": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "event_id": {
            "type": "string",
            "format": "uuid",
            "title": "Event Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "pending | failed | succeeded | exhausted."
          },
          "attempt_count": {
            "type": "integer",
            "title": "Attempt Count",
            "default": 0
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Attempt At"
          },
          "last_attempt_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Attempt At"
          },
          "last_status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Status Code"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "response_snippet": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Snippet"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "event_id",
          "event_type",
          "status"
        ],
        "title": "WebhookDeliveryRead",
        "description": "One row of the per-endpoint delivery log (observability/debugging).\n\nNever carries the signing secret or request headers; ``response_snippet`` is a\ntruncated, secret-free excerpt of the consumer's response body."
      },
      "WebhookRead": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events",
            "description": "Subscribed event types, or null for all catalog events."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "secret_prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Prefix",
            "description": "Non-secret leading fragment of the signing secret (display only)."
          },
          "disabled_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled At"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "url"
        ],
        "title": "WebhookRead",
        "description": "The safe endpoint projection \u2014 NEVER includes ``secret_key``."
      },
      "WebhookUpdate": {
        "properties": {
          "url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "New HTTPS delivery URL (re-validated for SSRF when changed)."
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events",
            "description": "Replacement event subset (empty/null = all events)."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Replacement label."
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active",
            "description": "Enable (true) or disable (false) delivery to this endpoint."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "WebhookUpdate",
        "description": "PATCH request. Only supplied fields are applied (exclude-unset semantics)."
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "BearerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ctk_ API key",
        "description": "A per-workspace API key (prefixed `ctk_`) created under Settings then API Keys. Send it as `Authorization: Bearer <key>`."
      },
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "The same API key sent in the `X-API-Key` header instead of `Authorization: Bearer`."
      }
    }
  },
  "servers": [
    {
      "url": "https://axiospec.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "BearerApiKey": []
    },
    {
      "ApiKeyHeader": []
    }
  ]
}
