{
  "openapi": "3.1.1",
  "info": {
    "title": "KHEMS API Portal — existing HTTP contract",
    "version": "2.2.0",
    "description": "Current HTTP contract including public API documentation, integrated session revocation and the public/protected health split. Describes authored behavior, not enabled capabilities or provider readiness. Supported aliases, producer-specific envelopes and retry identities are documented below. The legacy /admin/sessions/revoke action route has been removed after consumer migration."
  },
  "servers": [
    {
      "url": "/",
      "description": "Worker-relative paths. Consumer proxies may add /api and remove it before forwarding; hosted domain mappings are configured separately."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "reference"
    },
    {
      "name": "facilities"
    },
    {
      "name": "equipment"
    },
    {
      "name": "yardchecks"
    },
    {
      "name": "visits"
    },
    {
      "name": "documents"
    },
    {
      "name": "admin"
    },
    {
      "name": "workspace"
    },
    {
      "name": "session"
    },
    {
      "name": "health"
    },
    {
      "name": "Compatibility aliases",
      "description": "Alternate URLs for existing canonical operations. Use the canonical endpoint for new integrations."
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "get_api_reference",
        "summary": "Read the KHEMS API reference",
        "tags": [
          "reference"
        ],
        "description": "Available only on api.kairharborexpress.com. HEAD returns GET response headers with no body. Operational OPTIONS retains shared preflight handling.",
        "security": [],
        "servers": [
          {
            "url": "https://api.kairharborexpress.com"
          }
        ],
        "x-permission": "Public documentation",
        "x-facility-scope": "none",
        "responses": {
          "200": {
            "description": "Static reference generated from the API contract.",
            "content": {
              "text/html": {
                "schema": {
                  "$ref": "#/components/schemas/ApiReferenceHtml"
                }
              }
            }
          },
          "405": {
            "description": "Only GET and HEAD are supported. Allow: GET, HEAD.",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string",
                  "const": "GET, HEAD"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Documentation is static and does not access user or provider data."
          }
        }
      },
      "head": {
        "operationId": "head_api_reference",
        "summary": "Read the KHEMS API reference",
        "tags": [
          "reference"
        ],
        "description": "Available only on api.kairharborexpress.com. HEAD returns GET response headers with no body. Operational OPTIONS retains shared preflight handling.",
        "security": [],
        "servers": [
          {
            "url": "https://api.kairharborexpress.com"
          }
        ],
        "x-permission": "Public documentation",
        "x-facility-scope": "none",
        "responses": {
          "200": {
            "description": "Headers for the static reference; no response body."
          },
          "405": {
            "description": "Only GET and HEAD are supported. Allow: GET, HEAD.",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string",
                  "const": "GET, HEAD"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Documentation is static and does not access user or provider data."
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "get_public_openapi",
        "summary": "Download the public OpenAPI contract",
        "tags": [
          "reference"
        ],
        "description": "Available only on api.kairharborexpress.com. HEAD returns GET response headers with no body. Operational OPTIONS retains shared preflight handling.",
        "security": [],
        "servers": [
          {
            "url": "https://api.kairharborexpress.com"
          }
        ],
        "x-permission": "Public documentation",
        "x-facility-scope": "none",
        "responses": {
          "200": {
            "description": "Static reference generated from the API contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOpenApiDocument"
                }
              }
            }
          },
          "405": {
            "description": "Only GET and HEAD are supported. Allow: GET, HEAD.",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string",
                  "const": "GET, HEAD"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Documentation is static and does not access user or provider data."
          }
        }
      },
      "head": {
        "operationId": "head_public_openapi",
        "summary": "Download the public OpenAPI contract",
        "tags": [
          "reference"
        ],
        "description": "Available only on api.kairharborexpress.com. HEAD returns GET response headers with no body. Operational OPTIONS retains shared preflight handling.",
        "security": [],
        "servers": [
          {
            "url": "https://api.kairharborexpress.com"
          }
        ],
        "x-permission": "Public documentation",
        "x-facility-scope": "none",
        "responses": {
          "200": {
            "description": "Headers for the static reference; no response body."
          },
          "405": {
            "description": "Only GET and HEAD are supported. Allow: GET, HEAD.",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string",
                  "const": "GET, HEAD"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Documentation is static and does not access user or provider data."
          }
        }
      }
    },
    "/facilities": {
      "get": {
        "operationId": "get_facilities",
        "summary": "List facilities",
        "tags": [
          "facilities"
        ],
        "description": "Default service=yms preserves the existing YMS-authorized warehouse list and capabilities. service=admin returns shared warehouse/transport metadata, including inactive facilities, only for ADMIN.MANAGE_USERS or ADMIN.MANAGE_FACILITIES. Query parameters never grant access.",
        "x-permission": "service=yms: YMS.ACCESS; service=admin: ADMIN.MANAGE_USERS or ADMIN.MANAGE_FACILITIES",
        "x-facility-scope": "global administrator operation; facility bound by path where present",
        "responses": {
          "200": {
            "$ref": "#/components/responses/FacilityListResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "yms",
                "admin"
              ],
              "default": "yms"
            }
          }
        ]
      },
      "post": {
        "operationId": "post_facilities",
        "summary": "Create a facility",
        "tags": [
          "facilities"
        ],
        "x-facility-scope": "global administrator operation; facility bound by path where present",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "201": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacilityCreate"
              }
            }
          }
        },
        "description": "Administrator-authorized, audited creation. operationId binds the actor and immutable input for safe retries. Optional YMS setup retains provider-readiness validation. Request size limited to 16 KiB."
      }
    },
    "/yms/facilities": {
      "get": {
        "operationId": "get_yms_facilities",
        "summary": "List facilities",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Default service=yms preserves the existing YMS-authorized warehouse list and capabilities. service=admin returns shared warehouse/transport metadata, including inactive facilities, only for ADMIN.MANAGE_USERS or ADMIN.MANAGE_FACILITIES. Query parameters never grant access.",
        "x-permission": "service=yms: YMS.ACCESS; service=admin: ADMIN.MANAGE_USERS or ADMIN.MANAGE_FACILITIES",
        "x-facility-scope": "global administrator operation; facility bound by path where present",
        "responses": {
          "200": {
            "$ref": "#/components/responses/FacilityListResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "yms",
                "admin"
              ],
              "default": "yms"
            }
          }
        ],
        "x-alias-of": "/facilities"
      }
    },
    "/equipment": {
      "get": {
        "operationId": "get_equipment",
        "summary": "Yms Yard",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/EquipmentStateResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/yms/yard": {
      "get": {
        "operationId": "get_yms_yard",
        "summary": "Yms Yard",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/EquipmentStateResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/yardchecks/current": {
      "get": {
        "operationId": "get_yardchecks_current",
        "summary": "Yms Yardcheck",
        "tags": [
          "yardchecks"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.YARDCHECK",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "post_yardchecks_current",
        "summary": "Yms Yardcheck",
        "tags": [
          "yardchecks"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.YARDCHECK",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Yardcheck"
              }
            }
          }
        }
      }
    },
    "/yms/yardcheck": {
      "get": {
        "operationId": "get_yms_yardcheck",
        "summary": "Yms Yardcheck",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.YARDCHECK",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/yardchecks/current",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "post_yms_yardcheck",
        "summary": "Yms Yardcheck",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.YARDCHECK",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/yardchecks/current",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Yardcheck"
              }
            }
          }
        }
      }
    },
    "/yardchecks": {
      "get": {
        "operationId": "get_yardchecks",
        "summary": "Yms Yardcheck History",
        "tags": [
          "yardchecks"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "beforeSequence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "Positive safe-integer sequence, supplied as a query string."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/yms/yardchecks": {
      "get": {
        "operationId": "get_yms_yardchecks",
        "summary": "Yms Yardcheck History",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/yardchecks",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "beforeSequence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            },
            "description": "Positive safe-integer sequence, supplied as a query string."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/visits": {
      "get": {
        "operationId": "get_visits",
        "summary": "Yms Active Visits",
        "tags": [
          "visits"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ActiveVisitsResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/yms/visits": {
      "get": {
        "operationId": "get_yms_visits",
        "summary": "Yms Active Visits",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/visits",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ActiveVisitsResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/visits/check-in": {
      "post": {
        "operationId": "post_visits_check_in",
        "summary": "Yms Visit Check In",
        "tags": [
          "visits"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GateObservation"
              }
            }
          }
        }
      }
    },
    "/yms/visits/check-in": {
      "post": {
        "operationId": "post_yms_visits_check_in",
        "summary": "Yms Visit Check In",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/visits/check-in",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GateObservation"
              }
            }
          }
        }
      }
    },
    "/visits/check-out": {
      "post": {
        "operationId": "post_visits_check_out",
        "summary": "Yms Visit Check Out",
        "tags": [
          "visits"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GateObservation"
              }
            }
          }
        }
      }
    },
    "/yms/visits/check-out": {
      "post": {
        "operationId": "post_yms_visits_check_out",
        "summary": "Yms Visit Check Out",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/visits/check-out",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GateObservation"
              }
            }
          }
        }
      }
    },
    "/visits/close-driver": {
      "post": {
        "operationId": "post_visits_close_driver",
        "summary": "Yms Driver Visit Close",
        "tags": [
          "visits"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GateObservation"
              }
            }
          }
        }
      }
    },
    "/yms/visits/close-driver": {
      "post": {
        "operationId": "post_yms_visits_close_driver",
        "summary": "Yms Driver Visit Close",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/visits/close-driver",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GateObservation"
              }
            }
          }
        }
      }
    },
    "/visits/assign-dock": {
      "post": {
        "operationId": "post_visits_assign_dock",
        "summary": "Yms Dock Assignment",
        "tags": [
          "visits"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.ASSIGN_DOCK",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DockAssignment"
              }
            }
          }
        }
      }
    },
    "/yms/visits/assign-dock": {
      "post": {
        "operationId": "post_yms_visits_assign_dock",
        "summary": "Yms Dock Assignment",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.ASSIGN_DOCK",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/visits/assign-dock",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DockAssignment"
              }
            }
          }
        }
      }
    },
    "/equipment/queued-checkout": {
      "post": {
        "operationId": "post_equipment_queued_checkout",
        "summary": "Queued Checkout",
        "tags": [
          "equipment"
        ],
        "description": "Request body bounded to 64 KiB. At most seven unique manifest photos. Same operation and immutable input are used for retries.",
        "x-permission": "direction: inbound YMS.CHECK_IN; outbound YMS.CHECK_OUT; recordedByUserId must equal actor",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueuedObservation"
              }
            }
          }
        }
      }
    },
    "/equipment/queued-checkout/photo": {
      "post": {
        "operationId": "post_equipment_queued_checkout_photo",
        "summary": "Queued Checkout Photo",
        "tags": [
          "equipment"
        ],
        "description": "Multipart body bounded to 6 MiB. File up to 5 MiB; immutable manifest and reserved Drive object are checked before completion.",
        "x-permission": "YMS.UPLOAD; original receipt owner",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/QueuedPhoto"
              }
            }
          }
        }
      }
    },
    "/equipment/queued-checkout/state": {
      "get": {
        "operationId": "get_equipment_queued_checkout_state",
        "summary": "Queued Checkout State",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/equipment/movements": {
      "post": {
        "operationId": "post_equipment_movements",
        "summary": "Yms Asset Movement",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "direction: inbound YMS.CHECK_IN; outbound YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Observation"
              }
            }
          }
        }
      }
    },
    "/yms/movement": {
      "post": {
        "operationId": "post_yms_movement",
        "summary": "Yms Asset Movement",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "direction: inbound YMS.CHECK_IN; outbound YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/movements",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Observation"
              }
            }
          }
        }
      }
    },
    "/equipment/movements/pending": {
      "get": {
        "operationId": "get_equipment_movements_pending",
        "summary": "Yms Pending Reconciliations",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Opaque facility/snapshot-bound cursor; fixed page size 50."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PendingMovementsResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/equipment/movements/recent": {
      "get": {
        "operationId": "get_equipment_movements_recent",
        "summary": "Yms Recent Responses",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/RecentMovementsResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/yms/responses": {
      "get": {
        "operationId": "get_yms_responses",
        "summary": "Yms Recent Responses",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/movements/recent",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/RecentMovementsResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/equipment/movements/correct": {
      "post": {
        "operationId": "post_equipment_movements_correct",
        "summary": "Yms Response Correction",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CORRECT_ID or YMS.CORRECT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponseCorrection"
              }
            }
          }
        }
      }
    },
    "/yms/responses/correct": {
      "post": {
        "operationId": "post_yms_responses_correct",
        "summary": "Yms Response Correction",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CORRECT_ID or YMS.CORRECT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/movements/correct",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponseCorrection"
              }
            }
          }
        }
      }
    },
    "/equipment/update": {
      "post": {
        "operationId": "post_equipment_update",
        "summary": "Yms Equipment Update",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "set_load_status: YMS.UPDATE_LOAD_STATUS; mount/unmount: YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EquipmentUpdate"
              }
            }
          }
        }
      }
    },
    "/yms/equipment/update": {
      "post": {
        "operationId": "post_yms_equipment_update",
        "summary": "Yms Equipment Update",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "set_load_status: YMS.UPDATE_LOAD_STATUS; mount/unmount: YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/update",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EquipmentUpdate"
              }
            }
          }
        }
      }
    },
    "/equipment/rename": {
      "post": {
        "operationId": "post_equipment_rename",
        "summary": "Yms Equipment Rename",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CORRECT_ID or YMS.CORRECT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EquipmentRename"
              }
            }
          }
        }
      }
    },
    "/yms/equipment/rename": {
      "post": {
        "operationId": "post_yms_equipment_rename",
        "summary": "Yms Equipment Rename",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CORRECT_ID or YMS.CORRECT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/rename",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EquipmentRename"
              }
            }
          }
        }
      }
    },
    "/equipment/type": {
      "post": {
        "operationId": "post_equipment_type",
        "summary": "Yms Equipment Type Correction",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CORRECT_ID or YMS.CORRECT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EquipmentType"
              }
            }
          }
        }
      }
    },
    "/yms/equipment/type": {
      "post": {
        "operationId": "post_yms_equipment_type",
        "summary": "Yms Equipment Type Correction",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CORRECT_ID or YMS.CORRECT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/type",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EquipmentType"
              }
            }
          }
        }
      }
    },
    "/equipment/repair": {
      "post": {
        "operationId": "post_equipment_repair",
        "summary": "Yms Repair",
        "tags": [
          "equipment"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Repair"
              }
            }
          }
        }
      }
    },
    "/yms/repair": {
      "post": {
        "operationId": "post_yms_repair",
        "summary": "Yms Repair",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/repair",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Repair"
              }
            }
          }
        }
      }
    },
    "/equipment/ingate": {
      "post": {
        "operationId": "post_equipment_ingate",
        "summary": "Yms Ingate",
        "tags": [
          "equipment"
        ],
        "description": "Compatibility observation intake; direction and container/chassis equipment type are imposed by the handler. HTTP validates operation/facility identity; observation fields are retained and projected downstream.",
        "x-permission": "YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Operation"
              }
            }
          }
        }
      }
    },
    "/yms/ingate": {
      "post": {
        "operationId": "post_yms_ingate",
        "summary": "Yms Ingate",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Compatibility observation intake; direction and container/chassis equipment type are imposed by the handler. HTTP validates operation/facility identity; observation fields are retained and projected downstream.",
        "x-permission": "YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/ingate",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Operation"
              }
            }
          }
        }
      }
    },
    "/equipment/checkout": {
      "post": {
        "operationId": "post_equipment_checkout",
        "summary": "Yms Checkout",
        "tags": [
          "equipment"
        ],
        "description": "Compatibility observation intake; direction and container/chassis equipment type are imposed by the handler. HTTP validates operation/facility identity; observation fields are retained and projected downstream.",
        "x-permission": "YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Operation"
              }
            }
          }
        }
      }
    },
    "/yms/checkout": {
      "post": {
        "operationId": "post_yms_checkout",
        "summary": "Yms Checkout",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Compatibility observation intake; direction and container/chassis equipment type are imposed by the handler. HTTP validates operation/facility identity; observation fields are retained and projected downstream.",
        "x-permission": "YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/checkout",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Operation"
              }
            }
          }
        }
      }
    },
    "/equipment/chassis/ingate": {
      "post": {
        "operationId": "post_equipment_chassis_ingate",
        "summary": "Yms Chassis Ingate",
        "tags": [
          "equipment"
        ],
        "description": "Compatibility observation intake; direction and container/chassis equipment type are imposed by the handler. HTTP validates operation/facility identity; observation fields are retained and projected downstream.",
        "x-permission": "YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Operation"
              }
            }
          }
        }
      }
    },
    "/yms/chassis/ingate": {
      "post": {
        "operationId": "post_yms_chassis_ingate",
        "summary": "Yms Chassis Ingate",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Compatibility observation intake; direction and container/chassis equipment type are imposed by the handler. HTTP validates operation/facility identity; observation fields are retained and projected downstream.",
        "x-permission": "YMS.CHECK_IN",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/chassis/ingate",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Operation"
              }
            }
          }
        }
      }
    },
    "/equipment/chassis/checkout": {
      "post": {
        "operationId": "post_equipment_chassis_checkout",
        "summary": "Yms Chassis Checkout",
        "tags": [
          "equipment"
        ],
        "description": "Compatibility observation intake; direction and container/chassis equipment type are imposed by the handler. HTTP validates operation/facility identity; observation fields are retained and projected downstream.",
        "x-permission": "YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Operation"
              }
            }
          }
        }
      }
    },
    "/yms/chassis/checkout": {
      "post": {
        "operationId": "post_yms_chassis_checkout",
        "summary": "Yms Chassis Checkout",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Compatibility observation intake; direction and container/chassis equipment type are imposed by the handler. HTTP validates operation/facility identity; observation fields are retained and projected downstream.",
        "x-permission": "YMS.CHECK_OUT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/equipment/chassis/checkout",
        "responses": {
          "200": {
            "$ref": "#/components/responses/MovementReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Operation"
              }
            }
          }
        }
      }
    },
    "/documents/photo": {
      "post": {
        "operationId": "post_documents_photo",
        "summary": "Yms Photo",
        "tags": [
          "documents"
        ],
        "description": "Bounded multipart upload (6 MiB request, 5 MiB file); may fail after movement is durably saved.",
        "x-permission": "YMS.UPLOAD",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/PhotoReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PhotoUpload"
              }
            }
          }
        }
      }
    },
    "/yms/photo": {
      "post": {
        "operationId": "post_yms_photo",
        "summary": "Yms Photo",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Bounded multipart upload (6 MiB request, 5 MiB file); may fail after movement is durably saved.",
        "x-permission": "YMS.UPLOAD",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/documents/photo",
        "responses": {
          "200": {
            "$ref": "#/components/responses/PhotoReceiptResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PhotoUpload"
              }
            }
          }
        }
      }
    },
    "/documents/photos": {
      "get": {
        "operationId": "get_documents_photos",
        "summary": "Yms Photo Search",
        "tags": [
          "documents"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PhotoCategory"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PhotoSearchResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/yms/photos": {
      "get": {
        "operationId": "get_yms_photos",
        "summary": "Yms Photo Search",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "YMS.VIEW",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/documents/photos",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PhotoCategory"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "pageToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PhotoSearchResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/yardchecks/corrections": {
      "post": {
        "operationId": "post_yardchecks_corrections",
        "summary": "Yms Reconcile",
        "tags": [
          "yardchecks"
        ],
        "description": "Reads facility Corrections tab and applies up to 25 actionable rows. Sheet edits alone do not authorize changes; partial saves remain durable if Sheet status write fails.",
        "x-permission": "YMS.RECONCILE; database YMS.CORRECT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "responses": {
          "200": {
            "$ref": "#/components/responses/ReconciliationResultResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacilityRequest"
              }
            }
          }
        }
      }
    },
    "/yms/reconcile": {
      "post": {
        "operationId": "post_yms_reconcile",
        "summary": "Yms Reconcile",
        "tags": [
          "Compatibility aliases"
        ],
        "description": "Reads facility Corrections tab and applies up to 25 actionable rows. Sheet edits alone do not authorize changes; partial saves remain durable if Sheet status write fails.",
        "x-permission": "YMS.RECONCILE; database YMS.CORRECT",
        "x-facility-scope": "facilityId in query/body; canonical server authorization",
        "x-alias-of": "/yardchecks/corrections",
        "responses": {
          "200": {
            "$ref": "#/components/responses/ReconciliationResultResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacilityRequest"
              }
            }
          }
        }
      }
    },
    "/admin/provisioning/catalog": {
      "get": {
        "operationId": "get_admin_provisioning_catalog",
        "summary": "Provisioning Catalog",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "Database-enforced administration catalog access",
        "x-facility-scope": "handler-specific",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/admin/provisioning/requests": {
      "get": {
        "operationId": "get_admin_provisioning_requests",
        "summary": "Provisioning Requests",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "Database-enforced administration history access",
        "x-facility-scope": "handler-specific",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 25
            },
            "description": "Clamped to 1..100; non-integer falls back to 25."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/admin/provisioning/users": {
      "post": {
        "operationId": "post_admin_provisioning_users",
        "summary": "User Provisioning",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "201": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserProvision"
              }
            }
          }
        }
      }
    },
    "/admin/provisioning/facilities": {
      "post": {
        "operationId": "post_admin_provisioning_facilities",
        "summary": "Create a facility",
        "tags": [
          "Compatibility aliases"
        ],
        "x-facility-scope": "global administrator operation; facility bound by path where present",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "201": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacilityCreate"
              }
            }
          }
        },
        "description": "Administrator-authorized, audited creation. operationId binds the actor and immutable input for safe retries. Optional YMS setup retains provider-readiness validation. Request size limited to 16 KiB.",
        "x-alias-of": "/facilities"
      }
    },
    "/admin/provisioning/facilities/disable": {
      "post": {
        "operationId": "post_admin_provisioning_facilities_disable",
        "summary": "Disable a facility",
        "tags": [
          "Compatibility aliases"
        ],
        "x-facility-scope": "global administrator operation; facility bound by path where present",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacilityDisable"
              }
            }
          }
        },
        "description": "Compatibility URL for facility disable. Supply facilityId in the body instead of the path; permission, audit and retry rules are unchanged.",
        "x-alias-of": "/facilities/{facilityId}/disable"
      }
    },
    "/admin/sheets/maintenance/preview": {
      "get": {
        "operationId": "get_admin_sheets_maintenance_preview",
        "summary": "Sheet Maintenance Preview",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "x-facility-scope": "global",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/admin/sheets/maintenance/apply": {
      "post": {
        "operationId": "post_admin_sheets_maintenance_apply",
        "summary": "Sheet Maintenance Apply",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "x-facility-scope": "global",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SheetMaintenance"
              }
            }
          }
        }
      }
    },
    "/admin/archives/status": {
      "get": {
        "operationId": "get_admin_archives_status",
        "summary": "Archive Retention Status",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "x-facility-scope": "global",
        "parameters": [
          {
            "name": "facilityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/admin/archives/verify": {
      "post": {
        "operationId": "post_admin_archives_verify",
        "summary": "Archive Prune Verification",
        "tags": [
          "admin"
        ],
        "description": "Independent verification only; returns pruningEnabled=false. Never enables or invokes pruning.",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "x-facility-scope": "global",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArchiveVerification"
              }
            }
          }
        }
      }
    },
    "/workspace/apps": {
      "get": {
        "operationId": "get_workspace_apps",
        "summary": "Workspace Apps",
        "tags": [
          "workspace"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "Canonical per-app authorization; no partial catalog on provider failure",
        "x-facility-scope": "handler-specific",
        "responses": {
          "200": {
            "$ref": "#/components/responses/WorkspaceAppsResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/session": {
      "get": {
        "operationId": "get_session",
        "summary": "Session",
        "tags": [
          "session"
        ],
        "description": "GET only. Missing bearer returns 200 with authenticated=false and session=null. Authenticated reads verify the provider and canonical session validity on every request. Invalid/revoked sessions return 401; uncertain verification returns 503 and must preserve local credentials and drafts. The same handler is reachable at the login origin /session before login page method handling.",
        "x-permission": "Optional bearer session",
        "x-facility-scope": "handler-specific",
        "responses": {
          "200": {
            "$ref": "#/components/responses/SessionResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "get_health",
        "summary": "Health",
        "tags": [
          "health"
        ],
        "description": "GET only. Returns the success envelope with body {status:ok}; does not probe providers, reveal configuration, or certify readiness. HTML diagnostics moved to protected /admin/health.",
        "x-permission": "Public liveness",
        "x-facility-scope": "none",
        "responses": {
          "200": {
            "$ref": "#/components/responses/PublicHealthResponse"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": []
      }
    },
    "/admin/access/users": {
      "get": {
        "operationId": "get_admin_access_users",
        "summary": "Access Users",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 800,
              "default": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 160
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/AccessUsersResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/admin/access/roles": {
      "get": {
        "operationId": "get_admin_access_roles",
        "summary": "Access Roles",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "responses": {
          "200": {
            "$ref": "#/components/responses/AccessRolesResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/admin/access/role": {
      "get": {
        "operationId": "get_admin_access_role",
        "summary": "Access Editor",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "parameters": [
          {
            "name": "roleId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "post_admin_access_role",
        "summary": "Access Editor",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessRoleEdit"
              }
            }
          }
        }
      }
    },
    "/admin/access/assignments": {
      "get": {
        "operationId": "get_admin_access_assignments",
        "summary": "Access Editor",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "post_admin_access_assignments",
        "summary": "Access Editor",
        "tags": [
          "admin"
        ],
        "description": "Existing endpoint; behavior and validation are owned by the linked source handler.",
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessAssignmentsEdit"
              }
            }
          }
        }
      }
    },
    "/admin/health": {
      "get": {
        "summary": "Protected diagnostics",
        "description": "GET only. Requires canonical active session and global ADMIN.MANAGE_USERS. Probe failures remain in a 200 report; authorization probe uncertainty is 503/diagnostics_unavailable. format=html or Accept:text/html selects HTML unless format=json.",
        "tags": [
          "admin"
        ],
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "operationId": "get_admin_health",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "html",
                "json"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/HealthResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/admin/sessions/capabilities": {
      "get": {
        "summary": "Session revocation capability",
        "description": "GET only; authentication and global authorization checked before reading capability state.",
        "tags": [
          "admin"
        ],
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "operationId": "get_admin_sessions_capabilities",
        "responses": {
          "200": {
            "$ref": "#/components/responses/SessionRevocationCapabilityResponse"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/admin/session-revocations": {
      "post": {
        "summary": "Revoke user sessions",
        "description": "POST only. Canonical authentication and global authorization precede body validation. Completed receipt is idempotent for actor, target and operation ID; 409/operation_conflict on conflicting reuse. Capability disabled is 503/session_revocation_disabled; uncertain completion is 503/session_revocation_unavailable. Retry with the same IDs and no automatic replay. Backend validates exact completed receipt before reporting success.",
        "tags": [
          "admin"
        ],
        "x-permission": "ADMIN.MANAGE_USERS",
        "x-facility-scope": "global",
        "operationId": "post_admin_session_revocations",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionRevocationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SessionRevocationResponse"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/facilities/{facilityId}": {
      "get": {
        "operationId": "get_facility",
        "summary": "Read facility metadata",
        "tags": [
          "facilities"
        ],
        "x-facility-scope": "global administrator operation; facility bound by path where present",
        "x-permission": "ADMIN.MANAGE_USERS or ADMIN.MANAGE_FACILITIES",
        "responses": {
          "200": {
            "description": "Shared facility metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "allowed",
                    "body",
                    "correlationId"
                  ],
                  "properties": {
                    "allowed": {
                      "const": true
                    },
                    "correlationId": {
                      "type": "string"
                    },
                    "body": {
                      "type": "object",
                      "required": [
                        "facility"
                      ],
                      "properties": {
                        "facility": {
                          "$ref": "#/components/schemas/ManagedFacility"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "facilityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_facility",
        "summary": "Edit facility metadata",
        "tags": [
          "facilities"
        ],
        "x-facility-scope": "global administrator operation; facility bound by path where present",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "facilityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FacilityPatch"
              }
            }
          }
        },
        "description": "Audited partial update of name, address, or timezone. Code, type, activation, and resource mappings are immutable through this operation. Requires expectedUpdatedAt to reject concurrent changes. Successful retries return the original receipt before rechecking that version. 16 KiB request limit."
      }
    },
    "/facilities/{facilityId}/disable": {
      "post": {
        "operationId": "post_facility_disable",
        "summary": "Disable a facility",
        "tags": [
          "facilities"
        ],
        "x-facility-scope": "global administrator operation; facility bound by path where present",
        "x-permission": "ADMIN.MANAGE_FACILITIES",
        "responses": {
          "200": {
            "$ref": "#/components/responses/JsonValueResponse"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "facilityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "operationId",
                  "reason"
                ],
                "additionalProperties": false,
                "properties": {
                  "operationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "facilityId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional compatibility identity; must match the URL if supplied."
                  }
                }
              }
            }
          }
        },
        "description": "Disables a facility through the existing audited provisioning workflow. Retains data and requires a reason."
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Supabase user access token. Browser recovery and immediate revocation upgrades are coordinated separately; no cookie authentication is claimed by this contract."
      }
    },
    "schemas": {
      "JsonValue": {
        "description": "Extensible JSON returned by the backing RPC; domain fields are not frozen by this inventory."
      },
      "Error": {
        "type": "object",
        "properties": {
          "allowed": {
            "const": false
          },
          "correlationId": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "body": {
            "$ref": "#/components/schemas/JsonValue"
          }
        },
        "required": [
          "allowed",
          "correlationId",
          "error",
          "code",
          "body"
        ],
        "additionalProperties": true
      },
      "Success": {
        "type": "object",
        "properties": {
          "allowed": {
            "const": true
          },
          "correlationId": {
            "type": "string"
          },
          "body": {
            "$ref": "#/components/schemas/JsonValue"
          }
        },
        "required": [
          "allowed",
          "correlationId",
          "body"
        ],
        "additionalProperties": true
      },
      "Operation": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "facilityId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "operationId",
          "facilityId"
        ],
        "additionalProperties": true,
        "description": "Existing body operationId is the durable retry identity. No Idempotency-Key header is implemented."
      },
      "Observation": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "facilityId": {
            "type": "string",
            "format": "uuid"
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "equipmentType": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "visitId": {
            "type": "string",
            "format": "uuid"
          },
          "containerNumber": {
            "type": "string"
          },
          "chassisNumber": {
            "type": "string"
          },
          "trailerNumber": {
            "type": "string"
          },
          "tractorNumber": {
            "type": "string"
          },
          "plate": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string"
          },
          "physicalConfirmed": {
            "type": "boolean"
          },
          "notes": {
            "type": "string"
          }
        },
        "required": [
          "operationId",
          "facilityId",
          "direction"
        ],
        "additionalProperties": true,
        "description": "The HTTP intake validates identity and direction, then journals the observation. Projection/business validation happens downstream. Do not apply the older unused validateAssetMovement/validateArrival schemas to this intake."
      },
      "GateObservation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "equipmentType": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "visitId": {
                "type": "string",
                "format": "uuid"
              },
              "departureType": {
                "type": "string"
              },
              "confirmed": {
                "type": "boolean"
              },
              "expectedArrivedAt": {
                "type": "string"
              },
              "occurredAt": {
                "type": "string"
              }
            },
            "additionalProperties": true,
            "description": "Direction is imposed by the handler; check-out maps departureType and confirmed, close-driver imposes driver-close/bobtail. Other observation fields are retained."
          }
        ]
      },
      "QueuedObservation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Observation"
          },
          {
            "type": "object",
            "properties": {
              "recordedByUserId": {
                "type": "string",
                "format": "uuid"
              },
              "photoManifest": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PhotoManifestItem"
                },
                "maxItems": 7
              }
            },
            "required": [
              "recordedByUserId",
              "photoManifest"
            ],
            "additionalProperties": true
          }
        ]
      },
      "PhotoManifestItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "digestSHA256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "mimeType": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/png",
              "image/webp"
            ]
          },
          "category": {
            "$ref": "#/components/schemas/PhotoCategory"
          },
          "caption": {
            "type": "string",
            "maxLength": 240
          },
          "capturedAt": {
            "type": "string",
            "maxLength": 40
          }
        },
        "required": [
          "id",
          "digestSHA256",
          "mimeType",
          "category",
          "caption",
          "capturedAt"
        ],
        "additionalProperties": true
      },
      "PhotoCategory": {
        "type": "string",
        "enum": [
          "container",
          "empty_container",
          "chassis",
          "seal",
          "tractor",
          "plate",
          "trailer",
          "visitor_id",
          "driver_id",
          "other"
        ]
      },
      "Repair": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "containerNumber": {
                "type": "string"
              },
              "oldChassisNumber": {
                "type": "string"
              },
              "newChassisNumber": {
                "type": "string"
              },
              "pairConfirmed": {
                "const": true
              }
            },
            "required": [
              "containerNumber",
              "oldChassisNumber",
              "newChassisNumber",
              "pairConfirmed"
            ],
            "additionalProperties": true
          }
        ]
      },
      "EquipmentUpdate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "containerVisitId": {
                "type": "string",
                "format": "uuid"
              },
              "action": {
                "type": "string",
                "enum": [
                  "mount",
                  "unmount",
                  "set_load_status"
                ]
              },
              "physicalConfirmed": {
                "const": true
              },
              "expectedUpdatedAt": {
                "type": "string"
              },
              "expectedChassis": {
                "type": "string"
              },
              "expectedLoadStatus": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "loaded",
                  "empty",
                  null
                ]
              },
              "chassisNumber": {
                "type": "string"
              },
              "loadStatus": {
                "type": "string",
                "enum": [
                  "loaded",
                  "empty"
                ]
              },
              "devanned": {
                "type": "boolean"
              },
              "location": {
                "type": "string",
                "maxLength": 64
              },
              "reason": {
                "type": "string",
                "maxLength": 500
              }
            },
            "required": [
              "containerVisitId",
              "action",
              "physicalConfirmed",
              "expectedUpdatedAt",
              "expectedChassis"
            ],
            "additionalProperties": true,
            "description": "mount requires chassisNumber; set_load_status requires loadStatus. devanned=true requires set_load_status/empty. Dates and equipment numbers are validated by the handler."
          }
        ]
      },
      "EquipmentRename": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "visitId": {
                "type": "string",
                "format": "uuid"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "container",
                  "chassis"
                ]
              },
              "expectedNumber": {
                "type": "string"
              },
              "newNumber": {
                "type": "string"
              },
              "reason": {
                "type": "string",
                "minLength": 5,
                "maxLength": 500
              },
              "physicalConfirmed": {
                "const": true
              }
            },
            "required": [
              "visitId",
              "kind",
              "expectedNumber",
              "newNumber",
              "reason",
              "physicalConfirmed"
            ],
            "additionalProperties": true
          }
        ]
      },
      "EquipmentType": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "visitId": {
                "type": "string",
                "format": "uuid"
              },
              "expectedType": {
                "type": "string",
                "enum": [
                  "chassis",
                  "flatbed",
                  "stepdeck",
                  "lowboy"
                ]
              },
              "newType": {
                "type": "string",
                "enum": [
                  "chassis",
                  "flatbed",
                  "stepdeck",
                  "lowboy"
                ]
              },
              "reason": {
                "type": "string",
                "minLength": 5,
                "maxLength": 500
              },
              "physicalConfirmed": {
                "const": true
              }
            },
            "required": [
              "visitId",
              "expectedType",
              "newType",
              "reason",
              "physicalConfirmed"
            ],
            "additionalProperties": true
          }
        ]
      },
      "ResponseCorrection": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "eventId": {
                "type": "string",
                "format": "uuid"
              },
              "expectedFingerprint": {
                "type": "string",
                "pattern": "^[a-fA-F0-9]{32}$"
              },
              "reason": {
                "type": "string",
                "minLength": 5,
                "maxLength": 500
              },
              "confirmed": {
                "const": true
              },
              "response": {
                "type": "object",
                "properties": {
                  "direction": {
                    "type": "string",
                    "enum": [
                      "inbound",
                      "outbound"
                    ]
                  },
                  "equipmentType": {
                    "type": "string",
                    "enum": [
                      "bobtail",
                      "chassis",
                      "flatbed",
                      "stepdeck",
                      "container",
                      "trailer"
                    ]
                  },
                  "tractorNumber": {
                    "type": "string"
                  },
                  "licensePlate": {
                    "type": "string"
                  },
                  "driverName": {
                    "type": "string"
                  },
                  "truckingCompany": {
                    "type": "string"
                  },
                  "occurredAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "direction",
                  "equipmentType",
                  "occurredAt"
                ],
                "additionalProperties": true,
                "description": "Truck number or plate is required. Handler bounds text fields and validates observed time."
              }
            },
            "required": [
              "eventId",
              "expectedFingerprint",
              "reason",
              "confirmed",
              "response"
            ],
            "additionalProperties": true
          }
        ]
      },
      "DockAssignment": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "visitId": {
                "type": "string",
                "format": "uuid"
              },
              "dockStatus": {
                "type": "string",
                "enum": [
                  "waiting",
                  "not_needed",
                  "assigned"
                ]
              },
              "dock": {
                "type": "string"
              },
              "expectedDockStatus": {
                "type": "string",
                "enum": [
                  "waiting",
                  "not_needed",
                  "assigned"
                ]
              },
              "expectedDock": {
                "type": "string"
              }
            },
            "required": [
              "visitId"
            ],
            "additionalProperties": true,
            "description": "dockStatus defaults to assigned when dock is supplied, otherwise waiting. assigned requires a valid dock; other statuses require an empty dock."
          }
        ]
      },
      "Yardcheck": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "confirmOmissions": {
                "const": true
              },
              "reason": {
                "type": "string",
                "minLength": 5,
                "maxLength": 1000
              },
              "rows": {
                "type": "array",
                "maxItems": 2000,
                "items": {
                  "type": "object",
                  "properties": {
                    "equipmentType": {
                      "type": "string",
                      "enum": [
                        "container",
                        "trailer",
                        "chassis",
                        "flatbed",
                        "stepdeck",
                        "lowboy"
                      ]
                    },
                    "equipmentNumber": {
                      "type": "string"
                    },
                    "supportNumber": {
                      "type": "string"
                    },
                    "loadStatus": {
                      "type": "string",
                      "enum": [
                        "loaded",
                        "empty",
                        "unknown"
                      ]
                    },
                    "location": {
                      "type": "string",
                      "maxLength": 64
                    }
                  },
                  "required": [
                    "equipmentType",
                    "equipmentNumber"
                  ],
                  "additionalProperties": true,
                  "description": "Container/trailer require loadStatus. Container alone may have supportNumber. Duplicate assets, duplicate supports and standalone mounted supports are rejected."
                }
              }
            },
            "required": [
              "confirmOmissions",
              "reason",
              "rows"
            ],
            "additionalProperties": true
          }
        ]
      },
      "FacilityRequest": {
        "type": "object",
        "properties": {
          "facilityId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "facilityId"
        ],
        "additionalProperties": true
      },
      "FacilityDisable": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000
              }
            },
            "required": [
              "reason"
            ],
            "additionalProperties": true
          }
        ]
      },
      "FacilityProvision": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "pattern": "^[A-Z0-9][A-Z0-9-]{1,15}$"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "default": "America/Los_Angeles"
          },
          "referencePrefix": {
            "type": "string"
          },
          "spreadsheetId": {
            "type": "string"
          },
          "documentLibraryId": {
            "type": "string"
          }
        },
        "required": [
          "operationId",
          "code",
          "name",
          "referencePrefix",
          "spreadsheetId",
          "documentLibraryId"
        ],
        "additionalProperties": true
      },
      "UserProvision": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "accessModel": {
            "const": "composable-v1"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "currentEmail": {
            "type": "string",
            "format": "email"
          },
          "currentUserId": {
            "type": "string",
            "format": "uuid"
          },
          "assignments": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "properties": {
                "roleKey": {
                  "type": "string"
                }
              },
              "required": [
                "roleKey"
              ],
              "additionalProperties": true,
              "description": "Unique roleKey entries only; facilityId is rejected."
            }
          }
        },
        "required": [
          "operationId",
          "accessModel",
          "email",
          "displayName",
          "assignments"
        ],
        "additionalProperties": true,
        "description": "Email correction additionally requires currentEmail and currentUserId."
      },
      "SheetMaintenance": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Operation"
          },
          {
            "type": "object",
            "properties": {
              "migrationKey": {
                "const": "annual-archive-v2"
              },
              "planToken": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "confirmation": {
                "const": "APPLY ANNUAL ARCHIVE STRUCTURE"
              }
            },
            "required": [
              "migrationKey",
              "planToken",
              "confirmation"
            ],
            "additionalProperties": true
          }
        ]
      },
      "ArchiveVerification": {
        "type": "object",
        "properties": {
          "facilityId": {
            "type": "string",
            "format": "uuid"
          },
          "archiveId": {
            "type": "string",
            "format": "uuid"
          },
          "batchId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "facilityId",
          "archiveId",
          "batchId"
        ],
        "additionalProperties": true
      },
      "AccessEdit": {
        "type": "object",
        "properties": {
          "accessModel": {
            "const": "composable-v1"
          },
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedVersion": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$"
          },
          "reason": {
            "type": "string",
            "maxLength": 1000
          },
          "confirmation": {
            "type": "string"
          },
          "roleId": {
            "type": "string",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "definition": {
            "$ref": "#/components/schemas/JsonValue"
          },
          "assignments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "roleId": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "required": [
                "roleId"
              ],
              "additionalProperties": true
            }
          }
        },
        "required": [
          "accessModel",
          "operationId",
          "expectedVersion",
          "confirmation"
        ],
        "additionalProperties": true,
        "description": "Role save: SAVE ROLE CHANGES, optional roleId and RPC-validated definition. Assignment replacement: REPLACE USER ASSIGNMENTS, userId and assignments required; each assignment contains roleId and rejects facilityId."
      },
      "PhotoUpload": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "facilityId": {
            "type": "string",
            "format": "uuid"
          },
          "file": {
            "type": "string",
            "format": "binary",
            "description": "JPEG, PNG or WebP, Nonempty, up to 5 MiB, checked against file signature."
          },
          "category": {
            "$ref": "#/components/schemas/PhotoCategory",
            "default": "other"
          },
          "caption": {
            "type": "string",
            "maxLength": 240
          },
          "capturedAt": {
            "type": "string",
            "maxLength": 40
          }
        },
        "required": [
          "operationId",
          "facilityId",
          "file"
        ],
        "additionalProperties": true
      },
      "QueuedPhoto": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "facilityId": {
            "type": "string",
            "format": "uuid"
          },
          "photoId": {
            "type": "string",
            "format": "uuid"
          },
          "file": {
            "type": "string",
            "format": "binary",
            "description": "Nonempty, up to 5 MiB. MIME, signature and SHA-256 must match the immutable photo manifest."
          }
        },
        "required": [
          "operationId",
          "facilityId",
          "photoId",
          "file"
        ],
        "additionalProperties": true
      },
      "Facilities": {
        "type": "object",
        "properties": {
          "facilities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "spreadsheetConfigured": {
                  "type": "boolean"
                },
                "driveConfigured": {
                  "type": "boolean"
                },
                "canReconcile": {
                  "type": "boolean"
                },
                "canYardcheck": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "code",
                "name",
                "canReconcile",
                "canYardcheck"
              ],
              "additionalProperties": true
            }
          }
        },
        "required": [
          "facilities"
        ],
        "additionalProperties": true
      },
      "EquipmentState": {
        "type": "object",
        "properties": {
          "contractVersion": {
            "const": "equipment-state-v1"
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "equipmentUpdate": {
                "type": "boolean"
              },
              "loadStatusUpdate": {
                "type": "boolean"
              },
              "equipmentCorrect": {
                "type": "boolean"
              }
            },
            "required": [
              "equipmentUpdate",
              "loadStatusUpdate",
              "equipmentCorrect"
            ],
            "additionalProperties": true
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "chassis": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "required": [
          "contractVersion",
          "capabilities",
          "items",
          "chassis"
        ],
        "additionalProperties": true
      },
      "ActiveVisits": {
        "type": "object",
        "properties": {
          "contractVersion": {
            "const": "gate-visits-v1"
          },
          "visitsReady": {
            "type": "boolean"
          },
          "capabilities": {
            "type": "object",
            "properties": {},
            "additionalProperties": true
          },
          "visitors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "trucks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "trailers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "recentDepartures": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "required": [
          "contractVersion",
          "visitsReady",
          "capabilities",
          "visitors",
          "trucks",
          "trailers",
          "recentDepartures"
        ],
        "additionalProperties": true
      },
      "RecentMovements": {
        "type": "object",
        "properties": {
          "contractVersion": {
            "const": "recent-responses-v1"
          },
          "canEdit": {
            "type": "boolean"
          },
          "historyReady": {
            "type": "boolean"
          },
          "responsesReady": {
            "type": "boolean"
          },
          "historySource": {
            "type": "string",
            "enum": [
              "google-sheets",
              "supabase-fallback"
            ]
          },
          "liveReady": {
            "type": "boolean"
          },
          "syncPendingCount": {
            "type": "integer"
          },
          "responses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "pendingReconciliationsReady": {
            "const": false
          },
          "pendingReconciliations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "required": [
          "contractVersion",
          "canEdit",
          "historyReady",
          "responsesReady",
          "historySource",
          "liveReady",
          "syncPendingCount",
          "responses",
          "pendingReconciliationsReady",
          "pendingReconciliations"
        ],
        "additionalProperties": true
      },
      "PendingMovements": {
        "type": "object",
        "properties": {
          "contractVersion": {
            "const": "pending-reconciliations-v1"
          },
          "items": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "snapshotSequence": {
            "type": "string",
            "pattern": "^[0-9]{1,19}$"
          },
          "pageCursor": {
            "type": "string"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "contractVersion",
          "items",
          "total",
          "snapshotSequence",
          "pageCursor",
          "nextCursor"
        ],
        "additionalProperties": true,
        "description": "Cursor is opaque and bound to facility/snapshot; sequence is an int64 decimal string."
      },
      "PhotoSearch": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "category": {
                  "type": "string"
                },
                "uploadedAt": {
                  "type": "string"
                },
                "containerNumber": {
                  "type": "string"
                },
                "chassisNumber": {
                  "type": "string"
                },
                "driverName": {
                  "type": "string"
                },
                "operationId": {
                  "type": "string"
                },
                "driveUrl": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "id",
                "name",
                "category",
                "containerNumber",
                "chassisNumber",
                "driverName",
                "operationId",
                "driveUrl"
              ],
              "additionalProperties": true
            }
          },
          "nextPageToken": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextPageToken"
        ],
        "additionalProperties": true
      },
      "Session": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "authenticated": {
                "const": false
              },
              "session": {
                "type": "null"
              }
            },
            "required": [
              "authenticated",
              "session"
            ],
            "additionalProperties": true
          },
          {
            "type": "object",
            "properties": {
              "authenticated": {
                "const": true
              },
              "authMode": {
                "type": "string"
              },
              "session": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "object",
                    "additionalProperties": true,
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "email": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id"
                    ]
                  },
                  "jwt": {
                    "type": "object",
                    "properties": {
                      "sub": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "session_id": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "sub",
                      "session_id"
                    ],
                    "additionalProperties": true
                  },
                  "source": {
                    "const": "supabase"
                  }
                },
                "required": [
                  "user",
                  "jwt",
                  "source"
                ],
                "additionalProperties": true
              }
            },
            "required": [
              "authenticated",
              "authMode",
              "session"
            ],
            "additionalProperties": true
          }
        ]
      },
      "WorkspaceApps": {
        "type": "object",
        "properties": {
          "user": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string"
              }
            },
            "required": [
              "email"
            ],
            "additionalProperties": true
          },
          "apps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "enum": [
                    "admin",
                    "schedule",
                    "yms",
                    "dashboard",
                    "status",
                    "api"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "id",
                "name",
                "description",
                "url"
              ],
              "additionalProperties": true
            }
          }
        },
        "required": [
          "user",
          "apps"
        ],
        "additionalProperties": true
      },
      "ReconciliationResult": {
        "type": "object",
        "properties": {
          "applied": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "conflicts": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "pendingSync": {
            "type": "integer"
          }
        },
        "required": [
          "applied",
          "rejected",
          "conflicts",
          "skipped",
          "remaining",
          "pendingSync"
        ],
        "additionalProperties": true
      },
      "PhotoReceipt": {
        "type": "object",
        "properties": {
          "photoId": {
            "type": "string",
            "format": "uuid"
          },
          "driveFileId": {
            "type": "string"
          },
          "sheetSync": {
            "$ref": "#/components/schemas/JsonValue"
          }
        },
        "required": [
          "photoId",
          "driveFileId",
          "sheetSync"
        ],
        "additionalProperties": true
      },
      "MovementReceipt": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "sheetSync": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "sheetSync"
        ],
        "additionalProperties": true,
        "description": "Additional durable receipt fields are supplied by the RPC. Accepted observation and downstream projection/synchronization are separate states."
      },
      "AccessUsers": {
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "const": 25
          },
          "total": {
            "type": "integer"
          },
          "hasNext": {
            "type": "boolean"
          },
          "loadedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "users",
          "page",
          "pageSize",
          "total",
          "hasNext",
          "loadedAt"
        ],
        "additionalProperties": true
      },
      "AccessRoles": {
        "type": "object",
        "properties": {
          "accessModel": {
            "type": "string",
            "enum": [
              "composable-v1",
              "legacy-scoped"
            ]
          },
          "facilities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "loadedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "accessModel",
          "facilities",
          "roles",
          "permissions",
          "loadedAt"
        ],
        "additionalProperties": true
      },
      "Health": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "misconfigured",
              "unhealthy",
              "degraded",
              "ok"
            ]
          },
          "checkedAt": {
            "type": "string"
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          },
          "integrations": {
            "type": "object",
            "properties": {},
            "additionalProperties": true
          }
        },
        "required": [
          "status",
          "checkedAt",
          "missing",
          "checks",
          "integrations"
        ],
        "additionalProperties": true
      },
      "AccessRoleEdit": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AccessEdit"
          },
          {
            "type": "object",
            "properties": {
              "confirmation": {
                "const": "SAVE ROLE CHANGES"
              }
            },
            "additionalProperties": true
          }
        ]
      },
      "AccessAssignmentsEdit": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AccessEdit"
          },
          {
            "type": "object",
            "properties": {
              "confirmation": {
                "const": "REPLACE USER ASSIGNMENTS"
              },
              "userId": {
                "type": "string",
                "format": "uuid"
              },
              "assignments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "roleId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "roleId"
                  ],
                  "additionalProperties": true
                }
              }
            },
            "required": [
              "userId",
              "assignments"
            ],
            "additionalProperties": true
          }
        ]
      },
      "PublicHealth": {
        "type": "object",
        "properties": {
          "status": {
            "const": "ok"
          }
        },
        "required": [
          "status"
        ],
        "additionalProperties": false
      },
      "SessionRevocationRequest": {
        "type": "object",
        "properties": {
          "targetUserId": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "operationId": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          }
        },
        "required": [
          "targetUserId",
          "operationId"
        ],
        "additionalProperties": false,
        "description": "Exactly two UUIDs; normalized to lowercase. JSON request bound 4096 UTF-8 bytes. Reuse the same operationId and target after uncertain completion; authenticate each retry afresh."
      },
      "SessionRevocationReceipt": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "targetUserId": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "status": {
            "const": "completed"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "revokedSessionCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "operationId",
          "targetUserId",
          "status",
          "recordedAt",
          "revokedSessionCount"
        ],
        "additionalProperties": false
      },
      "SessionRevocationCapability": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "additionalProperties": false
      },
      "ApiReferenceHtml": {
        "type": "string",
        "description": "Self-contained, read-only HTML API reference with no scripts or external assets."
      },
      "PublicOpenApiDocument": {
        "type": "object",
        "required": [
          "openapi",
          "info",
          "paths",
          "components"
        ],
        "properties": {
          "openapi": {
            "type": "string",
            "const": "3.1.1"
          },
          "info": {
            "type": "object"
          },
          "paths": {
            "type": "object"
          },
          "components": {
            "type": "object"
          }
        },
        "additionalProperties": true,
        "description": "Standard OpenAPI projection preserving local references and security while omitting internal review metadata. Public permission, facility-scope and alias extensions are retained."
      },
      "FacilityCreate": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "pattern": "^[A-Z0-9][A-Z0-9-]{1,15}$"
          },
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "timezone": {
            "type": "string",
            "default": "America/Los_Angeles"
          },
          "referencePrefix": {
            "type": "string"
          },
          "spreadsheetId": {
            "type": "string"
          },
          "documentLibraryId": {
            "type": "string"
          },
          "operatingUnitType": {
            "type": "string",
            "enum": [
              "warehouse",
              "transport"
            ],
            "default": "warehouse"
          }
        },
        "required": [
          "operationId",
          "code",
          "name"
        ],
        "additionalProperties": false,
        "description": "Creates shared operating-unit metadata. Supplying any YMS field requires a warehouse and all three fields: referencePrefix, spreadsheetId, documentLibraryId. That workflow validates provider readiness before activation. Omitting all three creates an active master without YMS configuration. Stable code/type and external resource identities cannot be changed by metadata PATCH."
      },
      "FacilityPatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "operationId",
          "expectedUpdatedAt",
          "changes"
        ],
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedUpdatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Exact updatedAt value from the management view. Stale writes return 409. Retry unchanged requests with the same operationId."
          },
          "changes": {
            "type": "object",
            "minProperties": 1,
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "address": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 500
              },
              "timezone": {
                "type": "string",
                "description": "Valid IANA timezone; also updates existing YMS settings."
              }
            }
          }
        }
      },
      "ManagedFacility": {
        "type": "object",
        "required": [
          "id",
          "code",
          "name",
          "operatingUnitType",
          "active",
          "timezone",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "operatingUnitType": {
            "type": "string",
            "enum": [
              "warehouse",
              "transport"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "timezone": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "admin_only": {
            "type": "boolean"
          },
          "spreadsheetConfigured": {
            "type": "boolean"
          },
          "documentLibraryConfigured": {
            "type": "boolean"
          },
          "referencePrefix": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "responses": {
      "Error": {
        "description": "Failure; interpret HTTP status and stable code together. correlationId is in the JSON body.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "FacilitiesResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/Facilities"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "EquipmentStateResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/EquipmentState"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "JsonValueResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/JsonValue"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "MovementReceiptResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/MovementReceipt"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "ActiveVisitsResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/ActiveVisits"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "PendingMovementsResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/PendingMovements"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "RecentMovementsResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/RecentMovements"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "PhotoReceiptResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/PhotoReceipt"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "PhotoSearchResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/PhotoSearch"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "ReconciliationResultResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/ReconciliationResult"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "WorkspaceAppsResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/WorkspaceApps"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "SessionResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/Session"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        },
        "headers": {
          "Cache-Control": {
            "schema": {
              "type": "string"
            },
            "description": "private, no-store for session, revocation and protected diagnostics; no-store for public health."
          }
        }
      },
      "HealthResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/Health"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          },
          "text/html": {
            "schema": {
              "type": "string"
            }
          }
        },
        "headers": {
          "Cache-Control": {
            "schema": {
              "type": "string"
            },
            "description": "private, no-store for session, revocation and protected diagnostics; no-store for public health."
          },
          "X-Correlation-ID": {
            "description": "Present on HTML diagnostics; JSON correlationId is in the envelope.",
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "AccessUsersResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/AccessUsers"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "AccessRolesResponse": {
        "description": "Existing success envelope; payload may include additional domain fields.",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/AccessRoles"
                    }
                  },
                  "required": [
                    "body"
                  ],
                  "additionalProperties": true
                }
              ]
            }
          }
        }
      },
      "PublicHealthResponse": {
        "description": "Public process liveness only; no dependency probes or readiness guarantee.",
        "headers": {
          "Cache-Control": {
            "schema": {
              "type": "string"
            },
            "description": "private, no-store for session, revocation and protected diagnostics; no-store for public health."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/PublicHealth"
                    }
                  },
                  "required": [
                    "body"
                  ]
                }
              ]
            }
          }
        }
      },
      "SessionRevocationResponse": {
        "description": "Completed or replayed receipt; both return 200. No automatic mutation replay.",
        "headers": {
          "Cache-Control": {
            "schema": {
              "type": "string"
            },
            "description": "private, no-store for session, revocation and protected diagnostics; no-store for public health."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/SessionRevocationReceipt"
                    }
                  },
                  "required": [
                    "body"
                  ]
                }
              ]
            }
          }
        }
      },
      "SessionRevocationCapabilityResponse": {
        "description": "Capability state; boolean false by default. Provider uncertainty returns an error, never enabled=true.",
        "headers": {
          "Cache-Control": {
            "schema": {
              "type": "string"
            },
            "description": "private, no-store for session, revocation and protected diagnostics; no-store for public health."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Success"
                },
                {
                  "type": "object",
                  "properties": {
                    "body": {
                      "$ref": "#/components/schemas/SessionRevocationCapability"
                    }
                  },
                  "required": [
                    "body"
                  ]
                }
              ]
            }
          }
        }
      },
      "FacilityListResponse": {
        "description": "YMS facilities by default, or all managed operating units with service=admin. Administration view includes inactive units; external resource IDs are not returned.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "allowed",
                "body",
                "correlationId"
              ],
              "properties": {
                "allowed": {
                  "const": true
                },
                "correlationId": {
                  "type": "string"
                },
                "body": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Facilities"
                    },
                    {
                      "type": "object",
                      "required": [
                        "facilities"
                      ],
                      "properties": {
                        "facilities": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ManagedFacility"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
