{
  "openapi": "3.0.3",
  "info": {
    "title": "Parkeze API",
    "version": "1.1.0",
    "description": "Parking zones, spaces, live occupancy and reservations, read with an API\nkey for your organization; and, for partner apps Parkeze enables, paying\nfor parking and managing saved vehicles on behalf of a signed-in driver.\n\n## Authentication\n\nAn organization's data is read with an API key's short-lived access\ntoken (**BearerAuth**): `Authorization: Bearer <access_token>`.\n\n\n1. Make an API key for your organization on the API keys page of the\n   organization console,\n   https://auth.parkeze.com/realms/parkeze/manage/api-keys. You need the\n   Developer role in that organization; an organization administrator\n   grants it.\n2. Exchange the key for a token by OAuth 2.0 client credentials:\n\n```bash\ncurl -s https://auth.parkeze.com/realms/parkeze/protocol/openid-connect/token \\\n  -d grant_type=client_credentials \\\n  -d client_id=YOUR_CLIENT_ID \\\n  -d client_secret=YOUR_CLIENT_SECRET\n```\n\nA key made with a public key instead of a secret signs a client\nassertion per token (`client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer`).\n\n```json\n{\"access_token\": \"eyJhbGciOi...\", \"expires_in\": 300, \"token_type\": \"Bearer\"}\n```\n\nTokens last five minutes; get a new one when it expires. A live stream\nopened with a token keeps running after it expires; reconnecting needs a\nfresh one.\n\n## What an API key may do\n\nA key reads one organization's data and writes nothing. Operations tagged\n**API keys: read-only** accept it; any other method is `403`, and so is an\n`X-Active-Org` header naming a different organization. A key stops working\nwhen it expires, is paused or deleted, when its owner loses access to the\norganization, or when the organization's contract ends.\n\nOther operations here serve people signed in to Parkeze's apps (an\norganization's staff, officers at a station, a guest holding a booking\nlink). They are documented so an integration acting for those people\nknows what they see.\n\n## Partner apps: acting for a driver\n\nCommerce (`/v1/commerce`) and saved vehicles (`/v1/vehicles`) act for a\nsigned-in person, not an organization (**DriverAuth**). They take that\nperson's access token from `https://auth.parkeze.com/realms/mobile`,\nissued to an app Parkeze has enabled; an API key's token is refused.\nTo have your app enabled, contact support@parkeze.com. Brand files\n(`/v1/brand`) need no token.\n\n## Errors\n\nA failure answers with its HTTP status and a JSON body. Zones, sensors,\nstations and reservations answer `{\"error\": \"...\", \"message\": \"...\"}`:\n`error` is always present, either the status's name (`Forbidden`) or, for\na refusal an app is expected to act on, a code such as\n`not_a_station_member`; `message` says why when there is more to say (a\n`404` for a path that does not exist carries `path` instead). Live\nstreams answer `{\"detail\": \"...\"}` before the stream opens, or\n`{\"error\": \"...\"}` for a refused station.\n\n## Rate limits\n\nEvery caller has an allowance per time window. Operators, facilities,\nzones and sensors allow 100 requests a minute per key for each\norganization. Past an allowance the answer is `429` with\n`{\"error\": \"Too Many Requests\", \"message\": \"...\"}`.\n\n## Data model\n\nAn **operator** is an organization that runs parking. It has **zones**\n(a lot, a garage floor, a street block: a boundary with shared rules), and\na zone has **spaces**, each usually watched by a **sensor** that reports\nwhether it is occupied.\n\nTo draw a map, fetch `/v1/zones` and `/v1/sensors/static` once, fill in\noccupancy from `/v1/sensors/state`, then keep it current from the\n`/v1/live` stream, polling `/v1/sensors/state` only while the stream is\ndown.\n",
    "contact": {
      "name": "Parkeze Support",
      "email": "support@parkeze.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://parkeze.com/api-terms"
    }
  },
  "servers": [
    {
      "url": "https://api.parkeze.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Brand",
      "description": "Organizations' logo files."
    },
    {
      "name": "Commerce",
      "description": "Offers, quotes, payment sessions and orders for parking."
    },
    {
      "name": "Validations",
      "description": "A business paying for a driver's parking, by code or by check-in."
    },
    {
      "name": "Events",
      "description": "Games, concerts and fairs, and their parking booked ahead. No sign-in needed."
    },
    {
      "name": "Get Live Updates",
      "description": "Real-time sensor data via Server-Sent Events"
    },
    {
      "name": "API keys: read-only",
      "description": "What a developer API key may call. Reads only; every other method is 403."
    },
    {
      "name": "Build Your Map",
      "description": "Endpoints for building cached parking availability maps.\n\n**Available routes:**\n- `GET /v1/operators` - List parking operators\n- `GET /v1/zones` - List parking zones (optionally filter by location)\n- `GET /v1/zones/occupancy` - Get cached zone-level availability counts\n- `GET /v1/sensors` - Get complete sensor data (location + occupancy status)\n- `GET /v1/sensors/static` - Get sensor locations and metadata only\n- `GET /v1/sensors/state` - Get cached occupancy status only\n\nUse these endpoints together to create responsive, real-time parking applications.\n\n**Rate Limiting:**\nA client acting for an organization, as an API key always is, may make\n100 requests a minute for it. Past that the answer is 429, its\n`message` saying how many seconds to wait.\n"
    },
    {
      "name": "Stations",
      "description": "A station is an operator's place -- its zones and the view it shows.\nWhat it shows is one of the operator's enforcement applications.\n\nA station is worked by a person who signs in: their token and\n`X-Station: <station_id>`, for a station they are a member of, or any\nstation of an organization they administer. Listed by\n`/v1/stations/mine`. Their own roles decide what they may do there.\n\nAt a station, `/v1/zones*` and `/v1/sensors*` answer for its zones\nonly. A person holding only `enforcement-station` gets 403 from them\nat no station.\n"
    },
    {
      "name": "Reservations",
      "description": "CRUD operations for parking reservations"
    },
    {
      "name": "Vehicle",
      "description": "Self-service vehicle information submission"
    },
    {
      "name": "Zones",
      "description": "Zone discovery for reservation-enabled zones"
    },
    {
      "name": "Enforcement",
      "description": "Reservation verification for enforcement officers"
    },
    {
      "name": "Blocks",
      "description": "Long holds on a zone's spaces for an event or for facilities vehicles"
    },
    {
      "name": "Vehicles",
      "description": "A driver's saved vehicles."
    }
  ],
  "paths": {
    "/v1/brand/assets/{alias}/{version}/manifest.json": {
      "get": {
        "tags": [
          "Brand"
        ],
        "operationId": "getBrandManifest",
        "summary": "What a version of an organization's logos holds",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/BrandAlias"
          },
          {
            "$ref": "#/components/parameters/BrandVersion"
          },
          {
            "$ref": "#/components/parameters/BrandIfNoneMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "The manifest.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/BrandCacheControl"
              },
              "ETag": {
                "$ref": "#/components/headers/BrandETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandManifest"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/BrandNotModified"
          },
          "404": {
            "$ref": "#/components/responses/BrandNotFound"
          }
        }
      }
    },
    "/v1/brand/assets/{alias}/{version}/{file}": {
      "get": {
        "tags": [
          "Brand"
        ],
        "operationId": "getBrandFile",
        "summary": "A logo file",
        "description": "A variant's SVG (`<variant>.svg`, where the logo was uploaded as SVG)\nor one of its PNG renditions. Wordmarks are as wide as their\nproportions make them at 96 and 192 px tall; marks are centered on a\ntransparent square of 64, 180 and 512 px. Variant names are written\nwith a hyphen in file names (`wordmark-dark-96.png`). An SVG is served\nwith a `Content-Security-Policy` that keeps it from running or loading\nanything.\n",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/BrandAlias"
          },
          {
            "$ref": "#/components/parameters/BrandVersion"
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "wordmark.svg",
                "wordmark-96.png",
                "wordmark-192.png",
                "wordmark-dark.svg",
                "wordmark-dark-96.png",
                "wordmark-dark-192.png",
                "mark.svg",
                "mark-64.png",
                "mark-180.png",
                "mark-512.png",
                "mark-dark.svg",
                "mark-dark-64.png",
                "mark-dark-180.png",
                "mark-dark-512.png"
              ]
            },
            "example": "mark-512.png"
          },
          {
            "$ref": "#/components/parameters/BrandIfNoneMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/BrandCacheControl"
              },
              "ETag": {
                "$ref": "#/components/headers/BrandETag"
              },
              "Content-Security-Policy": {
                "description": "On SVG only.",
                "schema": {
                  "type": "string",
                  "example": "default-src 'none'; style-src 'unsafe-inline'; sandbox"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/BrandNotModified"
          },
          "404": {
            "$ref": "#/components/responses/BrandNotFound"
          }
        }
      }
    },
    "/v1/brand/assets/{alias}/{version}/wallet/{file}": {
      "get": {
        "tags": [
          "Brand"
        ],
        "operationId": "getBrandWalletFile",
        "summary": "An Apple Wallet image",
        "description": "The icon (29, 58 and 87 px, made from the light mark) and the logo\n(within 160 by 50, 320 by 100 and 480 by 150 px: the light wordmark\nwhen its proportions suit the slot, else the light mark), as the\nmanifest's `wallet` lists them. A version with no mark has no icon.\n",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/BrandAlias"
          },
          {
            "$ref": "#/components/parameters/BrandVersion"
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "icon.png",
                "icon@2x.png",
                "icon@3x.png",
                "logo.png",
                "logo@2x.png",
                "logo@3x.png"
              ]
            },
            "example": "icon@2x.png"
          },
          {
            "$ref": "#/components/parameters/BrandIfNoneMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "The image.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/BrandCacheControl"
              },
              "ETag": {
                "$ref": "#/components/headers/BrandETag"
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/BrandNotModified"
          },
          "404": {
            "$ref": "#/components/responses/BrandNotFound"
          }
        }
      }
    },
    "/v1/brand/assets/{alias}/{version}/thermal/{file}": {
      "get": {
        "tags": [
          "Brand"
        ],
        "operationId": "getBrandThermalFile",
        "summary": "A logo for a receipt printer",
        "description": "The light wordmark or mark as a 1-bit bitmap, for a thermal printer's raster command. The file is\n`<variant>-<width>.pbm` (`mark-384.pbm`), the width in dots, a multiple of 8 from 64 to 576 (384 is a\n58 mm printer's full width, 576 an 80 mm one's), the height following the logo's proportions. It is\na binary PBM (`P4`): a header line, the size line, then width/8 bytes a row, most significant bit\nfirst, a set bit being black. The logo is placed on white, stretched to the full gray range and\ndithered (Floyd-Steinberg). Made from the version's largest PNG when asked, and, like every file of a\nversion, never different afterward. A version without that variant, or a width off the grid, is a 404.\n",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/BrandAlias"
          },
          {
            "$ref": "#/components/parameters/BrandVersion"
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(wordmark|mark)-[0-9]{2,3}\\.pbm$"
            },
            "example": "mark-384.pbm"
          },
          {
            "$ref": "#/components/parameters/BrandIfNoneMatch"
          }
        ],
        "responses": {
          "200": {
            "description": "The bitmap.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/BrandCacheControl"
              },
              "ETag": {
                "$ref": "#/components/headers/BrandETag"
              }
            },
            "content": {
              "image/x-portable-bitmap": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/BrandNotModified"
          },
          "404": {
            "$ref": "#/components/responses/BrandNotFound"
          }
        }
      }
    },
    "/v1/commerce/zones/{zone_id}/offer": {
      "get": {
        "tags": [
          "Commerce"
        ],
        "operationId": "getCommerceZoneOffer",
        "summary": "What a zone sells now",
        "description": "Whether the zone is selling now and on what terms, priced from `start`\n(now when omitted). Pass `space_number` for a zone keyed by space, or\n`plate` (and `jurisdiction`) for one keyed by plate, where the seller\nprices them differently.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/CommerceZoneId"
          },
          {
            "name": "minutes",
            "in": "query",
            "description": "The stay to price first; it is added to `increments` where it can be bought.",
            "schema": {
              "type": "integer",
              "default": 60,
              "minimum": 1
            }
          },
          {
            "name": "start",
            "in": "query",
            "description": "ISO 8601 start of the stay; now when omitted.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "space_number",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "104"
          },
          {
            "name": "plate",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "TEST123"
          },
          {
            "name": "jurisdiction",
            "in": "query",
            "description": "The plate's state or province, without the country prefix (`SC`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The zone and what it offers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceZoneOffer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CommerceBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CommerceNotFound"
          },
          "409": {
            "description": "Parking here is not sold in the app, or the seller refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "501": {
            "$ref": "#/components/responses/CommerceNotAvailable"
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/quotes": {
      "post": {
        "tags": [
          "Commerce"
        ],
        "operationId": "createCommerceQuote",
        "summary": "Price a stay",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceQuoteRequest"
              },
              "example": {
                "zoneId": "3f0c1d2e-0000-4000-8000-000000000001",
                "minutes": 90,
                "vehicle": {
                  "plate": "TEST123",
                  "jurisdiction": "SC"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The price, sealed in `quote_ref`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceQuote"
                }
              }
            }
          },
          "400": {
            "description": "No `minutes`, a start that has passed, a stay shorter or longer\nthan the zone sells, no `spaceNumber` in a zone keyed by space, or\nno `vehicle` in a zone keyed by plate.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CommerceNotFound"
          },
          "409": {
            "description": "Parking here is not sold now (closed, free, or not sold in the app), or the seller refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "501": {
            "$ref": "#/components/responses/CommerceNotAvailable"
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/payment-session": {
      "post": {
        "tags": [
          "Commerce"
        ],
        "operationId": "createCommercePaymentSession",
        "summary": "How to hand over the card",
        "description": "Where and how your app sends the card so that only a single-use token\ncomes back to it. The session is for the zone's seller, or for the\norganization's payment processor where Parkeze sells the zone. Pass the\nquote's total as `amount` for the latter.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommercePaymentSessionRequest"
              },
              "example": {
                "zoneId": "3f0c1d2e-0000-4000-8000-000000000001",
                "amount": "4.75",
                "currency": "USD"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommercePaymentSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CommerceBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CommerceNotFound"
          },
          "409": {
            "description": "Parking here is not sold in the app, or the organization takes no payments online.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "501": {
            "$ref": "#/components/responses/CommerceNotAvailable"
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/orders": {
      "post": {
        "tags": [
          "Commerce"
        ],
        "operationId": "createCommerceOrder",
        "summary": "Buy parking",
        "description": "Buys the quoted stay. Idempotent on the person and `idempotencyKey`:\nsending the same key again answers the order it made and charges\nnothing more. An order whose charge has not been answered yet is\n`pending`, and the same key tries again; one whose card was refused is\n`failed`, and the same key answers 402 (use a new key with new card\ndetails).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceOrderRequest"
              },
              "example": {
                "zoneId": "3f0c1d2e-0000-4000-8000-000000000001",
                "quoteRef": "nq.eyJ6IjoiZXhhbXBsZSJ9.c2lnbmF0dXJl",
                "paymentToken": "tok_test_0000000000",
                "minutes": 90,
                "vehicle": {
                  "plate": "TEST123",
                  "jurisdiction": "SC"
                },
                "idempotencyKey": "6c1b7a52-0000-4000-8000-00000000abcd"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The order, `confirmed`, or `pending` while the charge is unanswered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceOrder"
                }
              }
            }
          },
          "400": {
            "description": "No `idempotencyKey`, no quote or payment, or no space or vehicle where the zone needs one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "402": {
            "$ref": "#/components/responses/CommercePaymentRefused"
          },
          "404": {
            "$ref": "#/components/responses/CommerceNotFound"
          },
          "409": {
            "description": "The quote has expired or is not for this zone, space or vehicle; or parking here is not sold.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "501": {
            "$ref": "#/components/responses/CommerceNotAvailable"
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/orders/{order_id}/extend": {
      "post": {
        "tags": [
          "Commerce"
        ],
        "operationId": "extendCommerceOrder",
        "summary": "Add time to a running order",
        "description": "Only a `confirmed` order whose `allowsExtensions` is true. Where the\norder's `collectionMode` is `platform_collects` the extra time is\ncharged and needs a `paymentToken` from a new payment session; where\nit is `seller_collects` the seller charges it. Send an\n`idempotencyKey` so that a retry adds no time twice.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/CommerceOrderId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceExtendRequest"
              },
              "example": {
                "minutes": 30,
                "paymentToken": "tok_test_0000000001",
                "idempotencyKey": "0d9e3f10-0000-4000-8000-00000000ef01"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The order with its new end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceOrder"
                }
              }
            }
          },
          "400": {
            "description": "No `minutes`, more than the zone allows, or no payment where one is needed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "402": {
            "$ref": "#/components/responses/CommercePaymentRefused"
          },
          "404": {
            "$ref": "#/components/responses/CommerceOrderNotFound"
          },
          "409": {
            "description": "The order is not running, its parking is no longer sold here, or the key was used for another extension.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/orders/{order_id}/stop": {
      "post": {
        "tags": [
          "Commerce"
        ],
        "operationId": "stopCommerceOrder",
        "summary": "End a running order early",
        "description": "Only a `confirmed` order whose `allowsStops` is true. The order becomes `ended`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CommerceOrderId"
          }
        ],
        "responses": {
          "200": {
            "description": "The ended order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceOrder"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CommerceOrderNotFound"
          },
          "409": {
            "description": "The order is not running, its parking is no longer sold here, or its organization has turned ending early off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/orders/mine": {
      "get": {
        "tags": [
          "Commerce"
        ],
        "operationId": "listMyCommerceOrders",
        "summary": "The person's orders",
        "description": "The 50 most recent `confirmed` and `ended` orders, latest start first.",
        "responses": {
          "200": {
            "description": "The orders.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "orders"
                  ],
                  "properties": {
                    "orders": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommerceOrder"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "listCommerceEvents",
        "summary": "Events near a place or in a box",
        "description": "Published and canceled events of organizations that sell event\nparking, whose parking window (`arriveFrom` to `departBy`) overlaps\n`from` to `until`; a canceled one is listed until it would have ended.\nNear a place (`near`, nearest first) or in the map's viewport (`bbox`),\nelse by start. No token is needed; with one, lots in zones only the\norganization's app members may see are counted too. Answered with\n`Cache-Control: max-age=30`.\n",
        "security": [],
        "parameters": [
          {
            "name": "near",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "-81.0335,33.9942",
            "description": "`<lng>,<lat>`."
          },
          {
            "name": "radiusKm",
            "in": "query",
            "schema": {
              "type": "number",
              "default": 25,
              "maximum": 100
            },
            "description": "With `near`."
          },
          {
            "name": "bbox",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "-81.1,33.9,-80.9,34.1",
            "description": "`<minLng>,<minLat>,<maxLng>,<maxLat>`."
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Now when omitted."
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "30 days after `from` when omitted."
          },
          {
            "name": "organization",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One organization's, by alias (its portal)."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sports",
                "concert",
                "festival",
                "conference",
                "other"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The last page's `next`."
          }
        ],
        "responses": {
          "200": {
            "description": "The events, and the cursor of the next page (null on the last).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events",
                    "next"
                  ],
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommerceEventSummary"
                      }
                    },
                    "next": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CommerceBadRequest"
          },
          "422": {
            "$ref": "#/components/responses/CommerceInvalidRequest"
          }
        }
      }
    },
    "/v1/commerce/events/{event_id}": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "getCommerceEvent",
        "summary": "One event, its lots, availability and prices",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/CommerceEventId"
          }
        ],
        "responses": {
          "200": {
            "description": "The event.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceEvent"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/CommerceEventNotFound"
          }
        }
      }
    },
    "/v1/commerce/events/{event_id}/image": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "getCommerceEventImage",
        "summary": "The event's picture",
        "description": "Its bytes, `Cache-Control: public, max-age=86400`.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/CommerceEventId"
          }
        ],
        "responses": {
          "200": {
            "description": "The picture.",
            "content": {
              "image/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/CommerceEventNotFound"
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        }
      }
    },
    "/v1/commerce/events/{event_id}/quote": {
      "post": {
        "tags": [
          "Events"
        ],
        "operationId": "createCommerceEventQuote",
        "summary": "Price a lot for the parking window",
        "description": "A sealed price for the whole parking window in a lot sold `here`: its\nflat price, or what the zone's rules charge for the window, with the\nconvenience fee and tax. A token is optional.\n",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/CommerceEventId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceEventQuoteRequest"
              },
              "example": {
                "lotId": "1a2b3c4d-0000-4000-8000-000000000011",
                "vehicle": {
                  "plate": "TEST123",
                  "jurisdiction": "SC"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The price, sealed in `quoteRef`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceEventQuote"
                }
              }
            }
          },
          "400": {
            "description": "No plate in a lot whose zone is keyed by plate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/CommerceEventNotFound"
          },
          "409": {
            "description": "The lot is not sold here, not in its booking window or sold out, or the event is canceled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommerceTooMany"
          }
        }
      }
    },
    "/v1/commerce/events/{event_id}/payment-session": {
      "post": {
        "tags": [
          "Events"
        ],
        "operationId": "createCommerceEventPaymentSession",
        "summary": "How to hand over the card for a lot",
        "description": "What `POST /v1/commerce/payment-session` answers for the lot's zone. A token is optional.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/CommerceEventId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceEventPaymentSessionRequest"
              },
              "example": {
                "lotId": "1a2b3c4d-0000-4000-8000-000000000011",
                "origin": "https://columbia.pkze.us"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommercePaymentSession"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/CommerceEventNotFound"
          },
          "409": {
            "description": "The lot cannot be booked now, or the organization takes no payments online.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommerceTooMany"
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        }
      }
    },
    "/v1/commerce/events/{event_id}/orders": {
      "post": {
        "tags": [
          "Events"
        ],
        "operationId": "createCommerceEventOrder",
        "summary": "Book a lot",
        "description": "Books one space in the lot for the parking window: an order on the\nlot's zone from `arriveFrom` to `departBy`. With a token the booking is\nthe account's; without one it is a guest's, who gives an email or a\nphone for the receipt and passes the Turnstile `challenge`.\nIdempotent on the buyer and `idempotencyKey`, as `POST /orders` is.\nThe receipt (`receipt`, and `code`) shows the code as a QR for a gate\nor an attendant.\n",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/CommerceEventId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceEventOrderRequest"
              },
              "example": {
                "lotId": "1a2b3c4d-0000-4000-8000-000000000011",
                "quoteRef": "nq.eyJ6IjoiZXhhbXBsZSJ9.c2lnbmF0dXJl",
                "paymentToken": "tok_test_0000000000",
                "vehicle": {
                  "plate": "TEST123",
                  "jurisdiction": "SC"
                },
                "email": "driver@example.com",
                "challenge": "turnstile-token",
                "idempotencyKey": "6c1b7a52-0000-4000-8000-00000000abcd"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The booking, `confirmed`, or `pending` while the charge is unanswered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceEventBooking"
                }
              }
            }
          },
          "400": {
            "description": "No `idempotencyKey`, quote or payment; no plate where one is needed; no contact or challenge from a guest.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "402": {
            "$ref": "#/components/responses/CommercePaymentRefused"
          },
          "403": {
            "description": "The buyer cannot pay online here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/CommerceEventNotFound"
          },
          "409": {
            "description": "Sold out, not open for booking, the event is canceled, or the quote is stale.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommerceTooMany"
          },
          "503": {
            "$ref": "#/components/responses/CommerceUnavailable"
          }
        }
      }
    },
    "/v1/commerce/events/orders/{code}/cancel": {
      "post": {
        "tags": [
          "Events"
        ],
        "operationId": "cancelCommerceEventOrder",
        "summary": "Cancel a booking",
        "description": "The buyer cancels with the receipt's code (with a token, the account\nmust be the buyer): refunded in full and its right ended, until the\nevent's `buyerCancelUntil`.\n",
        "security": [],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          }
        ],
        "responses": {
          "200": {
            "description": "The booking's order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "order"
                  ],
                  "properties": {
                    "order": {
                      "$ref": "#/components/schemas/CommerceOrder"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such booking.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "409": {
            "description": "Past `buyerCancelUntil`, the organization lets no buyer cancel, or the refund was refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommerceTooMany"
          }
        }
      }
    },
    "/v1/commerce/validations/code/{code}": {
      "get": {
        "tags": [
          "Validations"
        ],
        "operationId": "getCommerceValidationCode",
        "summary": "Look up a validation code",
        "description": "What a code a business handed out is good for. Codes not found are\ncounted per person and per address; past the limit every lookup answers\n429 for up to an hour.\n",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The code, in any case.",
            "schema": {
              "type": "string"
            },
            "example": "TESTCODE"
          }
        ],
        "responses": {
          "200": {
            "description": "The code's business, time and zones.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceValidationCode"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "404": {
            "description": "No such code, or it was voided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "409": {
            "description": "The code has been used.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "410": {
            "description": "The code has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommerceTooMany"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/validations/redeem": {
      "post": {
        "tags": [
          "Validations"
        ],
        "operationId": "redeemCommerceValidationCode",
        "summary": "Park on a validation code",
        "description": "Uses the code: a right to park from now for the code's minutes, in one\nof its zones, on the space or plate given. A code is used once.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceRedeemRequest"
              },
              "example": {
                "code": "TESTCODE",
                "zoneId": "3f0c1d2e-0000-4000-8000-000000000001",
                "vehicle": {
                  "plate": "TEST123",
                  "jurisdiction": "SC"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Parked until `validUntil`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceRedemption"
                }
              }
            }
          },
          "400": {
            "description": "The zone is not one of the code's, or no space or vehicle where the zone needs one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "404": {
            "description": "No such code, or it was voided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "409": {
            "description": "The code has been used, the business no longer validates here, or its monthly limit is reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "410": {
            "description": "The code has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommerceTooMany"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/offers": {
      "get": {
        "tags": [
          "Validations"
        ],
        "operationId": "listCommerceCheckinOffers",
        "summary": "Offers to check in to where the driver is parked",
        "description": "The businesses' offers in this zone that are open now and that this\nperson may use.\n",
        "parameters": [
          {
            "name": "zoneId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "3f0c1d2e-0000-4000-8000-000000000001"
          }
        ],
        "responses": {
          "200": {
            "description": "The offers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "offers"
                  ],
                  "properties": {
                    "offers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CommerceCheckinOffer"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/CommerceBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "422": {
            "$ref": "#/components/responses/CommerceInvalidRequest"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/commerce/offers/{offer_id}/checkin": {
      "post": {
        "tags": [
          "Validations"
        ],
        "operationId": "checkInToCommerceOffer",
        "summary": "Check in to an offer",
        "description": "Validates the plate's parking in the zone for the offer's minutes,\npaid by the business. One check-in per person, offer and day: checking\nin again answers the first. An offer with `needsCode` takes the code\nshown at the business today; wrong codes are counted per person.\n",
        "parameters": [
          {
            "name": "offer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "9a8b7c6d-0000-4000-8000-000000000002"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceCheckinRequest"
              },
              "example": {
                "zoneId": "3f0c1d2e-0000-4000-8000-000000000001",
                "vehicle": {
                  "plate": "TEST123",
                  "jurisdiction": "SC"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Validated until `validUntil`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceCheckin"
                }
              }
            }
          },
          "400": {
            "description": "Not this offer's zone, no plate, or not today's code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/CommerceUnauthorized"
          },
          "403": {
            "description": "The offer is not for this person.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "404": {
            "description": "No such offer, or it was retired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "409": {
            "description": "The offer is not open now, it has been used as often as it allows this month, or the business's monthly limit is reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/CommerceTooMany"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/live": {
      "get": {
        "tags": [
          "Get Live Updates",
          "API keys: read-only"
        ],
        "summary": "Subscribe to real-time sensor updates",
        "description": "Open a Server-Sent Events (SSE) stream for real-time parking sensor occupancy updates.\n\n## Stream Behavior\n\n- Receives real-time sensor status changes (occupied \u2194 vacant)\n- Heartbeats sent every 15 seconds to keep connection alive\n- Filtered to the operators and zones the token may see\n- Optional operator and UUID filtering\n\n## Event Format\n\n```\nid: occ:0:12345\nevent: update\ndata: {\"uuid\":\"...\",\"status\":true,\"timestamp\":\"2025-11-06T12:00:00Z\",\"method\":\"sensor\",\"confidence\":1.0}\n\n: heartbeat\n```\n\n`status` is true when the space is occupied; `timestamp` is when that\nwas decided; `method` and `confidence` say how and how surely, and may\nbe null.\n\n## Reconnection with Replay\n\nOn disconnect, store the `id` field from the last event (format: `occ:{partition}:{offset}`).\n\nOn reconnect, include `Last-Event-ID: occ:0:12345` to replay from there.\n\nThe stream will replay missed events, then switch to real-time. If\nthat event is no longer kept, replay starts from the oldest one that\nis. An id in any other form (including the older `{partition}:{offset}`)\nreplays nothing: the stream starts from now.\n\n## Messages\n\nThe operator's public announcements arrive on the same stream as\n`event: message` whenever one is published, changed or retired\n(`event_type` says which). They carry **no `id`**, so they never move\nyour replay position, and they are not replayed: an announcement made\nwhile you were disconnected is not sent again. At a station, only\nmessages for the station's zones or for the whole operator are sent.\n\n```\nevent: message\ndata: {\"event_type\":\"message_published\",\"message_id\":\"0f8e...\",\"operator_id\":\"8b1c...\",\"zone_ids\":null,\"subject\":\"Lot B closed Saturday\",\"body\":\"Use Lot C.\",\"push\":true,\"starts_at\":\"2026-10-02T15:04:05Z\",\"ends_at\":null,\"retired_at\":null,\"updated_at\":\"2026-10-02T15:04:05Z\"}\n```\n",
        "operationId": "streamSensorUpdates",
        "parameters": [
          {
            "name": "operator_id",
            "in": "query",
            "required": false,
            "description": "Filter to specific operator by UUID (e.g., `\"550e8400-e29b-41d4-a716-446655440000\"`).\n",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "uuids",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of sensor UUIDs to filter events.\nOnly events for these specific sensors will be pushed.\n",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "Replay events from a specific offset.\n\n**Format:** `occ:{partition}:{offset}` (e.g., `occ:0:12345`)\n\nUse the `id` field from the last received event. The stream will replay\nall missed events after it, then switch to real-time. Any other\nform starts the stream from now, without replay.\n",
            "schema": {
              "type": "string",
              "pattern": "^occ:[0-9]+:[0-9]+$"
            }
          },
          {
            "$ref": "#/components/parameters/Station"
          }
        ],
        "responses": {
          "200": {
            "description": "Server-Sent Events stream. Connection remains open and sends events as they occur.\nIf `Last-Event-ID` was provided, missed events are replayed first.\n",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-Sent Events stream"
                },
                "examples": {
                  "sensor_update": {
                    "summary": "Sensor occupancy change event",
                    "value": "id: occ:0:12345\nevent: update\ndata: {\"uuid\":\"123e4567-e89b-12d3-a456-426614174000\",\"status\":true,\"timestamp\":\"2025-11-06T12:00:00Z\",\"method\":\"sensor\",\"confidence\":1.0}\n"
                  },
                  "heartbeat": {
                    "summary": "Heartbeat (every 15 seconds)",
                    "value": ": heartbeat\n"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing or invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - no access to this operator; an\n\n`enforcement-station`-only officer at no station; or a station the\ncaller may not be at (`{\"error\": \"not_a_station_member\"}`, or\n`station_operator_mismatch` for a station of another operator than\nthe one streamed).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveError"
                }
              }
            }
          },
          "404": {
            "description": "Not found - operator not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/live/violations": {
      "get": {
        "tags": [
          "Get Live Updates"
        ],
        "summary": "Subscribe to violations as they start and end",
        "description": "Open a Server-Sent Events (SSE) stream of violation lifecycle events for\none operator: `violation_started` when the sensors detect a car parked\nwhere it should not be, `violation_ended` when it leaves, and\n`violation_voided` when an operator deletes the session it belonged to\n(it never happened: drop it from the open list, as for an ended one).\nThis is the enforcement officer's live feed.\n\n## Access\n\nOperator scope as for `/v1/live`, **plus** an enforcement officer\nrole: `reservation-compliance` or `reservation-admin`, the same people\nwho may call `/v1/reservations/check/*`. An organization's\nadministrator passes without one. Anyone else, an API key included,\ngets 403.\n\n## Stations\n\nA stream is opened at a station by a person: their token and\n`X-Station: <station_id>`, for a station they are a member of, or of\nan organization they administer.\n\nThe stream then carries only the station's zones. `enforcement-station`\ncounts as an officer role there -- and only there: an officer holding\nnothing else gets 403 at no station. The station narrows; the\nperson's roles decide. `/v1/live` narrows the same way.\n\n## Seeding and reconnecting\n\nThe stream carries only what happens after you connect, and **has no\nreplay**: `Last-Event-ID` is not honored, because replaying an hour of\nviolations as if they were happening now is worse than missing them.\nLoad what is already open from `GET /v1/reservations/check/violations`,\nthen apply events from this stream; on reconnect, load it again.\n\n## Event format\n\nEvery message is `event: violation`, its `data` a ViolationEvent.\nFields may be added; ignore the ones you do not know.\n\n```\nid: 0:812\nevent: violation\ndata: {\"event_type\":\"violation_started\",\"violation_id\":\"9f1d...\",\"kind\":\"no_reservation\",\"severity\":\"warning\",\"uuid\":\"dc34...\",\"space_number\":\"A-12\",\"zone_id\":\"3333...\",\"violation_start\":\"2026-09-17T09:05:00Z\",\"evidence\":{\"grace_minutes\":5},\"timestamp\":\"2026-09-17T09:05:30Z\"}\n\n: heartbeat\n```\n\nHeartbeats are sent every 15 seconds while the lot is quiet.\n",
        "operationId": "streamViolations",
        "parameters": [
          {
            "name": "operator_id",
            "in": "query",
            "required": false,
            "description": "Operator UUID or name. Optional when the token acts for one\norganization (an API key's always does, or `X-Active-Org` names\none), which then defaults to its operator; required otherwise.\n",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Station"
          }
        ],
        "responses": {
          "200": {
            "description": "Server-Sent Events stream of `event: violation` messages. The `data`\nof each is a ViolationEvent. The connection stays open.\n",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-Sent Events stream; each `data` line is a ViolationEvent as JSON."
                },
                "examples": {
                  "violation_started": {
                    "summary": "A violation begins",
                    "value": "id: 0:812\nevent: violation\ndata: {\"event_type\":\"violation_started\",\"violation_id\":\"9f1d2c3b-4a5e-3f70-8a9b-0c1d2e3f4a5b\",\"kind\":\"no_reservation\",\"severity\":\"warning\",\"uuid\":\"dc34ce7b-465e-4169-a79d-add68adc64f2\",\"space_number\":\"A-12\",\"operator_id\":\"8b1c4f2e-0000-0000-0000-000000000000\",\"operator_name\":\"example-org\",\"zone_id\":\"33333333-3333-3333-3333-333333333333\",\"session_start\":\"2026-09-17T09:00:00Z\",\"violation_start\":\"2026-09-17T09:05:00Z\",\"evidence\":{\"grace_minutes\":5},\"timestamp\":\"2026-09-17T09:05:30Z\"}\n"
                  },
                  "heartbeat": {
                    "summary": "Heartbeat (every 15 seconds)",
                    "value": ": heartbeat\n"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing or invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or invalid authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - no access to this operator, or not an enforcement\nofficer; or a station the caller may not be at\n(`{\"error\": \"not_a_station_member\"}`, `station_operator_mismatch`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveError"
                }
              }
            }
          },
          "404": {
            "description": "Not found - operator not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/facilities": {
      "get": {
        "operationId": "listFacilities",
        "tags": [
          "Build Your Map",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List facilities and their floors",
        "description": "Garages and lots as places, each with its floors in building order (top floor first) and how many spaces are free on each.\n\nA floor is counted from whatever measures it, said by `counted_by`:\n- `spaces`: its space sensors.\n- `zone`: its own zone's count (a counter or the lanes at its ramp), with its sensors where it has them.\n- `estimate`: spaces nothing measures, filled at the rate a zone's count or the garage's entrance count leaves for them: show it as \"about\".\n- `partial`: some spaces nothing measures (`unknown` of them); `capacity` and `free` cover the rest: show it as \"at least\".\n- `none`: nothing measures it; `free` is null.\n\n`free` is `capacity - occupied`, never below zero. A facility's own `capacity`, `free` and `counted_by` are its floors added up for an app user, and its whole count (`gates` when counted at its entrance) for its organization's staff.\n\nAn app user sees a facility with at least one public zone, and only the floors a public zone is on.\n\nA floor's `floor_plan`, when it has one, is an image to draw under its spaces: `url`, its four `corners` as `[lng, lat]` clockwise from the top left, and `opacity`.\n",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "description": "Latitude of the point to search around. Requires `lon`.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "description": "Longitude of the point to search around. Requires `lat`.",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "description": "Search radius in metres around `lat`/`lon` (default 1000, at most 20000).",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "facility_id",
            "in": "query",
            "description": "One or more facility IDs, comma-separated.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operator_id",
            "in": "query",
            "description": "The operator whose facilities to list.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Facilities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "facilities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "facility_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "operator_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "garage",
                              "lot",
                              "street",
                              "other"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "address": {
                            "type": "object"
                          },
                          "center_coordinates": {
                            "type": "object",
                            "nullable": true,
                            "properties": {
                              "lat": {
                                "type": "number"
                              },
                              "lon": {
                                "type": "number"
                              }
                            }
                          },
                          "footprint": {
                            "type": "object",
                            "nullable": true,
                            "description": "GeoJSON Polygon"
                          },
                          "capacity": {
                            "type": "integer"
                          },
                          "free": {
                            "type": "integer",
                            "nullable": true
                          },
                          "counted_by": {
                            "type": "string",
                            "enum": [
                              "spaces",
                              "zone",
                              "estimate",
                              "partial",
                              "none",
                              "gates"
                            ]
                          },
                          "unknown": {
                            "type": "integer",
                            "description": "Spaces nothing measures"
                          },
                          "distance": {
                            "type": "number",
                            "description": "Metres from the point searched around"
                          },
                          "levels": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "level_id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "ordinal": {
                                  "type": "integer",
                                  "description": "0 is the ground floor; negative below"
                                },
                                "name": {
                                  "type": "string",
                                  "example": "Level 3"
                                },
                                "short_name": {
                                  "type": "string",
                                  "example": "3"
                                },
                                "elevation_m": {
                                  "type": "number",
                                  "nullable": true
                                },
                                "outline": {
                                  "type": "object",
                                  "nullable": true,
                                  "description": "GeoJSON Polygon; the facility's footprint when null"
                                },
                                "capacity": {
                                  "type": "integer"
                                },
                                "occupied": {
                                  "type": "integer"
                                },
                                "free": {
                                  "type": "integer",
                                  "nullable": true,
                                  "example": 22
                                },
                                "counted_by": {
                                  "type": "string",
                                  "enum": [
                                    "spaces",
                                    "zone",
                                    "estimate",
                                    "partial",
                                    "none"
                                  ]
                                },
                                "unknown": {
                                  "type": "integer",
                                  "description": "Spaces nothing measures"
                                },
                                "zone_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "floor_plan": {
                                  "type": "object",
                                  "nullable": true
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Neither a place, a facility nor an operator was given",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/operators": {
      "get": {
        "operationId": "getOperators",
        "tags": [
          "Build Your Map",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get parking operators",
        "description": "Retrieves parking operators your account has access to. Each operator represents a parking management organization with their own zones, sensors, and access permissions. Results are automatically filtered based on your authentication credentials.\n\n**What's included:**\n- `id`: Unique operator identifier (UUID) for API filtering\n- `name`: Short operator name (also accepted in operator_id filters)\n- `display_name`: Human-readable operator name for UI display\n- `realm`: The organization's alias, as `X-Active-Org` takes it\n- `products`: The organization's product flags, for callers acting for an organization (an API key, an organization's staff)\n\n**Use cases:**\n- Building operator selection interfaces for multi-operator dashboards\n- Discovering which operators your account can access during integration setup\n- Retrieving display names for showing operator information in UIs\n- Validating operator access before making data requests\n\n**Public callers** (an app user, the app's guest token, an account in no organization) are listed only the operators that have at least one public zone, and an operator with none answers as if it did not exist.\n\n**Note:** Sensor and zone endpoints already include operator information in responses, so you typically only need this endpoint when building operator-specific features or selection menus.\n",
        "parameters": [
          {
            "in": "query",
            "name": "operator_id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional operator filter. Accepts either:\n- operator UUID (for example, `a1b2c3d4-e5f6-7890-abcd-ef1234567890`)\n- short operator name (for example, `example-org`)\n\nThe filter still only matches operators you may see: an API key matches only its own organization's.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved parking operators",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Unique operator identifier (use for operator_id parameter in other endpoints)"
                      },
                      "name": {
                        "type": "string",
                        "description": "Short operator name"
                      },
                      "display_name": {
                        "type": "string",
                        "description": "Human-readable operator name for UI display"
                      },
                      "realm": {
                        "type": "string",
                        "description": "The organization's alias, as `X-Active-Org` takes it",
                        "nullable": true
                      },
                      "products": {
                        "type": "object",
                        "description": "The organization's product flags. Included for callers acting for an organization, not for public callers.",
                        "additionalProperties": true
                      }
                    }
                  }
                },
                "examples": {
                  "organization_response": {
                    "summary": "An API key's answer includes products",
                    "value": [
                      {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "name": "example-org",
                        "display_name": "Example Org Parking",
                        "realm": "example-org",
                        "products": {
                          "payments": true,
                          "permits": false
                        }
                      }
                    ]
                  },
                  "public_response": {
                    "summary": "A public caller's answer omits products",
                    "value": [
                      {
                        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                        "name": "example-org",
                        "display_name": "Example Org Parking",
                        "realm": "example-org"
                      },
                      {
                        "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
                        "name": "other-org",
                        "display_name": "Other Org Parking",
                        "realm": "other-org"
                      }
                    ]
                  }
                }
              }
            }
          },
          "204": {
            "description": "No content - No operators found.\n\nThe query was valid but returned zero results. This typically means no active operators are configured in the system or your account has no operator access permissions.\n"
          },
          "401": {
            "description": "Authentication failed - Missing or invalid Bearer token.\n\nSolution: Include a valid token as `Authorization: Bearer <token>`\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - The token is not one this API accepts (an API key that has\nexpired, been paused, or whose organization's contract ended), or\n`X-Active-Org` names an organization it may not act for.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: over 100 in a minute from one client for one\norganization. The `message` says how many seconds to wait.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.\n\nIf this persists, contact support with the request details.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stations/current": {
      "get": {
        "operationId": "getCurrentStation",
        "tags": [
          "Stations"
        ],
        "summary": "What to show at a station",
        "description": "Resolves the caller into the view the officer app shows. A station is\nworked by a person who signs in: a person's token and\n`X-Station: <station_id>`, for a live station of their active operator\nthat they were given, or of an operator they administer.\n\nAnswers:\n\n- `{\"view\": \"station\", \"station\": {...}, \"actor_kind\": \"person\", \"access\": \"member\" | \"admin\"}`.\n  What the person's token allows decides what may be done here; the\n  station's zones narrow it, in every service.\n- `{\"view\": \"patrol\"}` -- a person at no station; the ordinary officer app.\n- `{\"view\": \"blocked\", \"reason\": \"station_only\"}` -- a person whose only\n  `enforcement.check` is a station action, at no station. The app lists\n  `/v1/stations/mine`.\n\nRefusal, 403 `{\"error\": \"not_a_station_member\"}`: `X-Station` names a\nstation the person may not open -- not a member (and not its org's\nadministrator), archived, another org's, or no such station. One answer\nfor all of them.\n\nA `custom` station's `config` names a registry module and major and is\nreturned resolved to its `module_url` and `element`, or with an `error` the\napp shows instead of loading anything. See the Station schema.\n\n`view` and `config` are derived from the station's application, which the\nstation also carries as `application: {id, name}` (null for a station made\nbefore applications existed).\n",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "X-Station",
            "in": "header",
            "required": false,
            "description": "The station a signed-in person is working at (a `station_id` from `/v1/stations/mine`).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Active-Org",
            "in": "header",
            "required": false,
            "description": "The operator's organization alias, when the token names more than one organization.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The view to show.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "view"
                  ],
                  "properties": {
                    "view": {
                      "type": "string",
                      "enum": [
                        "patrol",
                        "station",
                        "blocked"
                      ]
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "station_only"
                      ]
                    },
                    "station": {
                      "$ref": "#/components/schemas/Station"
                    },
                    "actor_kind": {
                      "type": "string",
                      "enum": [
                        "person"
                      ],
                      "description": "Who is acting at the station, as the audit logs record it."
                    },
                    "access": {
                      "type": "string",
                      "enum": [
                        "member",
                        "admin"
                      ],
                      "description": "Why the person may be at this station."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "`not_a_station_member`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stations/mine": {
      "get": {
        "operationId": "listMyStations",
        "tags": [
          "Stations"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "The stations I may work at",
        "description": "Every live station the caller may open with `X-Station`, sorted by name,\neach marked with `access`:\n\n- `member` -- the caller was given the station, in any of their\n  organizations. An administrator gives people a station in the operator\n  console.\n- `admin` -- every other live station of an organization the caller\n  administers.\n\nBeing listed grants nothing: at the station the caller holds their own\nroles, in its zones.\n\nEach station is the Station schema (a `custom` one with its module resolved,\nas `/v1/stations/current` returns it) plus `operator_name`, `zone_names`,\nthe station's `lat`/`lon` when it has a place, and `access`.\n",
        "responses": {
          "200": {
            "description": "The caller's stations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stations": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/Station"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "operator_name": {
                                "type": "string"
                              },
                              "zone_names": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "lat": {
                                "type": "number",
                                "nullable": true
                              },
                              "lon": {
                                "type": "number",
                                "nullable": true
                              },
                              "access": {
                                "type": "string",
                                "enum": [
                                  "member",
                                  "admin"
                                ]
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensors": {
      "get": {
        "operationId": "getSensors",
        "tags": [
          "Build Your Map",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get complete sensor data",
        "description": "Retrieves complete sensor information including both static metadata and real-time occupancy status in a single API call. This endpoint combines data from `/v1/sensors/static` and `/v1/sensors/state` for convenience.\n\n**What's included:**\n- All static metadata: coordinates, zone IDs, space numbers, boundaries, friendly names\n- Current occupancy status: occupied/vacant state with timestamps\n- Operator and zone references for rule lookup\n\n**When to use this endpoint:**\n- Initial map load when you need both location and status data\n- Less frequent updates where convenience matters more than payload size\n- Building dashboards that show complete sensor information\n\n**When to use separate endpoints instead:**\nFor frequently updated maps or real-time applications, call `/v1/sensors/static` once to get locations, then poll `/v1/sensors/state` every 10-30 seconds for status updates. This approach:\n- Reduces bandwidth by ~70% per update\n- Provides faster response times\n- Works better for high-frequency polling\n\n**Query modes:**\n- **By operator:** Get complete data for one or more operators (comma-separated)\n- **By zone:** Get complete data for all sensors in a specific zone\n- **By location:** Get complete data for sensors within a geographic radius\n- **Optional sensor filter:** In any mode, pass `sensors=uuid1,uuid2,...` to return only those sensors\n\n**Caching:** The `X-Cache-Timestamp` header indicates when the state data was cached - use this for replay synchronization.\n\n**Differential queries:** Pass the `X-Cache-Timestamp` from a previous response as a request header to only receive sensors whose occupancy changed since that time. Static metadata is included for each changed sensor.\n",
        "parameters": [
          {
            "name": "X-Cache-Timestamp",
            "in": "header",
            "description": "Return only sensors whose occupancy changed after this timestamp.\n\nPass the `X-Cache-Timestamp` value from a previous response to get a differential update containing only sensors with state changes. Each changed sensor includes full static metadata + updated state.\n\n**Format:** ISO 8601 timestamp (e.g., `2025-11-06T12:00:00Z`)\n\nWhen omitted, returns the full set of sensors.\n\n**Note:** The diff is applied in-memory from cached data (up to 10 seconds stale). This avoids additional database queries while still reducing payload size.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "X-Sensor-Filter",
            "in": "header",
            "description": "Alternative to the `sensors` query parameter for large sensor UUID lists.\n\nAccepts:\n- **Plain CSV:** `uuid1,uuid2,...` \u2014 use for moderate-sized lists\n- **Base64-encoded CSV:** `b64:<base64>` \u2014 use when the list would exceed URL length limits\n\nThe same security limits apply as for the `sensors` query parameter (max 100 UUIDs, max 4,000 characters after decoding).\n\nCannot be combined with the `sensors` query parameter.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operator_id",
            "in": "query",
            "description": "Filter sensors by one or more operators.\n\nAccepts:\n- Single UUID: `operator_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890`\n- Single name: `operator_id=example-org`\n- Multiple UUIDs: `operator_id=uuid1,uuid2,uuid3`\n- Multiple names: `operator_id=example-org,other-org`\n\nReturns complete sensor data (location + status) for all sensors belonging to the specified operator(s). Cannot be combined with `zone_id` or geographic search.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sensors",
            "in": "query",
            "description": "Optional comma-separated list of sensor UUIDs to restrict the response.\n\nExample:\n- `sensors=550e8400-e29b-41d4-a716-446655440000,6ba7b810-9dad-11d1-80b4-00c04fd430c8`\n\nSecurity limits:\n- Maximum UUID count: 100\n- Maximum total query length: 4,000 characters\n\nIf limits are exceeded, the API returns HTTP 400 with a specific `Sensor CSV limit exceeded` or `Sensor CSV query too long` error.\n\nFor lists that would exceed URL length limits, use the `X-Sensor-Filter` header instead.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zone_id",
            "in": "query",
            "description": "Filter sensors by zone ID.\n\nReturns complete sensor data for all sensors in the specified zone.\nExample: `zone_id=123e4567-e89b-12d3-a456-426614174000`\n\nCannot be combined with `operator_id` or geographic search parameters.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "Latitude coordinate for geographic search in decimal degrees (WGS84).\n\nValid range: -90 to 90\nExample: `lat=35.2271`\n\nReturns complete sensor data from all zones within the specified radius. Must be used with `lon` and `radius`.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "description": "Longitude coordinate for geographic search in decimal degrees (WGS84).\n\nValid range: -180 to 180\nExample: `lon=-80.8431`\n\nReturns complete sensor data from all zones within the specified radius. Must be used with `lat` and `radius`.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "description": "Search radius in meters for geographic queries.\n\nValid range: 1 to 50,000 meters\nExample: `radius=1500`\n\nMust be used with `lat` and `lon` parameters.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved combined sensor data",
            "headers": {
              "X-Cache-Timestamp": {
                "description": "ISO 8601 timestamp indicating when the data was snapshot/cached (based on state components). Use this for replay synchronization with the /v1/live event stream.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Unique sensor identifier"
                      },
                      "space_number": {
                        "type": "integer",
                        "description": "Physical space number or identifier",
                        "nullable": true
                      },
                      "zone_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Zone assignment (use to join with /v1/zones for rules)",
                        "nullable": true
                      },
                      "lon": {
                        "type": "number",
                        "format": "float",
                        "description": "Longitude coordinate (WGS84 decimal degrees)"
                      },
                      "lat": {
                        "type": "number",
                        "format": "float",
                        "description": "Latitude coordinate (WGS84 decimal degrees)"
                      },
                      "operator_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Operator ID"
                      },
                      "friendly_name": {
                        "type": "string",
                        "description": "Human-readable sensor name or identifier",
                        "nullable": true
                      },
                      "parking_space_boundary": {
                        "type": "object",
                        "description": "GeoJSON polygon defining the parking space boundary (optional)",
                        "nullable": true
                      },
                      "occupancy_status": {
                        "type": "boolean",
                        "description": "Current occupancy status (true = occupied, false = vacant)"
                      },
                      "occupancy_timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "ISO 8601 timestamp of last status change",
                        "nullable": true
                      },
                      "status": {
                        "type": "string",
                        "description": "Sensor operational status. Indicates whether the sensor is active and being monitored.\n\nPossible values:\n- `online` \u2014 Sensor is active and reporting normally\n- `reserved` \u2014 Sensor is active and the space is designated as reserved\n- `offline` \u2014 Sensor has lost connectivity and is not reporting\n- `maintenance` \u2014 Sensor is temporarily taken out of service\n- `decommissioned` \u2014 Sensor has been permanently retired\n",
                        "enum": [
                          "online",
                          "reserved",
                          "offline",
                          "maintenance",
                          "decommissioned"
                        ],
                        "nullable": true
                      }
                    }
                  }
                },
                "example": [
                  {
                    "uuid": "550e8400-e29b-41d4-a716-446655440000",
                    "space_number": 101,
                    "zone_id": "123e4567-e89b-12d3-a456-426614174000",
                    "lon": -80.8431,
                    "lat": 35.2271,
                    "operator_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "friendly_name": "Main Lot A-101",
                    "parking_space_boundary": {
                      "type": "Polygon",
                      "coordinates": [
                        [
                          [
                            -80.8432,
                            35.227
                          ],
                          [
                            -80.843,
                            35.227
                          ],
                          [
                            -80.843,
                            35.2272
                          ],
                          [
                            -80.8432,
                            35.2272
                          ],
                          [
                            -80.8432,
                            35.227
                          ]
                        ]
                      ]
                    },
                    "occupancy_status": true,
                    "occupancy_timestamp": "2025-11-06T14:23:45Z",
                    "status": "online"
                  },
                  {
                    "uuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
                    "space_number": 102,
                    "zone_id": "123e4567-e89b-12d3-a456-426614174000",
                    "lon": -80.8432,
                    "lat": 35.2272,
                    "operator_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "friendly_name": "Main Lot A-102",
                    "parking_space_boundary": {
                      "type": "Polygon",
                      "coordinates": [
                        [
                          [
                            -80.8433,
                            35.2271
                          ],
                          [
                            -80.8431,
                            35.2271
                          ],
                          [
                            -80.8431,
                            35.2273
                          ],
                          [
                            -80.8433,
                            35.2273
                          ],
                          [
                            -80.8433,
                            35.2271
                          ]
                        ]
                      ]
                    },
                    "occupancy_status": false,
                    "occupancy_timestamp": "2025-11-06T13:15:30Z",
                    "status": "reserved"
                  }
                ]
              }
            }
          },
          "204": {
            "description": "No content - No sensors found matching the specified criteria.\n\nThe query was valid but returned zero results.\n"
          },
          "400": {
            "description": "Bad request - Invalid or missing parameters.\n\nCommon causes:\n- No query parameters provided (must specify `operator_id`, `zone_id`, or geographic search)\n- Invalid radius value (must be 1-50,000 meters)\n- Invalid coordinate values (lat: -90 to 90, lon: -180 to 180)\n- Geographic search missing required parameters (need all three: `lat`, `lon`, `radius`)\n- Invalid `sensors` CSV format (must be UUIDs)\n- `sensors` CSV exceeded security limits (max 100 UUIDs, max 4,000 characters)\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed - Missing or invalid Bearer token.\n\nSolution: Include a valid token as `Authorization: Bearer <token>`\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Access denied to requested resource.\n\nYour account doesn't have permission to access this operator's data.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.\n\nThe specified operator ID, operator name, or zone ID doesn't exist. A zone that is not public answers the same to a public caller.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: over 100 in a minute from one client for one\norganization. The `message` says how many seconds to wait.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.\n\nIf this persists, contact support with the request details.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensors/state": {
      "get": {
        "operationId": "getStateSnapshot",
        "tags": [
          "Build Your Map",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get sensor occupancy states",
        "description": "Retrieves current occupancy states for parking sensors, showing whether each space is occupied or vacant. This lightweight endpoint is optimized for high-frequency polling and real-time map updates.\n\n**What's included:**\n- `uuid`: Unique sensor identifier (matches UUIDs from `/v1/sensors/static`)\n- `operator_id`: Operator that owns the sensor\n- `occupancy_status`: Boolean indicating if space is occupied (true) or vacant (false)\n- `occupancy_timestamp`: ISO 8601 timestamp of last status change\n\n**Integration pattern:**\n1. Fetch sensor locations from `/v1/sensors/static` once (on app startup)\n2. Poll this endpoint every 10-30 seconds for status updates\n3. Join results by `uuid` to update map markers or availability counts\n\n**Why use this instead of the combined endpoint:**\n- **Smaller payload:** ~70% smaller - only status data, no location metadata\n- **Faster response:** Optimized for speed with minimal processing overhead\n- **Better for polling:** Ideal for high-frequency updates without bandwidth waste\n\n**Query modes:**\n- **By operator:** Get states for one or more operators (comma-separated)\n- **By zone:** Get states for all sensors in a specific zone\n- **By location:** Get states for sensors within a geographic radius\n- **Optional sensor filter:** In any mode, pass `sensors=uuid1,uuid2,...` to return only those sensors\n\n**Caching:** Results are cached for 10 seconds. The `X-Cache-Timestamp` header indicates when the data was cached - use this for replay synchronization.\n\n**Differential queries:** Pass the `X-Cache-Timestamp` from a previous response as a request header to only receive sensors that changed since that time. This dramatically reduces payload size for subsequent polls.\n",
        "parameters": [
          {
            "name": "X-Cache-Timestamp",
            "in": "header",
            "description": "Return only sensors whose occupancy changed after this timestamp.\n\nPass the `X-Cache-Timestamp` value from a previous response to get a differential update containing only changed sensors.\n\n**Format:** ISO 8601 timestamp (e.g., `2025-11-06T12:00:00Z`)\n\nWhen omitted, returns the full set of sensor states.\n\n**Note:** The diff is applied in-memory from cached data (up to 10 seconds stale). This avoids additional database queries while still reducing payload size.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "X-Sensor-Filter",
            "in": "header",
            "description": "Alternative to the `sensors` query parameter for large sensor UUID lists.\n\nAccepts:\n- **Plain CSV:** `uuid1,uuid2,...` \u2014 use for moderate-sized lists\n- **Base64-encoded CSV:** `b64:<base64>` \u2014 use when the list would exceed URL length limits\n\nThe same security limits apply as for the `sensors` query parameter (max 100 UUIDs, max 4,000 characters after decoding).\n\nCannot be combined with the `sensors` query parameter.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operator_id",
            "in": "query",
            "description": "Filter sensor states by one or more operators.\n\nAccepts:\n- Single UUID: `operator_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890`\n- Single name: `operator_id=example-org`\n- Multiple UUIDs: `operator_id=uuid1,uuid2,uuid3`\n- Multiple names: `operator_id=example-org,other-org`\n\nReturns occupancy status for all sensors belonging to the specified operator(s). Cannot be combined with `zone_id` or geographic search.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sensors",
            "in": "query",
            "description": "Optional comma-separated list of sensor UUIDs to restrict the response.\n\nExample:\n- `sensors=550e8400-e29b-41d4-a716-446655440000,6ba7b810-9dad-11d1-80b4-00c04fd430c8`\n\nSecurity limits:\n- Maximum UUID count: 100\n- Maximum total query length: 4,000 characters\n\nIf limits are exceeded, the API returns HTTP 400 with a specific `Sensor CSV limit exceeded` or `Sensor CSV query too long` error.\n\nFor lists that would exceed URL length limits, use the `X-Sensor-Filter` header instead.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zone_id",
            "in": "query",
            "description": "Filter sensor states by zone ID.\n\nReturns occupancy status for all sensors in the specified zone.\nExample: `zone_id=123e4567-e89b-12d3-a456-426614174000`\n\nCannot be combined with `operator_id` or geographic search parameters.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "Latitude coordinate for geographic search in decimal degrees (WGS84).\n\nValid range: -90 to 90\nExample: `lat=35.2271`\n\nReturns sensor states from all zones within the specified radius. Must be used with `lon` and `radius`.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "description": "Longitude coordinate for geographic search in decimal degrees (WGS84).\n\nValid range: -180 to 180\nExample: `lon=-80.8431`\n\nReturns sensor states from all zones within the specified radius. Must be used with `lat` and `radius`.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "description": "Search radius in meters for geographic queries.\n\nValid range: 1 to 50,000 meters\nExample: `radius=1500`\n\nMust be used with `lat` and `lon` parameters.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved sensor occupancy states",
            "headers": {
              "X-Cache-Timestamp": {
                "description": "ISO 8601 timestamp indicating when the data was snapshot/cached. Use this for replay synchronization with the /v1/live event stream.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Unique sensor identifier (matches UUIDs from /v1/sensors/static)"
                      },
                      "operator_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Operator ID"
                      },
                      "occupancy_status": {
                        "type": "boolean",
                        "description": "Current occupancy status (true = occupied, false = vacant)"
                      },
                      "occupancy_timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "ISO 8601 timestamp of last status change",
                        "nullable": true
                      },
                      "status": {
                        "type": "string",
                        "description": "Sensor operational status. Indicates whether the sensor is active and being monitored.\n\nPossible values:\n- `online` \u2014 Sensor is active and reporting normally\n- `reserved` \u2014 Sensor is active and the space is designated as reserved\n- `offline` \u2014 Sensor has lost connectivity and is not reporting\n- `maintenance` \u2014 Sensor is temporarily taken out of service\n- `decommissioned` \u2014 Sensor has been permanently retired\n",
                        "enum": [
                          "online",
                          "reserved",
                          "offline",
                          "maintenance",
                          "decommissioned"
                        ],
                        "nullable": true
                      }
                    }
                  }
                },
                "example": [
                  {
                    "uuid": "550e8400-e29b-41d4-a716-446655440000",
                    "occupancy_status": true,
                    "occupancy_timestamp": "2025-11-06T14:23:45Z",
                    "status": "online"
                  },
                  {
                    "uuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
                    "occupancy_status": false,
                    "occupancy_timestamp": "2025-11-06T13:15:30Z",
                    "status": "reserved"
                  }
                ]
              }
            }
          },
          "204": {
            "description": "No content - No sensors found matching the specified criteria.\n\nThe query was valid but returned zero results.\n"
          },
          "400": {
            "description": "Bad request - Invalid or missing parameters.\n\nCommon causes:\n- No query parameters provided (must specify `operator_id`, `zone_id`, or geographic search)\n- Invalid radius value (must be 1-50,000 meters)\n- Invalid coordinate values (lat: -90 to 90, lon: -180 to 180)\n- Geographic search missing required parameters (need all three: `lat`, `lon`, `radius`)\n- Invalid `sensors` CSV format (must be UUIDs)\n- `sensors` CSV exceeded security limits (max 100 UUIDs, max 4,000 characters)\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed - Missing or invalid Bearer token.\n\nSolution: Include a valid token as `Authorization: Bearer <token>`\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Access denied to requested resource.\n\nYour account doesn't have permission to access this operator's data.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.\n\nThe specified operator ID, operator name, or zone ID doesn't exist. A zone that is not public answers the same to a public caller.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: over 100 in a minute from one client for one\norganization. The `message` says how many seconds to wait.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.\n\nIf this persists, contact support with the request details.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sensors/static": {
      "get": {
        "operationId": "getStaticSnapshot",
        "tags": [
          "Build Your Map",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get sensor metadata",
        "description": "Retrieves static metadata for parking sensors including geographic coordinates, zone assignments, and space identifiers. This data rarely changes and is ideal for building the base layer of parking maps.\n\n**What's included:**\n- `uuid`: Unique sensor identifier\n- `space_number`: Physical space number for identification\n- `zone_id`: Zone assignment for rule lookup\n- `lon`, `lat`: Geographic coordinates (WGS84 decimal degrees)\n- `operator_id`: Operator that owns the sensor\n- `friendly_name`: Human-readable sensor identifier\n- `parking_space_boundary`: GeoJSON polygon defining space boundary (optional)\n\n**Integration pattern:**\n1. Call this endpoint once on app startup to get sensor locations\n2. Render sensors on your map using the coordinates\n3. Poll `/v1/sensors/state` every 10-30 seconds for status updates\n4. Join the two datasets using the `uuid` field\n\n**Query modes:**\n- **By operator:** Get all sensors for one or more operators (comma-separated)\n- **By zone:** Get all sensors within a specific zone\n- **By location:** Get sensors from all zones within a geographic radius\n- **Optional sensor filter:** In any mode, pass `sensors=uuid1,uuid2,...` to return only those sensors\n\n**Performance:** Results are cached for 60 seconds when querying by operator. Location-based and zone queries have no caching.\n",
        "parameters": [
          {
            "name": "X-Sensor-Filter",
            "in": "header",
            "description": "Alternative to the `sensors` query parameter for large sensor UUID lists.\n\nAccepts:\n- **Plain CSV:** `uuid1,uuid2,...` \u2014 use for moderate-sized lists\n- **Base64-encoded CSV:** `b64:<base64>` \u2014 use when the list would exceed URL length limits\n\nThe same security limits apply as for the `sensors` query parameter (max 100 UUIDs, max 4,000 characters after decoding).\n\nCannot be combined with the `sensors` query parameter.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operator_id",
            "in": "query",
            "description": "Filter sensors by one or more operators.\n\nAccepts:\n- Single UUID: `operator_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890`\n- Single name: `operator_id=example-org`\n- Multiple UUIDs: `operator_id=uuid1,uuid2,uuid3`\n- Multiple names: `operator_id=example-org,other-org`\n\nReturns all sensors belonging to the specified operator(s). Cannot be combined with `zone_id` or geographic search.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sensors",
            "in": "query",
            "description": "Optional comma-separated list of sensor UUIDs to restrict the response.\n\nExample:\n- `sensors=550e8400-e29b-41d4-a716-446655440000,6ba7b810-9dad-11d1-80b4-00c04fd430c8`\n\nSecurity limits:\n- Maximum UUID count: 100\n- Maximum total query length: 4,000 characters\n\nIf limits are exceeded, the API returns HTTP 400 with a specific `Sensor CSV limit exceeded` or `Sensor CSV query too long` error.\n\nFor lists that would exceed URL length limits, use the `X-Sensor-Filter` header instead.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zone_id",
            "in": "query",
            "description": "Filter sensors by zone ID.\n\nReturns all sensors assigned to the specified zone.\nExample: `zone_id=123e4567-e89b-12d3-a456-426614174000`\n\nCannot be combined with `operator_id` or geographic search parameters.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "Latitude coordinate for geographic search in decimal degrees (WGS84).\n\nValid range: -90 to 90\nExample: `lat=35.2271`\n\nReturns sensors from all zones within the specified radius. Must be used with `lon` and `radius`.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "description": "Longitude coordinate for geographic search in decimal degrees (WGS84).\n\nValid range: -180 to 180\nExample: `lon=-80.8431`\n\nReturns sensors from all zones within the specified radius. Must be used with `lat` and `radius`.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "description": "Search radius in meters for geographic queries.\n\nValid range: 1 to 50,000 meters\nExample: `radius=1500`\n\nMust be used with `lat` and `lon` parameters.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved sensor static data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "uuid": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Unique sensor identifier (use for joining with /v1/sensors/state)"
                      },
                      "space_number": {
                        "type": "integer",
                        "description": "Physical space number or identifier",
                        "nullable": true
                      },
                      "zone_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Zone assignment (use to join with /v1/zones for rules)",
                        "nullable": true
                      },
                      "lon": {
                        "type": "number",
                        "format": "float",
                        "description": "Longitude coordinate (WGS84 decimal degrees)"
                      },
                      "lat": {
                        "type": "number",
                        "format": "float",
                        "description": "Latitude coordinate (WGS84 decimal degrees)"
                      },
                      "operator_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Operator ID"
                      },
                      "friendly_name": {
                        "type": "string",
                        "description": "Human-readable sensor name or identifier",
                        "nullable": true
                      },
                      "parking_space_boundary": {
                        "type": "object",
                        "description": "GeoJSON polygon defining the parking space boundary (optional)",
                        "nullable": true
                      },
                      "status": {
                        "type": "string",
                        "description": "Sensor operational status. Indicates whether the sensor is active and being monitored.\n\nPossible values:\n- `online` \u2014 Sensor is active and reporting normally\n- `reserved` \u2014 Sensor is active and the space is designated as reserved\n- `offline` \u2014 Sensor has lost connectivity and is not reporting\n- `maintenance` \u2014 Sensor is temporarily taken out of service\n- `decommissioned` \u2014 Sensor has been permanently retired\n",
                        "enum": [
                          "online",
                          "reserved",
                          "offline",
                          "maintenance",
                          "decommissioned"
                        ],
                        "nullable": true
                      }
                    }
                  }
                },
                "example": [
                  {
                    "uuid": "550e8400-e29b-41d4-a716-446655440000",
                    "space_number": 101,
                    "zone_id": "123e4567-e89b-12d3-a456-426614174000",
                    "lon": -80.8431,
                    "lat": 35.2271,
                    "operator_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "friendly_name": "Main Lot A-101",
                    "parking_space_boundary": {
                      "type": "Polygon",
                      "coordinates": [
                        [
                          [
                            -80.8432,
                            35.227
                          ],
                          [
                            -80.843,
                            35.227
                          ],
                          [
                            -80.843,
                            35.2272
                          ],
                          [
                            -80.8432,
                            35.2272
                          ],
                          [
                            -80.8432,
                            35.227
                          ]
                        ]
                      ]
                    },
                    "status": "online"
                  },
                  {
                    "uuid": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
                    "space_number": 102,
                    "zone_id": "123e4567-e89b-12d3-a456-426614174000",
                    "lon": -80.8432,
                    "lat": 35.2272,
                    "operator_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "friendly_name": "Main Lot A-102",
                    "parking_space_boundary": {
                      "type": "Polygon",
                      "coordinates": [
                        [
                          [
                            -80.8433,
                            35.2271
                          ],
                          [
                            -80.8431,
                            35.2271
                          ],
                          [
                            -80.8431,
                            35.2273
                          ],
                          [
                            -80.8433,
                            35.2273
                          ],
                          [
                            -80.8433,
                            35.2271
                          ]
                        ]
                      ]
                    },
                    "status": "reserved"
                  }
                ]
              }
            }
          },
          "204": {
            "description": "No content - No sensors found matching the specified criteria.\n\nThe query was valid but returned zero results.\n"
          },
          "400": {
            "description": "Bad request - Invalid or missing parameters.\n\nCommon causes:\n- No query parameters provided (must specify `operator_id`, `zone_id`, or geographic search)\n- Invalid radius value (must be 1-50,000 meters)\n- Invalid coordinate values (lat: -90 to 90, lon: -180 to 180)\n- Geographic search missing required parameters (need all three: `lat`, `lon`, `radius`)\n- Invalid `sensors` CSV format (must be UUIDs)\n- `sensors` CSV exceeded security limits (max 100 UUIDs, max 4,000 characters)\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed - Missing or invalid Bearer token.\n\nSolution: Include a valid token as `Authorization: Bearer <token>`\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Access denied to requested resource.\n\nYour account doesn't have permission to access this operator's data.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.\n\nThe specified operator ID, operator name, or zone ID doesn't exist. A zone that is not public answers the same to a public caller.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: over 100 in a minute from one client for one\norganization. The `message` says how many seconds to wait.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.\n\nIf this persists, contact support with the request details.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/zones": {
      "get": {
        "operationId": "getZones",
        "tags": [
          "Build Your Map",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get parking zone information",
        "description": "Retrieves parking zones with metadata including boundaries, rules, capacity, and location. Zones represent logical groupings of parking spaces with shared rules and rates.\n\n**What's included:**\n- `zone_id`: Unique zone identifier\n- `display_name`: Human-readable zone name\n- `operator_id`: Operator that owns this zone\n- `occupancy_method`: How occupancy is calculated (sensor, manual, camera, estimated)\n- `occupancy_max`: Total zone capacity (null if not configured)\n- `rules`: Effective current rules (the organization's default rules, the zone's base rules, and its active permanent/temporary policies)\n- `center_coordinates`: Geographic center for quick positioning\n- `boundary`: GeoJSON polygon for map rendering\n- `public`: Whether the zone is shown to the public. A public caller (an app user, the app's guest token, an account in no organization) receives public zones only; an organization's staff receive every zone of their organizations, and Parkeze staff every zone.\n- `pay`: Present when parking here is sold in the app: `right_key` (`space` or `vehicle`, what checkout asks for), `collection_mode`, whether the seller allows extensions and early stops, whether it is selling now and at what rate. Who sells it is not part of the answer.\n- `occupancy_confidence`: How sure the zone's occupancy is, 0 to 1, when it was decided from evidence.\n\n**Query modes:**\n- **By operator:** Get all zones for a specific operator (required if not using location search)\n- **By location:** Get zones within a geographic radius, sorted by distance\n\n**Use cases:**\n- Display zone boundaries on parking maps\n- Show parking rules and rates to users\n- Calculate zone capacity and availability\n- Filter zones by proximity to user location\n",
        "parameters": [
          {
            "name": "operator_id",
            "in": "query",
            "required": true,
            "description": "The operator whose zones you want to retrieve. Required if location parameters are not provided.\n\nAccepts either:\n- **UUID format:** `operator_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890`\n- **Name format:** `operator_id=example-org`\n\nUse `/v1/operators` to discover available operator IDs and names.\n",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "Latitude coordinate for geographic filtering in decimal degrees (WGS84).\n\nValid range: -90 to 90\nExample: `lat=35.2271`\n\nWhen provided, must be used with `lon` and `radius`. Results will be sorted by distance.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "description": "Longitude coordinate for geographic filtering in decimal degrees (WGS84).\n\nValid range: -180 to 180\nExample: `lon=-80.8431`\n\nWhen provided, must be used with `lat` and `radius`. Results will be sorted by distance.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "description": "Search radius in meters from the center point.\n\nDefault: 1000 meters (1 kilometer)\nValid range: 1 to 50,000 meters\n\nChoose based on your use case:\n- City block: 200-500m\n- Neighborhood: 1000-2000m  \n- City-wide: 5000-10000m\n\nWhen provided, must be used with `lat` and `lon`. Results will be sorted by distance.\n",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of parking zones.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "zone_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Unique zone identifier"
                      },
                      "display_name": {
                        "type": "string",
                        "description": "Human-readable zone name"
                      },
                      "operator_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Operator ID that owns this zone"
                      },
                      "occupancy_method": {
                        "type": "string",
                        "description": "How zone calculates occupancy (sensor, manual, camera, estimated)",
                        "enum": [
                          "sensor",
                          "manual",
                          "camera",
                          "estimated"
                        ]
                      },
                      "occupancy_max": {
                        "type": "integer",
                        "description": "Maximum capacity of the zone (total parking spaces)",
                        "nullable": true
                      },
                      "rules": {
                        "type": "object",
                        "description": "Effective current parking rules (organization defaults + base rules + active policy overrides)"
                      },
                      "public": {
                        "type": "boolean",
                        "description": "Whether the zone is shown to the public (always true in a public caller's answer)"
                      },
                      "pay": {
                        "type": "object",
                        "description": "Present when parking here is sold in the app",
                        "properties": {
                          "right_key": {
                            "type": "string",
                            "enum": [
                              "space",
                              "vehicle"
                            ]
                          },
                          "collection_mode": {
                            "type": "string",
                            "enum": [
                              "seller_collects",
                              "platform_collects"
                            ]
                          },
                          "allows_extensions": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "allows_stops": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "selling": {
                            "type": "boolean",
                            "nullable": true
                          },
                          "rate": {
                            "type": "object",
                            "nullable": true,
                            "properties": {
                              "amount": {
                                "type": "string"
                              },
                              "currency": {
                                "type": "string"
                              },
                              "per_minutes": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      },
                      "occupancy_confidence": {
                        "type": "number",
                        "description": "How sure the zone's occupancy is, 0 to 1"
                      },
                      "center_coordinates": {
                        "type": "object",
                        "properties": {
                          "lon": {
                            "type": "number"
                          },
                          "lat": {
                            "type": "number"
                          }
                        }
                      },
                      "boundary": {
                        "type": "object",
                        "description": "GeoJSON polygon of zone boundary"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "zone_id": "123e4567-e89b-12d3-a456-426614174000",
                    "display_name": "Zone-A Downtown",
                    "operator_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "occupancy_method": "sensor",
                    "occupancy_max": 100,
                    "rules": {
                      "time_limit_minutes": 120,
                      "rate_per_hour": 2.5
                    },
                    "center_coordinates": {
                      "lon": -80.8431,
                      "lat": 35.2271
                    },
                    "boundary": {
                      "type": "Polygon",
                      "coordinates": [
                        [
                          [
                            -80.845,
                            35.226
                          ],
                          [
                            -80.841,
                            35.226
                          ],
                          [
                            -80.841,
                            35.228
                          ],
                          [
                            -80.845,
                            35.228
                          ],
                          [
                            -80.845,
                            35.226
                          ]
                        ]
                      ]
                    }
                  }
                ]
              }
            }
          },
          "204": {
            "description": "No content - No zones found matching the specified criteria.\n\nThe query was valid but returned zero results.\n"
          },
          "400": {
            "description": "Bad request - Invalid or missing parameters.\n\nCommon causes:\n- Missing `operator_id` when not using geographic search\n- Invalid radius value (must be 1-50,000 meters)\n- Invalid coordinate values (lat: -90 to 90, lon: -180 to 180)\n- Geographic search missing required parameters (need all three: `lat`, `lon`, `radius`)\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed - Missing or invalid Bearer token.\n\nSolution: Include a valid token as `Authorization: Bearer <token>`\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Access denied to requested resource.\n\nYour account doesn't have permission to access this operator's data.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.\n\nThe specified operator ID or name doesn't exist.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: over 100 in a minute from one client for one\norganization. The `message` says how many seconds to wait.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.\n\nIf this persists, contact support with the request details.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/zones/occupancy": {
      "get": {
        "operationId": "getZoneOccupancy",
        "tags": [
          "Build Your Map",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get zone occupancy",
        "description": "Retrieves real-time occupancy data for parking zones, showing how many spaces are occupied, available, and the total capacity. This endpoint provides zone-level availability perfect for displaying on maps or in availability dashboards.\n\n**Occupancy calculation methods:**\n- **sensor:** Calculated from individual sensor states in real-time\n- **camera:** Determined by computer vision systems\n- **manual:** Manually updated by operators\n- **estimated:** Calculated using predictive algorithms\n\n**Response data:**\n- `occupied`: Current number of occupied spaces\n- `total`: Total zone capacity (may be null if not configured)\n- `available`: Calculated as `total - occupied` (null if total is unknown)\n\n**Query options:** You can query by specific zone IDs, all zones for an operator, or all zones within a geographic radius.\n\n**Caching:** Results are cached for 10 seconds to balance real-time accuracy with API performance. If you need sensor-level granularity, use the `/v1/sensors/state` endpoint instead.\n",
        "parameters": [
          {
            "name": "zone_id",
            "in": "query",
            "description": "One or more zone IDs to retrieve occupancy for. Accepts a single UUID or a comma-separated list of UUIDs.\n\nExample: `zone_id=123e4567-e89b-12d3-a456-426614174000`\nMultiple: `zone_id=uuid1,uuid2,uuid3`\n\nCannot be combined with `operator_id` or geographic search parameters.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operator_id",
            "in": "query",
            "description": "Filter zones by operator. Accepts either a UUID or the operator's name string. Returns occupancy data for all zones belonging to the specified operator.\n\nExample by UUID: `operator_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890`\nExample by name: `operator_id=example-org`\n\nCannot be combined with `zone_id` or geographic search parameters.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "description": "Latitude coordinate for geographic search in decimal degrees (WGS84).\n\nValid range: -90 to 90\nExample: `lat=35.2271`\n\nMust be used together with `lon` and `radius` parameters. Cannot be combined with `zone_id` or `operator_id`.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "description": "Longitude coordinate for geographic search in decimal degrees (WGS84).\n\nValid range: -180 to 180\nExample: `lon=-80.8431`\n\nMust be used together with `lat` and `radius` parameters. Cannot be combined with `zone_id` or `operator_id`.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "description": "Search radius in meters from the center point specified by `lat` and `lon`.\n\nValid range: 1 to 50,000 meters\nExample: `radius=2000` (2 kilometers)\n\nRecommended values:\n- Urban areas: 500-1000m\n- Suburban areas: 2000-5000m\n- Wide-area searches: up to 50000m\n\nMust be used together with `lat` and `lon` parameters.\n",
            "required": false,
            "schema": {
              "type": "number",
              "format": "float"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved zone occupancy data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "zone_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Unique zone identifier"
                      },
                      "occupied": {
                        "type": "integer",
                        "description": "Number of currently occupied spaces"
                      },
                      "total": {
                        "type": "integer",
                        "description": "Total capacity (may be null if unknown)",
                        "nullable": true
                      },
                      "available": {
                        "type": "integer",
                        "description": "Number of available spaces (total - occupied, null if total unknown)",
                        "nullable": true
                      }
                    }
                  }
                },
                "example": [
                  {
                    "zone_id": "123e4567-e89b-12d3-a456-426614174000",
                    "occupied": 45,
                    "total": 100,
                    "available": 55
                  },
                  {
                    "zone_id": "987fcdeb-51a2-3bc4-d567-890123456789",
                    "occupied": 120,
                    "total": 200,
                    "available": 80
                  }
                ]
              }
            }
          },
          "204": {
            "description": "No content - No zones found matching the specified criteria.\n\nThe query was valid but returned zero results.\n"
          },
          "400": {
            "description": "Bad request - Invalid or missing parameters.\n\nCommon causes:\n- No query parameters provided (must specify `zone_id`, `operator_id`, or `lat`/`lon`/`radius`)\n- Mixing incompatible parameters (e.g., using both `zone_id` and `operator_id`)\n- Geographic search missing required parameters (need all three: `lat`, `lon`, `radius`)\n- Invalid radius value (must be 1-50000)\n- Invalid coordinate values (lat: -90 to 90, lon: -180 to 180)\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed - Missing or invalid Bearer token.\n\nPossible causes:\n- No `Authorization` header provided\n- Token is expired\n- Token format is invalid\n- Token doesn't have the required permissions\n\nSolution: Obtain a new token from the authentication service and include it as `Authorization: Bearer <token>`\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Access denied to requested resource.\n\nThis occurs when:\n- Attempting to access zones or operators outside your authorized scope\n- Token has valid authentication but insufficient permissions\n\nSolution: Verify you're requesting data within your account's authorized operators and zones.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.\n\nCommon causes:\n- Invalid operator ID or name that doesn't exist\n- Zone ID doesn't exist in the system, or, for a public caller, none of the zones asked for is public\n- No zones found within the specified geographic radius\n\nSolution: Verify the IDs are correct and the resources exist in your account.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: over 100 in a minute from one client for one\norganization. The `message` says how many seconds to wait.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error - Something went wrong on our end.\n\nThis is a server-side issue. If this persists:\n- Check our status page for ongoing incidents\n- Contact support with the request details and timestamp\n- Implement exponential backoff retry logic\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/zones/refresh": {
      "get": {
        "operationId": "getZoneRefresh",
        "tags": [
          "Build Your Map",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Zone rule refresh (cached, ETag-aware)",
        "description": "Returns the effective merged parking rules for an operator's zones, versioned\nby the operator's policy version. For keeping a local copy of the rules up to\ndate without rebuilding the full map on every poll.\n\n**When to use this endpoint vs `/v1/zones`:**\n- Use `/v1/zones` once on initial map load to get full zone metadata (boundaries,\n  coordinates, display names).\n- Use `/v1/zones/refresh` on a recurring poll (guided by the `X-Next-Refresh`\n  response header) to check for rule/policy changes without re-fetching geometry.\n\n**Policy version:** every change to an operator's policies increments its\n`policy_version`, so an unchanged version means unchanged rules.\n\n**When to refresh:**\nThe `Cache-Control: max-age` and `X-Next-Refresh` values are computed from the\nearliest upcoming policy state change:\n- `effective_until` of any currently active policy (when it expires)\n- `effective_from` of any pending policy (when it becomes active)\n\nThe TTL is clamped to **60\u20133600 seconds**. If no future changes are pending,\na 15-minute default (900 s) is used.\n\n**ETag / conditional GET:**\nEvery response includes `ETag: \"<version>\"`. Clients should store this value\nand send `If-None-Match: \"<version>\"` on subsequent requests. When the\npolicy version has not changed, the server returns **304 Not Modified** with\nno body but with refreshed cache headers, saving bandwidth.\n\n**Policy rule resolution:**\nThe organization's default rules come first, then the zone's base rules, then its active\npolicies \u2014 permanent policies first, then temporary/event policies \u2014 each layer replacing\nthe fields it names (`reservation` and `enforcement` merged field by field), as every\nParkeze service resolves them. Only policies whose recurrence\nschedule (days of week, time window, timezone) matches the current server time\nare included in the merge.\n",
        "parameters": [
          {
            "name": "operator_id",
            "in": "query",
            "required": false,
            "description": "UUID or name of the operator whose zones you want to refresh.\n\nRequired unless the token belongs to one organization (an API key's\ndoes), in which case it defaults to that organization's operator.\n\nAccepts either:\n- **UUID format:** `operator_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890`\n- **Name format:** `operator_id=example-org`\n\nUse `/v1/operators` to discover available operator IDs and names.\n",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "zone_ids",
            "in": "query",
            "required": false,
            "description": "Optional comma-separated list of zone UUIDs to restrict the response to a\nsubset of zones. Non-UUID values in the list are silently ignored.\n\nWhen omitted, all zones belonging to the operator are returned.\n\nExample: `zone_ids=uuid1,uuid2,uuid3`\n",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Effective merged zone rules for the requested operator/zones.\n\nThe `version` field reflects the operator's current policy version.\nStore it alongside the `ETag` header for conditional GET requests.\n",
            "headers": {
              "ETag": {
                "description": "Quoted policy version string. Pass back as `If-None-Match` on the\nnext request to receive a 304 when nothing has changed.\n",
                "schema": {
                  "type": "string"
                },
                "example": "\"42\""
              },
              "Cache-Control": {
                "description": "Standard HTTP cache directive. `max-age` is set to the computed TTL\nin seconds \u2014 the number of seconds before the next expected policy\nstate change (clamped to 60\u20133600 s, or 900 s if no changes pending).\n",
                "schema": {
                  "type": "string"
                },
                "example": "public, max-age=900"
              },
              "X-Policy-Version": {
                "description": "Raw (unquoted) policy version integer for easy client-side parsing\nwithout string manipulation.\n",
                "schema": {
                  "type": "integer"
                },
                "example": 42
              },
              "X-Next-Refresh": {
                "description": "Unix timestamp (seconds since epoch) at which the client should\nnext call this endpoint to check for rule changes.\n",
                "schema": {
                  "type": "integer"
                },
                "example": 1751414400
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "integer",
                      "description": "Current policy version for this operator"
                    },
                    "zones": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "zone_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique zone identifier"
                          },
                          "display_name": {
                            "type": "string",
                            "description": "Human-readable zone name"
                          },
                          "rules": {
                            "type": "object",
                            "description": "Effective merged rules: zone base rules overlaid with active\npolicy rules \u2014 permanent first, temporary on top (temporary wins per field)\n"
                          },
                          "policy_ids": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "description": "IDs of currently active policies (after recurrence filtering)\nthat contributed to the merged rules\n"
                          },
                          "occupancy_max": {
                            "type": "integer",
                            "nullable": true,
                            "description": "Maximum zone capacity (total parking spaces)"
                          }
                        }
                      }
                    },
                    "generated_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO 8601 UTC timestamp when this response was generated"
                    },
                    "next_refresh_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "ISO 8601 UTC timestamp when the client should next refresh"
                    }
                  }
                },
                "example": {
                  "version": 42,
                  "zones": [
                    {
                      "zone_id": "123e4567-e89b-12d3-a456-426614174000",
                      "display_name": "Zone-A Downtown",
                      "rules": {
                        "time_limit_minutes": 120,
                        "rate_per_hour": 3.0
                      },
                      "policy_ids": [
                        "aaaabbbb-cccc-dddd-eeee-ffff00001111"
                      ],
                      "occupancy_max": 50
                    }
                  ],
                  "generated_at": "2026-01-01T00:00:00Z",
                  "next_refresh_at": "2026-01-01T00:15:00Z"
                }
              }
            }
          },
          "304": {
            "description": "Not Modified \u2014 the policy version has not changed since the client's\nlast request. The response body is empty. Cache headers (`ETag`,\n`Cache-Control`, `X-Policy-Version`, `X-Next-Refresh`) are still\npresent so clients and CDNs can update their cached TTL.\n",
            "headers": {
              "ETag": {
                "description": "Quoted policy version string (same as the last 200 response)",
                "schema": {
                  "type": "string"
                },
                "example": "\"42\""
              },
              "Cache-Control": {
                "description": "Updated max-age reflecting remaining TTL",
                "schema": {
                  "type": "string"
                },
                "example": "public, max-age=847"
              },
              "X-Policy-Version": {
                "description": "Raw policy version integer",
                "schema": {
                  "type": "integer"
                },
                "example": 42
              },
              "X-Next-Refresh": {
                "description": "Unix timestamp at which the client should next refresh",
                "schema": {
                  "type": "integer"
                },
                "example": 1751414400
              }
            }
          },
          "400": {
            "description": "Bad request \u2014 invalid or missing parameters.\n\nCommon causes:\n- Missing `operator_id` with a token that is not one organization's\n\n- `operator_id` does not exist or is not active\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed \u2014 missing or invalid Bearer token.\n\nSolution: Include a valid token as `Authorization: Bearer <token>`\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden \u2014 access denied to the requested operator's data.\n\nYour account does not have permission to access this operator.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests: over 100 in a minute from one client for one\norganization. The `message` says how many seconds to wait.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.\n\nIf this persists, contact support with the request details.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/blocks": {
      "post": {
        "operationId": "createBlock",
        "tags": [
          "Blocks"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Block a zone's spaces for an event or for facilities",
        "x-required-actions": [
          "reservation.admin",
          "reservation.manage_any as a station action (at a station)"
        ],
        "description": "Holds the zone's spaces (or the listed ones) for a long window. An `event` block lets anyone park without a booking; a `facilities` block keeps the spaces for facilities vehicles. Either way the spaces need no booking for the window and cannot be booked. A space already held in the window -- a booking, another block -- is not blocked and is listed under `blocked`. Sensor maintenance does not stand in the way and is not changed.\n\nAt a station, only its zones. Written to auditlog as entity `hold`.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "zone_id",
                  "kind",
                  "until"
                ],
                "properties": {
                  "zone_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "event",
                      "facilities"
                    ]
                  },
                  "from": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Defaults to now."
                  },
                  "until": {
                    "type": "string",
                    "format": "date-time",
                    "description": "At most a year after from."
                  },
                  "space_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Defaults to every space in the zone."
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "What the block is for."
                  },
                  "lpns": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Plates the block is for, when known. Stored and shown; not enforced yet."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The block, and the spaces that could not be blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "block": {
                      "$ref": "#/components/schemas/Block"
                    },
                    "blocked": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "space_uuid": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "space_label": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string",
                            "nullable": true
                          },
                          "held_from": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "held_until": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid kind, window, spaces or plates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed to block spaces here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Zone not found, or a space not in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Every space is already held in that window.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listBlocks",
        "tags": [
          "Blocks",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List event and facilities blocks",
        "x-required-actions": [
          "reservation.view_all",
          "enforcement.check",
          "reservation.manage_any as a station action (at a station)",
          "enforcement.check as a station action (at a station)",
          "developer API key (read-only, its organization)"
        ],
        "description": "Blocks overlapping the window, one entry per block with its spaces. Includes openings made in the operator console, whose hold id is their block id. At a station, only its zones.\n",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "until",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "zone_id",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The blocks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "blocks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Block"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`from` or `until` is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "No action that reads blocks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/blocks/{block_id}": {
      "delete": {
        "operationId": "endBlock",
        "tags": [
          "Blocks"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "End a block now",
        "x-required-actions": [
          "reservation.admin",
          "reservation.manage_any as a station action (at a station)"
        ],
        "description": "Ends every space of the block now, or cancels it if it has not started. The spaces are bookable again and need a booking again where the lot requires one. Sensor maintenance on them is untouched. Written to auditlog as entity `hold`, action `delete`.\n",
        "parameters": [
          {
            "in": "path",
            "name": "block_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ended.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "block_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "ended": {
                      "type": "integer",
                      "description": "Spaces released."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not allowed to end blocks in this zone here.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No current block with that id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/check/lpn": {
      "get": {
        "operationId": "checkLpn",
        "tags": [
          "Enforcement"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Check license plate for active/upcoming reservations",
        "x-required-actions": [
          "enforcement.check",
          "reservation.admin",
          "enforcement.check as a station action (at a station only)"
        ],
        "description": "Looks up active and upcoming reservations by license plate (case-insensitive).\n\nA plate identifies a booking, not a space, so this endpoint stays rooted in\nreservations. What holds add is whether the booked space is still the guest's\nto park in.\n\n`valid` is true when the reservation is `active` or `confirmed`, the current\ntime is inside its window, **and nothing else holds the booked space**. A\nmaintenance hold outranks a booking \u2014 a space out of service is not rentable,\nwhatever was reserved on it \u2014 and so does any other app's hold on the same\nspace.\n\nWhen a booking is otherwise good but its space is blocked, `valid` is false\nand `needs_reassignment` is true. Those are different situations for an\nofficer: the guest booked in good faith and needs moving to another space,\nwhich is not the same as a plate with no booking at all. `blocked_by` and\n`blocked_until` say what to reassign around.\n\nCanceled and expired reservations are excluded. Results are ordered newest\nfirst.\n\n**Required actions:** `enforcement.check` or `reservation.admin`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "query",
            "name": "lpn",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "License plate to look up. Only letters and digits are compared, on both sides, so case, spaces and dashes do not matter (ABC-1234 matches abc 1234). Every lookup is recorded -- who, which plate, what they were told -- and kept 90 days.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Reservations matching the license plate.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reservations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "reservation_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "zone_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "zone_name": {
                            "type": "string"
                          },
                          "sensor_uuid": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true
                          },
                          "space_label": {
                            "type": "string",
                            "nullable": true
                          },
                          "reserved_from": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "reserved_until": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string"
                          },
                          "guest_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "vehicle_lpn": {
                            "type": "string"
                          },
                          "hold_id": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true,
                            "description": "The reservation's own hold on the space. Null if the\nbooking has no space assigned, if its hold was released,\nor if it predates holds.\n"
                          },
                          "valid": {
                            "type": "boolean",
                            "description": "True if the reservation is currently in force: status is\n`active` or `confirmed`, now is inside the window, and\nnothing else holds the booked space.\n"
                          },
                          "blocked_by": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "maintenance",
                              "reserved",
                              "ev_charging",
                              "valet",
                              "other"
                            ],
                            "description": "The reason another hold blocks the booked space, ranked\nthe way availability is ranked \u2014 maintenance first, then\nearliest. Null when nothing blocks it. The reservation's\nown hold is excluded, so a booking never invalidates\nitself.\n"
                          },
                          "blocked_until": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "description": "When the blocking hold ends. Null when nothing blocks the\nspace, or when the block is open-ended.\n"
                          },
                          "needs_reassignment": {
                            "type": "boolean",
                            "description": "True when the booking is otherwise good \u2014 right status,\ninside its window \u2014 but its space is blocked. The guest\nshould be moved to another space rather than ticketed.\n"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing lpn, or no letters or digits in it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not an enforcement officer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The lookup could not be recorded, so it was not answered. Retry shortly.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/check/spot": {
      "get": {
        "operationId": "checkSpot",
        "tags": [
          "Enforcement"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Check what blocks a spot, and who is permitted on it",
        "x-required-actions": [
          "enforcement.check",
          "reservation.admin",
          "enforcement.check as a station action (at a station only)"
        ],
        "description": "Answers \"may a car be here?\" for one parking space.\n\nTwo arrays, because they answer two different questions and must not be\nconflated:\n\n- **`holds`** \u2014 everything blocking the space now or later, whatever the\n  reason: maintenance, reserved, EV charging, valet, other. Each carries\n  `permits_parking`.\n- **`reservations`** \u2014 who is permitted to park. Unchanged in meaning and\n  shape.\n\nA `maintenance` hold means *nobody* may park there, which is the opposite of\na reservation. Do not read a non-empty `holds` as permission: read\n`permits_parking` on each hold, and match the plate against\n`reservation.vehicle_lpn` for the ones where it is true.\n\n`availability` is the winning reason at the time of the request \u2014\n`available`, or why not. Maintenance outranks a booking.\n\nHolds are filtered to current and upcoming; an open-ended hold (no\n`held_until`) is always current. Canceled, expired and completed\nreservations are excluded.\n\nProvide either `sensor_uuid` OR both `zone_id` and `space_number`.\n\n**Required actions:** `enforcement.check` or `reservation.admin`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "query",
            "name": "sensor_uuid",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Sensor UUID. If provided, zone_id and space_number are ignored."
          },
          {
            "in": "query",
            "name": "zone_id",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Zone UUID. Required if sensor_uuid is not provided."
          },
          {
            "in": "query",
            "name": "space_number",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Space label. Required if sensor_uuid is not provided."
          }
        ],
        "responses": {
          "200": {
            "description": "What blocks the spot, and who is permitted on it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "space": {
                      "type": "object",
                      "description": "The space the answer is about, as resolved.",
                      "properties": {
                        "space_uuid": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "space_label": {
                          "type": "string",
                          "nullable": true
                        },
                        "space_number": {
                          "type": "string",
                          "nullable": true
                        },
                        "zone_id": {
                          "type": "string",
                          "format": "uuid",
                          "nullable": true
                        },
                        "zone_name": {
                          "type": "string",
                          "nullable": true
                        }
                      }
                    },
                    "availability": {
                      "type": "string",
                      "enum": [
                        "available",
                        "maintenance",
                        "reserved",
                        "ev_charging",
                        "valet",
                        "other"
                      ],
                      "description": "The winning reason at the time of the request. `available` means\nnothing holds the space.\n"
                    },
                    "holds": {
                      "type": "array",
                      "description": "Everything blocking the space now or later.",
                      "items": {
                        "$ref": "#/components/schemas/SpaceHold"
                      }
                    },
                    "reservations": {
                      "type": "array",
                      "description": "Who is permitted to park. Shape unchanged.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "reservation_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "zone_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "zone_name": {
                            "type": "string"
                          },
                          "sensor_uuid": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true
                          },
                          "space_label": {
                            "type": "string",
                            "nullable": true
                          },
                          "reserved_from": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "reserved_until": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string"
                          },
                          "guest_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "vehicle_lpn": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Neither sensor_uuid nor zone_id+space_number provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such space, or it belongs to another operator. Previously a mistyped\nspace number returned an empty list, which reads as \"nothing blocks it\".\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/check/time-range": {
      "get": {
        "operationId": "checkTimeRange",
        "tags": [
          "Enforcement"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get everything blocking spaces in a time period",
        "x-required-actions": [
          "enforcement.check",
          "reservation.admin",
          "enforcement.check as a station action (at a station only)"
        ],
        "description": "Everything that overlaps the specified time window, for enforcement during\nthat period.\n\nTwo arrays, because they answer two different questions and must not be\nconflated:\n\n- **`holds`** \u2014 every block overlapping the window, whatever the reason:\n  maintenance, reserved, EV charging, valet, other. Each carries\n  `permits_parking`. An open-ended hold (no `held_until`) overlaps every\n  window from `held_from` onwards, which is how maintenance appears.\n- **`reservations`** \u2014 who is permitted to park. Unchanged in meaning and\n  shape, and still includes bookings with no space assigned, which write no\n  hold.\n\nA `maintenance` hold means *nobody* may park there. Do not read a non-empty\n`holds` as permission; read `permits_parking` on each hold.\n\nBoth `from` and `until` are required. The overlap condition for reservations\nis `reserved_from < until AND reserved_until > from`, and for holds\n`held_from < until AND (held_until IS NULL OR held_until > from)`.\n\nReleased holds are excluded, as are canceled and expired reservations.\n\n**Required actions:** `enforcement.check`, `reservation.admin`, or\n`enforcement.check` or `reservation.manage_any` as station actions at a station. At a station the\nresults are limited to its zones.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Start of the time window (ISO 8601)."
          },
          {
            "in": "query",
            "name": "until",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "End of the time window (ISO 8601)."
          },
          {
            "in": "query",
            "name": "zone_id",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Optional zone filter, applied to both arrays."
          }
        ],
        "responses": {
          "200": {
            "description": "Everything overlapping the specified time window.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "holds": {
                      "type": "array",
                      "description": "Every block overlapping the window, whatever the reason.",
                      "items": {
                        "$ref": "#/components/schemas/SpaceHold"
                      }
                    },
                    "reservations": {
                      "type": "array",
                      "description": "Who is permitted to park. Shape unchanged.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "reservation_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "zone_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "zone_name": {
                            "type": "string"
                          },
                          "sensor_uuid": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true
                          },
                          "space_label": {
                            "type": "string",
                            "nullable": true
                          },
                          "reserved_from": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "reserved_until": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string"
                          },
                          "guest_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "vehicle_lpn": {
                            "type": "string",
                            "nullable": true
                          },
                          "vehicle_make": {
                            "type": "string",
                            "nullable": true
                          },
                          "vehicle_model": {
                            "type": "string",
                            "nullable": true
                          },
                          "vehicle_color": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing from or until parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/check/violations": {
      "get": {
        "operationId": "checkViolations",
        "tags": [
          "Enforcement"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Violations the sensors have detected",
        "x-required-actions": [
          "enforcement.check",
          "reservation.admin",
          "enforcement.check as a station action (at a station only)"
        ],
        "description": "\"Where is somebody parked who should not be?\" -- read from the violation\ndetector's record rather than recomputed, so this answers exactly what the\ndetector decided.\n\nOpen violations (cars still there) by default. With `open=false`, every\nviolation in the window, open or ended, detected at or after `since` when it\nis given. Open violations come first, then newest breach first.\n\nThis seeds the live feed: `GET /v1/live/violations` streams the same\nviolations as they start and end.\n\nOperator-scoped like every other endpoint.\n\n**Required actions:** `enforcement.check` or `reservation.admin` (the same\nofficer definition the live violation stream uses).\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "query",
            "name": "open",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true
            },
            "description": "`true` for open violations only; `false` (or `0`) for all in the window."
          },
          {
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "With `open=false`, only violations detected at or after this instant. Ignored when `open` is true."
          },
          {
            "in": "query",
            "name": "zone_id",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "One zone."
          },
          {
            "in": "query",
            "name": "kinds",
            "required": false,
            "schema": {
              "type": "string",
              "example": "no_reservation,reservation_overstay"
            },
            "description": "Comma-separated kinds: `time_limit`, `outside_hours`, `no_reservation`,\n`reservation_overstay`, `early_arrival`. An unknown kind is refused (400),\nnot matched against nothing.\n"
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "minimum": 1,
              "maximum": 500
            },
            "description": "Clamped to 1..500."
          }
        ],
        "responses": {
          "200": {
            "description": "Detected violations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "violations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "violation_ref": {
                            "type": "string",
                            "description": "The record's own id."
                          },
                          "violation_id": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true,
                            "description": "Stable across the violation's start and end events (the `violation_id` on the live stream). Null on records from before the detector carried one."
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "time_limit",
                              "outside_hours",
                              "no_reservation",
                              "reservation_overstay",
                              "early_arrival"
                            ]
                          },
                          "severity": {
                            "type": "string",
                            "enum": [
                              "info",
                              "warning",
                              "critical"
                            ],
                            "nullable": true
                          },
                          "space_uuid": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "sensor_uuid": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Same as `space_uuid`, named as the other enforcement responses name the space."
                          },
                          "space_number": {
                            "type": "string",
                            "nullable": true
                          },
                          "space_label": {
                            "type": "string",
                            "nullable": true,
                            "description": "The space's friendly name, else its number."
                          },
                          "zone_id": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true
                          },
                          "zone_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "session_start": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "description": "When the car arrived."
                          },
                          "violation_start": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "description": "When the breach began, not when it was noticed."
                          },
                          "detected_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "ended_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "is_open": {
                            "type": "boolean"
                          },
                          "duration_minutes": {
                            "type": "number",
                            "nullable": true
                          },
                          "evidence": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "Kind-specific detail, e.g. `grace_minutes`, `overstay_minutes`, `reserved_until`, `minutes_early`."
                          },
                          "reason": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "session_retimed",
                              null
                            ],
                            "description": "Set when a correction found the violation (an operator retimed its session) rather than a car; the apps list it without an alert."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "zone_id is not a UUID, a kind is unknown, or limit is not an integer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not an enforcement officer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The violations could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/batch": {
      "post": {
        "operationId": "batchCreateReservations",
        "tags": [
          "Reservations"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Batch create reservations",
        "x-required-actions": [
          "reservation.create (with reservation.skip_approval, booked as confirmed)",
          "reservation.create (without it, booked pending approval)",
          "reservation.admin",
          "reservation.manage_any as a station action (at a station only; any reservation in its zones)"
        ],
        "description": "Creates multiple reservations in a single request. Each item in the `reservations`\narray is processed independently \u2014 partial success is possible. The response includes\nper-item status and any errors encountered.\n\nEach item accepts the same fields as `POST /v1/reservations/`.\n\n**Texts need consent.** Each guest is emailed unless it sets\n`notification_channel` to `sms` or `both`, which takes a `phone` and\n`sms_consent: true` on the guest (or once at the top level for every guest).\nA texted guest without it refuses the whole batch with 400 before anything\nis written. Consent is recorded as for `POST /v1/reservations/`.\n\n**Required actions:** `reservation.create` or `reservation.admin`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reservations"
                ],
                "properties": {
                  "reservations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "zone_id",
                        "reserved_from",
                        "reserved_until"
                      ],
                      "properties": {
                        "zone_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "reserved_from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "reserved_until": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "sensor_uuid": {
                          "type": "string",
                          "format": "uuid",
                          "nullable": true
                        },
                        "space_number": {
                          "type": "string",
                          "nullable": true
                        },
                        "guest_name": {
                          "type": "string",
                          "nullable": true
                        },
                        "guest_email": {
                          "type": "string",
                          "format": "email",
                          "nullable": true
                        },
                        "vehicle_lpn": {
                          "type": "string",
                          "nullable": true
                        },
                        "notes": {
                          "type": "string",
                          "nullable": true,
                          "maxLength": 2000,
                          "description": "The note, the same for every guest's reservation."
                        },
                        "notes_guest_visible": {
                          "type": "boolean",
                          "default": false,
                          "description": "Whether the guests see the note. Off by default."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "207": {
            "description": "Multi-status response with per-item results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "index": {
                            "type": "integer"
                          },
                          "success": {
                            "type": "boolean"
                          },
                          "reservation_id": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true
                          },
                          "status": {
                            "type": "string",
                            "nullable": true
                          },
                          "error": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request body missing or malformed, or a texted guest without a phone or `sms_consent: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/": {
      "get": {
        "operationId": "listReservations",
        "tags": [
          "Reservations",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List reservations",
        "x-required-actions": [
          "any-authenticated",
          "developer API key (read-only; every reservation in its organization)"
        ],
        "description": "Returns a paginated list of reservations. Results are automatically filtered\nbased on what the caller may do:\n\n- **`reservation.admin` / `reservation.view_all`**: all reservations for the operator.\n- **bookers** (`reservation.create`): only reservations created by the caller.\n- **developer API key**: all reservations for the key's organization, guest\n  fields included; read-only.\n\n**Required actions:** none beyond membership of the organization.\n\n**Optional filters:** `from`, `until`, `zone_id`, `status`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Return reservations whose end time is after this timestamp (ISO 8601)."
          },
          {
            "in": "query",
            "name": "until",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Return reservations whose start time is before this timestamp (ISO 8601)."
          },
          {
            "in": "query",
            "name": "zone_id",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Filter by zone UUID."
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "confirmed",
                "pending_approval",
                "active",
                "completed",
                "cancelled",
                "expired"
              ]
            },
            "description": "Filter by reservation status."
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Page number (1-based)."
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100
            },
            "description": "Results per page (max 100)."
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of reservations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reservations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "reservation_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "zone_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "zone_name": {
                            "type": "string"
                          },
                          "space_number": {
                            "type": "string",
                            "nullable": true
                          },
                          "reserved_from": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "reserved_until": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string"
                          },
                          "guest_name": {
                            "type": "string",
                            "nullable": true
                          },
                          "guest_email": {
                            "type": "string",
                            "nullable": true
                          },
                          "vehicle_lpn": {
                            "type": "string",
                            "nullable": true
                          },
                          "notes": {
                            "type": "string",
                            "nullable": true,
                            "description": "The reservation's note. Staff see it whether or not the guest does."
                          },
                          "notes_guest_visible": {
                            "type": "boolean",
                            "description": "Whether the guest sees `notes`."
                          },
                          "available_actions": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "approve",
                                "reject",
                                "edit",
                                "reassign",
                                "cancel",
                                "resend",
                                "note"
                              ]
                            }
                          }
                        }
                      }
                    },
                    "page": {
                      "type": "integer"
                    },
                    "per_page": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createReservation",
        "tags": [
          "Reservations"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a parking reservation",
        "x-required-actions": [
          "reservation.create (with reservation.skip_approval, booked as confirmed)",
          "reservation.create (without it, booked pending approval)",
          "reservation.admin",
          "reservation.manage_any as a station action (at a station only; any reservation in its zones)"
        ],
        "description": "Creates a new parking reservation for a specific zone and optional space.\n\n**Required fields:** `zone_id`, `reserved_from`, `reserved_until` (ISO 8601 timestamps).\n\n**Optional fields:**\n- `sensor_uuid` / `sensor_id`: Reserve a specific space; a conflict check is performed.\n- `space_number`: Human-readable space label.\n- `guest_name`, `guest_email`, `guest_phone`: Guest contact details.\n- `vehicle_make`, `vehicle_model`, `vehicle_color`, `vehicle_lpn`: Vehicle info.\n- `notes`: The reservation's note, at most 2000 characters.\n- `notes_guest_visible`: Whether the guest sees the note. Off by default, so\n  a note is internal unless this is true.\n\n**Texts need consent.** A guest is texted when `notification_channel` is\n`sms` or `both`, or when they have a phone and no email. Staff confirm the\nguest agreed with `sms_consent: true`; without it the request is refused\nwith 400. The reservation records `sms_consent_at`, `sms_consent_by` (the\ncaller's token subject (`sub`)) and `sms_consent_version` (the wording confirmed,\n`2026-10-05`), and so does its `created` history row. The wording: \"The\nguest agreed to receive text messages about this reservation. Msg & data\nrates may apply. Reply STOP to opt out, HELP for help.\"\n\n**Status flow:**\n- `pending_approval` \u2014 if the caller lacks `reservation.skip_approval`.\n- `confirmed` \u2014 if vehicle info is provided inline.\n- `pending` \u2014 if vehicle info is missing (a self-service token is generated and emailed).\n\n**Required actions:** `reservation.create` or `reservation.admin`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "zone_id",
                  "reserved_from",
                  "reserved_until"
                ],
                "properties": {
                  "zone_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the reservable zone."
                  },
                  "reserved_from": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Reservation start time (ISO 8601, must be in the future)."
                  },
                  "reserved_until": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Reservation end time (ISO 8601, must be after reserved_from)."
                  },
                  "sensor_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional sensor/space UUID to reserve a specific spot."
                  },
                  "sensor_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Alias for sensor_uuid (accepted by the API)."
                  },
                  "space_number": {
                    "type": "string",
                    "description": "Human-readable space label (e.g. \"A-12\")."
                  },
                  "guest_name": {
                    "type": "string"
                  },
                  "guest_email": {
                    "type": "string",
                    "format": "email"
                  },
                  "guest_phone": {
                    "type": "string"
                  },
                  "vehicle_make": {
                    "type": "string"
                  },
                  "vehicle_model": {
                    "type": "string"
                  },
                  "vehicle_color": {
                    "type": "string"
                  },
                  "vehicle_lpn": {
                    "type": "string",
                    "description": "License plate number."
                  },
                  "notes": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 2000,
                    "description": "The reservation's one note. Trimmed; an\nempty note is stored as null. Staff always see it; the guest\nonly when `notes_guest_visible` is true.\n"
                  },
                  "notes_guest_visible": {
                    "type": "boolean",
                    "default": false,
                    "description": "Whether the guest sees `notes`: in their emails, on their pass\nand in the app. Off by default.\n"
                  },
                  "notification_channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms",
                      "both"
                    ],
                    "default": "email",
                    "description": "Used when the guest has both an email and a phone; a phone alone means `sms`."
                  },
                  "sms_consent": {
                    "type": "boolean",
                    "description": "The guest agreed to text messages. Required when the guest is texted."
                  }
                }
              },
              "examples": {
                "minimal": {
                  "summary": "Minimal reservation",
                  "value": {
                    "zone_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "reserved_from": "2026-04-15T10:00:00Z",
                    "reserved_until": "2026-04-15T12:00:00Z"
                  }
                },
                "full": {
                  "summary": "Full reservation with vehicle info",
                  "value": {
                    "zone_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                    "reserved_from": "2026-04-15T10:00:00Z",
                    "reserved_until": "2026-04-15T12:00:00Z",
                    "sensor_uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
                    "space_number": "A-12",
                    "guest_name": "Jane Smith",
                    "guest_email": "jane@example.com",
                    "vehicle_lpn": "ABC123"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Reservation created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reservation_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "confirmed",
                        "pending_approval"
                      ]
                    },
                    "vehicle_info_token": {
                      "type": "string",
                      "format": "uuid",
                      "nullable": true,
                      "description": "Self-service token emailed to the guest when vehicle info was not provided inline."
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (missing fields, time conflict, zone not reservable), or a texted guest without `sms_consent: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Not allowed to book.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Zone or sensor not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The space is already booked, out of service, or opened to anyone for part of the requested window. The message says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/{reservation_id}/approve": {
      "post": {
        "operationId": "approveReservation",
        "tags": [
          "Reservations"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Approve a pending reservation",
        "x-required-actions": [
          "reservation.approve",
          "reservation.admin"
        ],
        "description": "Approves a reservation that is in `pending_approval` status, advancing it to\n`confirmed` (or `pending` if vehicle info is still missing).\n\nA confirmation email is sent to the guest if an email address is on file.\n\nNobody approves a reservation they created: the caller is matched against\nthe creator by token subject (`sub`) and by username, and refused with 403.\n`available_actions` does not offer `approve` to the creator.\n\n**Required actions:** `reservation.approve` or `reservation.admin`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "path",
            "name": "reservation_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reservation UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "Reservation approved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Reservation is not in pending_approval status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions, or the caller created the reservation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Reservation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/{reservation_id}": {
      "delete": {
        "operationId": "cancelReservation",
        "tags": [
          "Reservations"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Cancel or permanently delete a reservation",
        "x-required-actions": [
          "reservation.admin",
          "reservation.create (own reservations only, cancel only)",
          "reservation.manage_any as a station action (at a station only; any reservation in its zones)"
        ],
        "description": "By default, **cancels**: sets the status to `cancelled`, releases the space's\nhold immediately, records `cancelled` in the history and notifies. A\nreservation already `cancelled`, `completed` or `expired` cannot be cancelled\n(400).\n\nWith `hard_delete=true`, **permanently deletes** the row (`reservation.admin`\nonly). The history outlives it: a `deleted` entry records who removed it and\na snapshot of the booking without the guest's contact or vehicle details.\nNothing is notified.\n\nAn optional `reason` (at most 500 characters kept) is recorded with the\nhistory entry, from the JSON body or the `reason` query parameter; the body\nwins if both are sent.\n\n**Required actions:** `reservation.admin`, or `reservation.create` to cancel reservations created by the caller.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "path",
            "name": "reservation_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reservation UUID."
          },
          {
            "in": "query",
            "name": "hard_delete",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Permanently delete instead of cancel (`true`, `1` or `yes`). `reservation.admin` only."
          },
          {
            "in": "query",
            "name": "reason",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 500
            },
            "description": "Why it was cancelled or deleted, for the history."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Why it was cancelled or deleted, for the history."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reservation canceled, or permanently deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "enum": [
                        "Reservation canceled.",
                        "Reservation permanently deleted."
                      ]
                    },
                    "reservation_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The reservation is already cancelled, completed or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions, not the caller's own reservation, or hard_delete without `reservation.admin`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Reservation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The change could not be written; nothing changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getReservation",
        "tags": [
          "Reservations",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a reservation by ID",
        "x-required-actions": [
          "reservation.admin",
          "reservation.view_all (an approver holds it)",
          "enforcement.check",
          "reservation.manage_any as a station action (at a station only)",
          "enforcement.check as a station action (at a station only)",
          "reservation.create (own reservations only)",
          "developer API key (read-only; every reservation in its organization)"
        ],
        "description": "Returns a single reservation by its UUID. Operator-scoped tokens can only\nretrieve reservations belonging to their operator, and at a station only\nthose in its zones.\n\n**Who reads which.** An admin, a viewer (an approver is one), an officer\n(`enforcement.check`, or `enforcement.check` as a station action at a station) and a\ndesk at a station read any reservation in their operator. Anyone else reads\nonly the reservations they created, as in the list; someone else's is a\n404, the same as one that does not exist.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "path",
            "name": "reservation_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reservation UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "Reservation details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reservation_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "operator_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "zone_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "zone_name": {
                      "type": "string"
                    },
                    "sensor_uuid": {
                      "type": "string",
                      "format": "uuid",
                      "nullable": true
                    },
                    "space_number": {
                      "type": "string",
                      "nullable": true
                    },
                    "reserved_from": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "reserved_until": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "status": {
                      "type": "string"
                    },
                    "guest_name": {
                      "type": "string",
                      "nullable": true
                    },
                    "guest_email": {
                      "type": "string",
                      "nullable": true
                    },
                    "guest_phone": {
                      "type": "string",
                      "nullable": true
                    },
                    "vehicle_make": {
                      "type": "string",
                      "nullable": true
                    },
                    "vehicle_model": {
                      "type": "string",
                      "nullable": true
                    },
                    "vehicle_color": {
                      "type": "string",
                      "nullable": true
                    },
                    "vehicle_lpn": {
                      "type": "string",
                      "nullable": true
                    },
                    "vehicle_info_provided": {
                      "type": "boolean"
                    },
                    "notes": {
                      "type": "string",
                      "nullable": true,
                      "description": "The reservation's note. Staff see it whether or not the guest does."
                    },
                    "notes_guest_visible": {
                      "type": "boolean",
                      "description": "Whether the guest sees `notes`. Show the note as Internal when false, Shown to guest when true."
                    },
                    "available_actions": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "approve",
                          "reject",
                          "edit",
                          "reassign",
                          "cancel",
                          "resend",
                          "note"
                        ]
                      },
                      "description": "What the calling token may do to this reservation. `note` is changing `notes` and\n`notes_guest_visible`, which a reservation that has ended or\nwas voided still allows.\n"
                    },
                    "created_by": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Reservation not found or not accessible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updateReservation",
        "tags": [
          "Reservations"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update or move a reservation",
        "x-required-actions": [
          "reservation.admin",
          "reservation.create (own reservations only)",
          "reservation.manage_any as a station action (at a station only; any reservation in its zones)"
        ],
        "description": "Partial update: only the fields sent are changed.\n\n**Moving a booking.** Sending `reserved_from`, `reserved_until`, or a new\nspace (`sensor_uuid`, or its alias `sensor_id`) moves the booking. The new\nwindow must have `reserved_from` before `reserved_until`; a new space must be\nin the reservation's zone and support reservations. The space's hold moves\nwith the booking, in the same transaction as the update and its audit entry.\nA move onto a space booked by another live reservation, or held for anything\nelse in that window, is refused with 409, saying which (a booking,\nmaintenance, an event opening, a facilities block), as create does. A new\n`reserved_from` in the past is refused with 400, with create's rule and\nmessage; an unchanged one is accepted, so a booking under way still takes a\nnew end, a new space or a note.\n\n**Moving needs approval again.** When the caller's bookings need approval\n(`reservation.create` without `reservation.skip_approval`) and they\ncould not approve this one themselves (not an approver, or its creator), a\nchange to the window or the space of a `pending`, `confirmed` or `active`\nbooking sets it back to `pending_approval`. As at create, the history gets\n`approval_requested` and the approvers get the `approval_requested` event\n(not `updated`). The hold moves as for any move, so the space stays taken\nwhile it waits. Admins and approvers keep the status. The response's\n`status` is the booking's status after the update.\n\n**Texts need a phone.** Setting `notification_channel` to `sms` or `both`\nwhen the guest has no `guest_phone`, or clearing the phone of a texted\nguest, is refused with 400.\n\nThe change is recorded in the reservation's history as `reassigned` when the\nspace changed, `note_changed` when only `notes` or `notes_guest_visible`\nchanged, otherwise `updated`, with every changed field before and after.\n\n**The note.** `notes` and `notes_guest_visible` are the reservation's one\nnote and whether the guest sees it. They are the only\nfields a reservation that has ended or was voided (`completed`, `cancelled`,\n`expired`, `rejected`) still takes; any other field sent to one is refused\nwith 409. `available_actions` offers `note` to whoever may change them, and\n`edit` only while the booking is live. Every update publishes the `updated`\nevent, whose `extra.changed_fields` names what changed.\n\n**Texts need consent.** An update that sets `notification_channel` to `sms`\nor `both`, or gives a texted guest a new `guest_phone`, takes\n`sms_consent: true` (400 without it) and records the consent afresh: when,\nthe caller's token subject (`sub`) and the wording's version. A new number on a\nbooking that is not texted drops the consent given for the old one. Either\nappears in the history's `changes`. An update that touches neither needs no\nconsent.\n\n**Not the status.** A status changes only through the approve, reject and\ncancel endpoints, which check who may make that change; a body with\n`status` in it is refused with 400 and changes nothing.\n\n**Required actions:** `reservation.admin`, or `reservation.create` for reservations created by the caller.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "path",
            "name": "reservation_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reservation UUID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "properties": {
                  "reserved_from": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "reserved_until": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "sensor_uuid": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Move the booking to this space (same zone)."
                  },
                  "sensor_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Alias for `sensor_uuid`; `sensor_uuid` wins if both are sent."
                  },
                  "guest_name": {
                    "type": "string"
                  },
                  "guest_email": {
                    "type": "string",
                    "format": "email"
                  },
                  "guest_phone": {
                    "type": "string"
                  },
                  "vehicle_make": {
                    "type": "string"
                  },
                  "vehicle_model": {
                    "type": "string"
                  },
                  "vehicle_color": {
                    "type": "string"
                  },
                  "vehicle_lpn": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 2000,
                    "description": "The reservation's one note. Trimmed; an\nempty note is stored as null. Staff always see it; the guest\nonly when `notes_guest_visible` is true.\n"
                  },
                  "notes_guest_visible": {
                    "type": "boolean",
                    "default": false,
                    "description": "Whether the guest sees `notes`: in their emails, on their pass\nand in the app. Off by default.\n"
                  },
                  "notification_channel": {
                    "type": "string",
                    "enum": [
                      "email",
                      "sms",
                      "both"
                    ]
                  },
                  "sms_consent": {
                    "type": "boolean",
                    "description": "The guest agreed to text messages. Required when the update sets a texting channel or a texted guest's new phone."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reservation updated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Reservation updated."
                    },
                    "reservation_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "description": "The booking's status after the update; `pending_approval` when the move needs approval again."
                    },
                    "warnings": {
                      "type": "array",
                      "description": "The guest has opted out of a channel this booking would notify on.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "enum": [
                              "guest_email_opted_out",
                              "guest_phone_opted_out"
                            ]
                          },
                          "channel": {
                            "type": "string",
                            "enum": [
                              "email",
                              "sms"
                            ]
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No body, a `status`, a texting channel or new phone without `sms_consent: true`, an unknown `notification_channel`, no updatable field, an invalid datetime, a window that ends before it starts, a new start in the past, a texting channel with no phone, a space that does not support reservations, a note over 2000 characters, or a `notes_guest_visible` that is not a boolean.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions, or not the caller's own reservation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Reservation not found, or the new space is not in the reservation's zone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The space is booked or held for something else in that window, or the reservation has ended or was voided and something other than its note was sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The update could not be written; nothing changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/{reservation_id}/events": {
      "get": {
        "operationId": "getReservationEvents",
        "tags": [
          "Reservations",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "A reservation's history",
        "x-required-actions": [
          "anyone who may read the reservation",
          "developer API key (read-only; every reservation in its organization)"
        ],
        "description": "Everything that has happened to a reservation, oldest first, from the audit\nlog every action writes in the same transaction as the change.\n\nVisible to whoever may read the reservation itself (see\n`GET /v1/reservations/{reservation_id}`), with the same operator scope, so\nan id from another operator, or someone else's reservation for a caller who\nreads only their own, is a 404. A permanently deleted\nreservation keeps its history, readable by `reservation.admin` and\n`reservation.view_all` within their operator.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "path",
            "name": "reservation_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reservation UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "The reservation's events, oldest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event_id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "description": "The action recorded. New values may be added.",
                            "enum": [
                              "created",
                              "approval_requested",
                              "approved",
                              "rejected",
                              "updated",
                              "reassigned",
                              "cancelled",
                              "deleted",
                              "vehicle_info_added",
                              "notification_resent"
                            ]
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "actor": {
                            "type": "string",
                            "nullable": true,
                            "description": "Username of whoever did it."
                          },
                          "actor_id": {
                            "type": "string",
                            "nullable": true,
                            "description": "Their token subject (`sub`), which survives a rename. Null on entries recorded before it was, and for a station device acting on its own (before station devices were removed)."
                          },
                          "actor_kind": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "person",
                              "device",
                              "both"
                            ],
                            "description": "Who acted: a signed-in `person`.\n`device` (an enrolled station device on its own, `actor`\nthen `device:<device_id>`) and `both` (a person on one)\nappear only on entries recorded before station devices\nwere removed. Null on entries\nrecorded before it was, and for actions nobody signed in\nfor.\n"
                          },
                          "station_id": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true,
                            "description": "The station it was done at, if any."
                          },
                          "device_id": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true,
                            "description": "The enrolled device it came from, on entries recorded before station devices were removed; otherwise null."
                          },
                          "source_app": {
                            "type": "string",
                            "nullable": true,
                            "description": "The app they used, e.g. `reserve.parkeze.com`, `my.parkeze.com`, or a raw client id."
                          },
                          "detail": {
                            "type": "string",
                            "nullable": true,
                            "description": "A one-line human summary of `details`."
                          },
                          "details": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "The recorded detail, whole. By type: `updated` and\n`reassigned` carry `changes` ({field: {from, to}}, with\n`space` on a reassignment); `cancelled`, `rejected` and\n`deleted` may carry `reason`; `deleted` carries a\n`reservation` snapshot; `notification_resent` carries\n`event_type`.\n"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Reservation not found (or not visible to the caller).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The history could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/{reservation_id}/reject": {
      "post": {
        "operationId": "rejectReservation",
        "tags": [
          "Reservations"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Reject a pending reservation",
        "x-required-actions": [
          "reservation.approve",
          "reservation.admin"
        ],
        "description": "Rejects a reservation that is in `pending_approval` status, setting it to\n`cancelled`. An optional rejection reason can be included in the request body.\n\n**Required actions:** `reservation.approve` or `reservation.admin`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "path",
            "name": "reservation_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reservation UUID."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Optional rejection reason shown in the notification email."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reservation rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Reservation is not in pending_approval status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Reservation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/{reservation_id}/resend": {
      "post": {
        "operationId": "resendReservationNotification",
        "tags": [
          "Reservations"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Resend the guest's notification",
        "x-required-actions": [
          "reservation.admin",
          "reservation.create (own reservations only)"
        ],
        "description": "Re-sends the notification matching the reservation's current status, on the\nguest's configured channel(s):\n\n| status | event resent |\n|---|---|\n| `pending`, `confirmed`, `active` | `confirmed` if vehicle details are in, else `vehicle_info_needed` |\n| `pending_approval` | `approval_requested` (to the zone's approvers) |\n| `cancelled` | `cancelled` |\n| `rejected` | `rejected` |\n\nAny other status is refused (400). The resend is recorded in the history as\n`notification_resent` before it is sent; if it cannot be recorded it is not\nsent (500). No request body.\n\n**Required actions:** `reservation.admin`, or `reservation.create` for reservations\ncreated by the caller.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/Station"
          },
          {
            "in": "path",
            "name": "reservation_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reservation UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "Notification resent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Notification resent."
                    },
                    "reservation_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "event_type": {
                      "type": "string",
                      "enum": [
                        "confirmed",
                        "vehicle_info_needed",
                        "approval_requested",
                        "cancelled",
                        "rejected"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The reservation's status has no notification to resend (e.g. completed, expired).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions, or not the caller's own reservation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Reservation not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The resend could not be recorded, so it was not sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/vehicle/{token}": {
      "get": {
        "operationId": "getVehicleInfoPage",
        "tags": [
          "Vehicle"
        ],
        "summary": "Get reservation summary for vehicle info entry",
        "x-required-actions": [],
        "description": "Returns basic reservation details for a guest to view before submitting their\nvehicle information. No API key is required \u2014 the `token` path parameter acts\nas the authentication credential.\n\nReturns 404 if the token is invalid or expired, and 400 if the reservation\nhas been canceled or expired.\n\n**Required actions:** None (public endpoint; token-based access).\n",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vehicle info self-service token (from the confirmation email link)."
          }
        ],
        "responses": {
          "200": {
            "description": "Reservation summary for the guest.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "zone_name": {
                      "type": "string"
                    },
                    "space_number": {
                      "type": "string",
                      "nullable": true
                    },
                    "reserved_from": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "reserved_until": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "vehicle_info_provided": {
                      "type": "boolean"
                    },
                    "notes": {
                      "type": "string",
                      "nullable": true,
                      "description": "The reservation's note when staff chose to show it to the\nguest (`notes_guest_visible`); null when\nthere is none or it is internal.\n"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Reservation is canceled or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid or expired token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "submitVehicleInfo",
        "tags": [
          "Vehicle"
        ],
        "summary": "Submit vehicle information via self-service token",
        "x-required-actions": [],
        "description": "Allows a guest to submit their vehicle information for a reservation using\nthe single-use token from their confirmation email. No API key required \u2014\nthe `token` path parameter acts as the authentication credential.\n\nOn success, the reservation status advances to `confirmed` and a confirmation\nemail is sent to the guest's email address.\n\n**Required actions:** None (public endpoint; token-based access).\n",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Vehicle info self-service token."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "vehicle_lpn"
                ],
                "properties": {
                  "vehicle_lpn": {
                    "type": "string",
                    "description": "License plate number (required)."
                  },
                  "vehicle_make": {
                    "type": "string"
                  },
                  "vehicle_model": {
                    "type": "string"
                  },
                  "vehicle_color": {
                    "type": "string"
                  }
                }
              },
              "examples": {
                "minimal": {
                  "summary": "License plate only",
                  "value": {
                    "vehicle_lpn": "ABC123"
                  }
                },
                "full": {
                  "summary": "Full vehicle info",
                  "value": {
                    "vehicle_lpn": "ABC123",
                    "vehicle_make": "Toyota",
                    "vehicle_model": "Camry",
                    "vehicle_color": "Blue"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Vehicle info submitted, reservation confirmed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing vehicle_lpn, or reservation already has vehicle info.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid or expired token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/zones": {
      "get": {
        "operationId": "listReservableZones",
        "tags": [
          "Zones",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List zones that support reservations",
        "x-required-actions": [
          "any-authenticated",
          "developer API key (read-only, its organization)"
        ],
        "description": "Returns parking zones where `rules.reservation.supported` is `true`. Results\nare automatically filtered to the authenticated operator's zones.\n\nEach zone includes centroid coordinates, boundary polygon, sensor counts\n(total / available / reserved), and any building configuration from the\nzone's `rules.reservation.buildings`.\n\n**Required actions:** none beyond membership of the organization.\n",
        "parameters": [
          {
            "in": "query",
            "name": "building",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter zones by building address or name. Performs both exact address\nmatching and case-insensitive partial matching against the zone's\n`rules.buildings` array.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "List of reservable zones.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "zone_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "zone_name": {
                        "type": "string"
                      },
                      "operator_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "center_lat": {
                        "type": "number",
                        "format": "float",
                        "nullable": true
                      },
                      "center_lon": {
                        "type": "number",
                        "format": "float",
                        "nullable": true
                      },
                      "boundary": {
                        "type": "array",
                        "nullable": true,
                        "description": "[[lat, lon], ...] polygon points for Leaflet.",
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "number"
                          }
                        }
                      },
                      "total_sensors": {
                        "type": "integer",
                        "description": "Total number of sensors in the zone."
                      },
                      "available_sensors": {
                        "type": "integer",
                        "description": "Sensors with status online or offline (not currently reserved)."
                      },
                      "reserved_sensors": {
                        "type": "integer",
                        "description": "Sensors currently in reserved status."
                      },
                      "buildings": {
                        "type": "array",
                        "description": "The buildings the zone serves (rules.reservation.buildings), for matching a meeting's location to a zone. Empty when none are configured.",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "nullable": true
                            },
                            "address": {
                              "type": "string",
                              "nullable": true
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reservations/zones/{zone_id}/spaces": {
      "get": {
        "operationId": "listZoneSpaces",
        "tags": [
          "Zones",
          "API keys: read-only"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List spaces in a reservable zone",
        "x-required-actions": [
          "any-authenticated",
          "developer API key (read-only, its organization)"
        ],
        "description": "Returns every space in a zone with whether it can be booked for the requested\nwindow. A space is unavailable when any hold overlaps the window: a booking,\nmaintenance, or the operator opening it to anyone without a booking.\n\nResults are filtered to the authenticated operator's zones.\n\n**Required actions:** none beyond membership of the organization.\n",
        "parameters": [
          {
            "in": "path",
            "name": "zone_id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Zone UUID."
          },
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Start of the desired time window (ISO 8601). Used to check space availability. A time with no UTC offset is the wall clock in the operator's time zone."
          },
          {
            "in": "query",
            "name": "until",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "End of the desired time window (ISO 8601). Used to check space availability. A time with no UTC offset is the wall clock in the operator's time zone."
          },
          {
            "in": "query",
            "name": "exclude_reservation_id",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A reservation being edited. Its own hold and booking do not count against its space, so the space it holds reads available for a window it could move to."
          }
        ],
        "responses": {
          "200": {
            "description": "List of spaces with current status and reservation info.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "spaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sensor_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The space."
                          },
                          "space_label": {
                            "type": "string",
                            "description": "What is painted on the ground."
                          },
                          "lat": {
                            "type": "number",
                            "nullable": true
                          },
                          "lon": {
                            "type": "number",
                            "nullable": true
                          },
                          "boundary": {
                            "type": "array",
                            "nullable": true,
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              }
                            },
                            "description": "Outline as [[lat, lon], ...]."
                          },
                          "status": {
                            "type": "string",
                            "description": "Why the space is unavailable now if it is (e.g. maintenance, reserved, open), else its device status."
                          },
                          "occupied": {
                            "type": "boolean",
                            "nullable": true,
                            "description": "Whether a vehicle is in it now."
                          },
                          "occupied_since": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "available": {
                            "type": "boolean",
                            "description": "Whether it can be booked for the whole requested window: no booking, maintenance or opening overlaps it."
                          },
                          "blocked_by": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "reserved",
                              "maintenance",
                              "open",
                              "facilities",
                              "ev_charging",
                              "valet",
                              "other",
                              null
                            ],
                            "description": "What stops it being booked in the window. `open` means the operator has opened it to anyone without a booking."
                          },
                          "maintenance": {
                            "type": "boolean",
                            "description": "Parkeze has declared this space's sensor in maintenance in the window -- its occupancy is not tracked. Said separately from blocked_by because it may overlap an event or facilities block."
                          },
                          "maintenance_since": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "maintenance_notes": {
                            "type": "string",
                            "nullable": true
                          },
                          "block_id": {
                            "type": "string",
                            "format": "uuid",
                            "nullable": true,
                            "description": "The event or facilities block covering the space in the window, if any."
                          },
                          "block_kind": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "event",
                              "facilities",
                              null
                            ]
                          },
                          "block_until": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "block_notes": {
                            "type": "string",
                            "nullable": true
                          },
                          "reservable": {
                            "type": "boolean",
                            "description": "Whether the zone and space rules allow bookings at all."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Zone not found or not reservable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "400": {
            "description": "`from` or `until` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/vehicles/": {
      "get": {
        "tags": [
          "Vehicles"
        ],
        "operationId": "listVehicles",
        "summary": "The person's vehicles",
        "description": "The primary vehicle first, then the most recently added.",
        "responses": {
          "200": {
            "description": "The vehicles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VehicleRecord"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/VehicleUnauthorized"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Vehicles"
        ],
        "operationId": "createVehicle",
        "summary": "Save a vehicle",
        "description": "Needs a token that confirms a phone number or an email. The plate is\nstored upper-cased with everything but letters and digits removed.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VehicleCreateRequest"
              },
              "example": {
                "lpn": "TEST123",
                "make": "Example",
                "model": "Hatchback",
                "color": "Blue",
                "year": 2022,
                "is_primary": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The vehicle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleRecord"
                }
              }
            }
          },
          "400": {
            "description": "No `lpn`, a plate that is not letters and digits (at most 12), or a `year` that is not a year.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/VehicleUnauthorized"
          },
          "403": {
            "description": "The token confirms no phone number and no email.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleError"
                },
                "example": {
                  "error": "Verify your phone number or email to add a vehicle"
                }
              }
            }
          },
          "409": {
            "description": "The person has saved this plate already.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleError"
                }
              }
            }
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    },
    "/v1/vehicles/{vehicle_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/VehicleId"
        }
      ],
      "get": {
        "tags": [
          "Vehicles"
        ],
        "operationId": "getVehicle",
        "summary": "One of the person's vehicles",
        "responses": {
          "200": {
            "description": "The vehicle.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleRecord"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/VehicleBadId"
          },
          "401": {
            "$ref": "#/components/responses/VehicleUnauthorized"
          },
          "404": {
            "$ref": "#/components/responses/VehicleNotFound"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Vehicles"
        ],
        "operationId": "updateVehicle",
        "summary": "Change a vehicle",
        "description": "Changes only the fields sent. A car is one record for everyone who\nholds its plate, so `make`, `model`, `color` and `year` fill what is\nnot known about it yet and never replace what is. A new `lpn` is\nanother car: what was said about the old one is kept for it where the\nnew one has nothing.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VehicleUpdateRequest"
              },
              "example": {
                "color": "Red",
                "is_primary": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The vehicle as changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleRecord"
                }
              }
            }
          },
          "400": {
            "description": "No body or no field to change, an id that is not a UUID, a bad plate, or a `year` that is not a year.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/VehicleUnauthorized"
          },
          "404": {
            "$ref": "#/components/responses/VehicleNotFound"
          },
          "409": {
            "description": "The person has saved the new plate already.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleError"
                }
              }
            }
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Vehicles"
        ],
        "operationId": "deleteVehicle",
        "summary": "Remove a vehicle",
        "description": "Removes it from the person's vehicles.",
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Vehicle removed"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/VehicleBadId"
          },
          "401": {
            "$ref": "#/components/responses/VehicleUnauthorized"
          },
          "404": {
            "$ref": "#/components/responses/VehicleNotFound"
          }
        },
        "security": [
          {
            "DriverAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "DriverAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "A signed-in person's access token from `https://auth.parkeze.com/realms/mobile`,\nissued to an app Parkeze has enabled for it (contact support@parkeze.com).\nAn API key's token is refused.\n"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "An access token from `https://auth.parkeze.com/realms/parkeze/protocol/openid-connect/token`,\nby client credentials with an API key made in the organization console,\nhttps://auth.parkeze.com/realms/parkeze/manage/api-keys.\nTokens last five minutes.\n"
      }
    },
    "schemas": {
      "BrandError": {
        "type": "object",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "string",
            "example": "Not found."
          }
        }
      },
      "BrandWordmark": {
        "type": "object",
        "nullable": true,
        "required": [
          "svg",
          "png",
          "aspect"
        ],
        "properties": {
          "svg": {
            "type": "string",
            "nullable": true,
            "description": "The SVG's file name, where the logo was uploaded as SVG.",
            "example": "wordmark.svg"
          },
          "png": {
            "type": "string",
            "description": "The largest PNG rendition's file name.",
            "example": "wordmark-192.png"
          },
          "aspect": {
            "type": "number",
            "description": "Width over height of the logo, margins trimmed.",
            "example": 3.2
          }
        }
      },
      "BrandMark": {
        "type": "object",
        "nullable": true,
        "required": [
          "svg",
          "png"
        ],
        "properties": {
          "svg": {
            "type": "string",
            "nullable": true,
            "example": "mark.svg"
          },
          "png": {
            "type": "string",
            "example": "mark-512.png"
          }
        }
      },
      "BrandManifest": {
        "type": "object",
        "required": [
          "alias",
          "version",
          "created_at",
          "variants",
          "wallet"
        ],
        "properties": {
          "alias": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "variants": {
            "type": "object",
            "required": [
              "wordmark",
              "wordmark_dark",
              "mark",
              "mark_dark"
            ],
            "properties": {
              "wordmark": {
                "$ref": "#/components/schemas/BrandWordmark"
              },
              "wordmark_dark": {
                "$ref": "#/components/schemas/BrandWordmark"
              },
              "mark": {
                "$ref": "#/components/schemas/BrandMark"
              },
              "mark_dark": {
                "$ref": "#/components/schemas/BrandMark"
              }
            }
          },
          "wallet": {
            "type": "object",
            "required": [
              "icon",
              "logo"
            ],
            "description": "File names relative to the version (`wallet/icon.png`).",
            "properties": {
              "icon": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "logo": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "example": {
          "alias": "example-org",
          "version": 1,
          "created_at": "2026-01-15T15:00:00Z",
          "variants": {
            "wordmark": {
              "svg": "wordmark.svg",
              "png": "wordmark-192.png",
              "aspect": 3.2
            },
            "wordmark_dark": null,
            "mark": {
              "svg": null,
              "png": "mark-512.png"
            },
            "mark_dark": null
          },
          "wallet": {
            "icon": [
              "wallet/icon.png",
              "wallet/icon@2x.png",
              "wallet/icon@3x.png"
            ],
            "logo": [
              "wallet/logo.png",
              "wallet/logo@2x.png",
              "wallet/logo@3x.png"
            ]
          }
        }
      },
      "CommerceError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Why, in words to show the driver."
          }
        },
        "example": {
          "error": "Choose the vehicle."
        }
      },
      "CommerceMoney": {
        "type": "object",
        "required": [
          "amount",
          "currency"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "example": "4.75"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          }
        }
      },
      "CommerceVehicle": {
        "type": "object",
        "required": [
          "plate"
        ],
        "properties": {
          "plate": {
            "type": "string",
            "description": "Spaces, dots and dashes are dropped and letters upper-cased.",
            "example": "TEST123"
          },
          "jurisdiction": {
            "type": "string",
            "description": "State or province, without the country prefix.",
            "example": "SC"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2; `US` when omitted.",
            "example": "US"
          }
        }
      },
      "CommerceFees": {
        "type": "object",
        "required": [
          "parking_fee",
          "currency"
        ],
        "properties": {
          "parking_fee": {
            "type": "string",
            "example": "4.00"
          },
          "convenience_fee": {
            "type": "string",
            "example": "0.50"
          },
          "tax": {
            "type": "string",
            "example": "0.25"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          }
        }
      },
      "CommerceZoneOffer": {
        "type": "object",
        "required": [
          "zoneId",
          "zoneName",
          "rightKey",
          "collectionMode",
          "settings",
          "status",
          "payCode",
          "offer"
        ],
        "properties": {
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "zoneName": {
            "type": "string",
            "example": "Example Street Lot"
          },
          "rightKey": {
            "type": "string",
            "enum": [
              "space",
              "vehicle"
            ],
            "description": "`space`: send `spaceNumber` to quote and buy. `vehicle`: send `vehicle`."
          },
          "collectionMode": {
            "type": "string",
            "enum": [
              "seller_collects",
              "platform_collects"
            ],
            "description": "Whether the card goes to the outside seller or to the organization's processor."
          },
          "settings": {
            "type": "object",
            "additionalProperties": true,
            "description": "What the seller allows here, such as `allows_extensions`, `allows_stops` and `grace_minutes`."
          },
          "status": {
            "type": "object",
            "additionalProperties": true,
            "description": "What the seller last said about the zone, such as whether it is selling and the rate in force."
          },
          "payCode": {
            "type": "string",
            "nullable": true,
            "description": "The digits posted at the zone for paying without the app.",
            "example": "40123"
          },
          "offer": {
            "$ref": "#/components/schemas/CommerceOfferTerms"
          }
        },
        "example": {
          "zoneId": "3f0c1d2e-0000-4000-8000-000000000001",
          "zoneName": "Example Street Lot",
          "rightKey": "vehicle",
          "collectionMode": "platform_collects",
          "settings": {},
          "status": {},
          "payCode": "40123",
          "offer": {
            "selling": true,
            "min_minutes": 15,
            "max_until": "2026-01-15T22:00:00+00:00",
            "increments": [
              {
                "minutes": 15,
                "total": {
                  "amount": "1.25",
                  "currency": "USD"
                }
              },
              {
                "minutes": 60,
                "total": {
                  "amount": "4.25",
                  "currency": "USD"
                }
              }
            ]
          }
        }
      },
      "CommerceOfferTerms": {
        "type": "object",
        "required": [
          "selling"
        ],
        "properties": {
          "selling": {
            "type": "boolean",
            "description": "False when the zone is not selling now (closed, free, or outside its hours); nothing else is said then."
          },
          "min_minutes": {
            "type": "integer",
            "example": 15
          },
          "max_until": {
            "type": "string",
            "format": "date-time",
            "description": "The latest a stay bought now may end."
          },
          "increments": {
            "type": "array",
            "description": "Stays the app can offer, each with its total.",
            "items": {
              "type": "object",
              "required": [
                "minutes",
                "total"
              ],
              "properties": {
                "minutes": {
                  "type": "integer"
                },
                "total": {
                  "$ref": "#/components/schemas/CommerceMoney"
                }
              }
            }
          }
        }
      },
      "CommerceQuoteRequest": {
        "type": "object",
        "required": [
          "zoneId",
          "minutes"
        ],
        "properties": {
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "minutes": {
            "type": "integer",
            "minimum": 1
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "Now when omitted. A start more than a few minutes past is refused."
          },
          "spaceNumber": {
            "type": "string",
            "description": "Required where the zone's `rightKey` is `space`."
          },
          "vehicle": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommerceVehicle"
              }
            ],
            "description": "Required where the zone's `rightKey` is `vehicle`."
          }
        }
      },
      "CommerceQuote": {
        "type": "object",
        "required": [
          "zoneId",
          "quote_ref",
          "fees",
          "starts_at",
          "ends_at"
        ],
        "properties": {
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "quote_ref": {
            "type": "string",
            "description": "Pass as `quoteRef` to buy. Opaque."
          },
          "fees": {
            "$ref": "#/components/schemas/CommerceFees"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "After this the quote buys nothing; get a new one."
          }
        },
        "example": {
          "zoneId": "3f0c1d2e-0000-4000-8000-000000000001",
          "quote_ref": "nq.eyJ6IjoiZXhhbXBsZSJ9.c2lnbmF0dXJl",
          "fees": {
            "parking_fee": "4.00",
            "convenience_fee": "0.50",
            "tax": "0.25",
            "currency": "USD"
          },
          "starts_at": "2026-01-15T15:00:00+00:00",
          "ends_at": "2026-01-15T16:30:00+00:00",
          "expires_at": "2026-01-15T15:10:00+00:00"
        }
      },
      "CommercePaymentSessionRequest": {
        "type": "object",
        "required": [
          "zoneId"
        ],
        "properties": {
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "amount": {
            "type": "string",
            "description": "The quote's total, where the organization's processor takes the card."
          },
          "currency": {
            "type": "string",
            "default": "USD"
          },
          "origin": {
            "type": "string",
            "description": "For a card form framed in a web page, the page's origin (`https://example.com`)."
          },
          "saveCard": {
            "type": "boolean",
            "default": false,
            "description": "The person agreed to keep the card for next time."
          }
        }
      },
      "CommercePaymentSession": {
        "type": "object",
        "required": [
          "method"
        ],
        "additionalProperties": true,
        "description": "`direct_tokenize`: post the card fields named in `fields` to\n`endpoint`, encoded as `encoding`, with `headers`, `constants` and\n`credential` as a bearer token; the token is at `token_field` in the\nanswer. Send the card's expiry beside the token as `cardExpiry` when\nyou buy. `hosted_form`: frame `endpoint` in a page; it posts the token\nto the page as a message. `apple_pay`, when present, says how to post\nan Apple Pay payment authorized in the app to the same tokenizer.\n",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "direct_tokenize",
              "hosted_form",
              "network_token"
            ]
          },
          "endpoint": {
            "type": "string",
            "format": "uri"
          },
          "credential": {
            "type": "string",
            "description": "Short-lived and good for `endpoint` only."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "origin": {
            "type": "string",
            "description": "For `hosted_form`, the origin its messages come from."
          },
          "wallets": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "apple_pay",
                "google_pay"
              ]
            }
          },
          "fields": {
            "type": "object",
            "description": "The key the endpoint takes for each card field.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "encoding": {
            "type": "string",
            "enum": [
              "json",
              "form"
            ],
            "default": "json"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "constants": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "token_field": {
            "type": "string",
            "default": "token"
          },
          "apple_pay": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "merchant_identifier": {
                "type": "string"
              },
              "endpoint": {
                "type": "string",
                "format": "uri"
              },
              "data_field": {
                "type": "string"
              }
            }
          }
        },
        "example": {
          "method": "direct_tokenize",
          "endpoint": "https://tokenizer.example.com/v1/tokens",
          "credential": "pk_test_0000000000",
          "encoding": "form",
          "fields": {
            "number": "card[number]",
            "exp_month": "card[exp_month]",
            "exp_year": "card[exp_year]",
            "cvc": "card[cvc]"
          },
          "token_field": "id"
        }
      },
      "CommerceOrderRequest": {
        "type": "object",
        "required": [
          "zoneId",
          "quoteRef",
          "paymentToken",
          "minutes",
          "idempotencyKey"
        ],
        "properties": {
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "quoteRef": {
            "type": "string",
            "description": "The quote's `quote_ref`."
          },
          "paymentToken": {
            "type": "string",
            "description": "The single-use token the payment session produced."
          },
          "cardExpiry": {
            "type": "string",
            "description": "The card's expiry as MMYY, for a processor that needs it to charge."
          },
          "saveCard": {
            "type": "boolean",
            "default": false
          },
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "description": "The quoted stay."
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "The quoted start; now when omitted."
          },
          "spaceNumber": {
            "type": "string"
          },
          "vehicle": {
            "$ref": "#/components/schemas/CommerceVehicle"
          },
          "idempotencyKey": {
            "type": "string",
            "description": "Yours, one per purchase. The same key always answers the same order."
          }
        }
      },
      "CommerceExtendRequest": {
        "type": "object",
        "required": [
          "minutes"
        ],
        "properties": {
          "minutes": {
            "type": "integer",
            "minimum": 1
          },
          "idempotencyKey": {
            "type": "string",
            "description": "One per extension. Without it every call is a new extension."
          },
          "paymentToken": {
            "type": "string",
            "description": "Required where the order's `collectionMode` is `platform_collects`."
          },
          "cardExpiry": {
            "type": "string"
          },
          "saveCard": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CommerceOrder": {
        "type": "object",
        "required": [
          "orderId",
          "zoneId",
          "zoneName",
          "state",
          "startsAt",
          "endsAt",
          "spaceNumber",
          "plate",
          "channel",
          "fees",
          "collectionMode",
          "rightId",
          "allowsExtensions",
          "allowsStops"
        ],
        "properties": {
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "zoneName": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "failed",
              "cancelled",
              "ended",
              "refunded"
            ],
            "description": "`pending` until the charge is answered; `confirmed` is parking you may use."
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "spaceNumber": {
            "type": "string",
            "nullable": true
          },
          "plate": {
            "type": "string",
            "nullable": true
          },
          "channel": {
            "type": "string",
            "enum": [
              "app",
              "web",
              "text",
              "voice",
              "station",
              "business"
            ],
            "description": "Where it was bought."
          },
          "fees": {
            "type": "object",
            "required": [
              "parking_fee",
              "convenience_fee",
              "tax",
              "total",
              "currency"
            ],
            "properties": {
              "parking_fee": {
                "type": "string"
              },
              "convenience_fee": {
                "type": "string"
              },
              "tax": {
                "type": "string"
              },
              "total": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              }
            }
          },
          "collectionMode": {
            "type": "string",
            "enum": [
              "seller_collects",
              "platform_collects"
            ]
          },
          "rightId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "The right to park the order made, once confirmed."
          },
          "allowsExtensions": {
            "type": "boolean"
          },
          "allowsStops": {
            "type": "boolean",
            "description": "Whether `stop` works now: false for an event booking, where the organization has turned ending early off, or where an outside seller takes no stops."
          },
          "event": {
            "type": "object",
            "nullable": true,
            "description": "The event it booked a lot for; null for any other order.",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "startsAt": {
                "type": "string",
                "format": "date-time"
              },
              "venue": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              },
              "lotName": {
                "type": "string"
              }
            }
          }
        },
        "example": {
          "orderId": "5e4d3c2b-0000-4000-8000-000000000003",
          "zoneId": "3f0c1d2e-0000-4000-8000-000000000001",
          "zoneName": "Example Street Lot",
          "state": "confirmed",
          "startsAt": "2026-01-15T15:00:00+00:00",
          "endsAt": "2026-01-15T16:30:00+00:00",
          "spaceNumber": null,
          "plate": "TEST123",
          "channel": "app",
          "fees": {
            "parking_fee": "4.00",
            "convenience_fee": "0.50",
            "tax": "0.25",
            "total": "4.75",
            "currency": "USD"
          },
          "collectionMode": "platform_collects",
          "rightId": "7b6a5f4e-0000-4000-8000-000000000004",
          "allowsExtensions": true,
          "allowsStops": true,
          "event": null
        }
      },
      "CommerceEventSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "category",
          "imageUrl",
          "organization",
          "venue",
          "startsAt",
          "endsAt",
          "doorsAt",
          "arriveFrom",
          "departBy",
          "timezone",
          "state",
          "priceFrom",
          "remaining",
          "distanceKm",
          "shopUrl"
        ],
        "description": "Times are in the organization's offset (`timezone`).",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "sports",
              "concert",
              "festival",
              "conference",
              "other"
            ]
          },
          "imageUrl": {
            "type": "string",
            "nullable": true
          },
          "organization": {
            "type": "object",
            "required": [
              "alias",
              "name",
              "logoUrl"
            ],
            "properties": {
              "alias": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "logoUrl": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "venue": {
            "type": "object",
            "required": [
              "name",
              "address",
              "lng",
              "lat"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "address": {
                "type": "string",
                "nullable": true
              },
              "lng": {
                "type": "number"
              },
              "lat": {
                "type": "number"
              }
            }
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "doorsAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "arriveFrom": {
            "type": "string",
            "format": "date-time",
            "description": "When a booking's right starts."
          },
          "departBy": {
            "type": "string",
            "format": "date-time",
            "description": "When a booking's right ends."
          },
          "timezone": {
            "type": "string",
            "example": "America/New_York"
          },
          "state": {
            "type": "string",
            "enum": [
              "on_sale",
              "sold_out",
              "not_on_sale",
              "live",
              "ended",
              "canceled"
            ],
            "description": "`canceled` from its status; else `ended` after `departBy`, `live`\nfrom `arriveFrom`; else `on_sale` when a lot sold here is in its\nbooking window with places left, `sold_out` when every such lot\nhas none, `not_on_sale` otherwise.\n"
          },
          "priceFrom": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommerceMoney"
              }
            ],
            "nullable": true,
            "description": "The least price of a lot sold here or drive-up, before fees."
          },
          "remaining": {
            "type": "integer",
            "nullable": true,
            "description": "Places left across the lots sold here; null when none is."
          },
          "distanceKm": {
            "type": "number",
            "nullable": true,
            "description": "From `near`, when it was given."
          },
          "shopUrl": {
            "type": "string",
            "example": "https://columbia.pkze.us/events/0b1c2d3e-0000-4000-8000-000000000010"
          }
        }
      },
      "CommerceEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CommerceEventSummary"
          },
          {
            "type": "object",
            "required": [
              "description",
              "promoter",
              "buyerCancelUntil",
              "canceledReason",
              "lots"
            ],
            "properties": {
              "description": {
                "type": "string",
                "nullable": true
              },
              "promoter": {
                "type": "string",
                "nullable": true
              },
              "buyerCancelUntil": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "Until when a buyer may cancel for a full refund; null when they cannot."
              },
              "canceledReason": {
                "type": "string",
                "nullable": true
              },
              "lots": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CommerceEventLot"
                }
              }
            }
          }
        ]
      },
      "CommerceEventLot": {
        "type": "object",
        "required": [
          "id",
          "zoneId",
          "name",
          "facility",
          "lng",
          "lat",
          "walkMinutes",
          "sale",
          "price",
          "inventory",
          "remaining",
          "soldOut",
          "salesOpenAt",
          "salesCloseAt",
          "onSale",
          "bookingUrl",
          "plateRequired",
          "liveFree",
          "note"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The zone's name."
          },
          "facility": {
            "type": "object",
            "nullable": true,
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "garage",
                  "lot",
                  "street",
                  "other"
                ]
              }
            }
          },
          "lng": {
            "type": "number",
            "nullable": true,
            "description": "The facility's center, else the zone's."
          },
          "lat": {
            "type": "number",
            "nullable": true
          },
          "walkMinutes": {
            "type": "integer",
            "nullable": true,
            "description": "Straight to the venue at 80 m a minute."
          },
          "sale": {
            "type": "string",
            "enum": [
              "here",
              "elsewhere",
              "drive_up"
            ],
            "description": "`here`: book with this API. `elsewhere`: at `bookingUrl`. `drive_up`: pay on arrival."
          },
          "price": {
            "type": "object",
            "nullable": true,
            "required": [
              "mode",
              "amount",
              "currency"
            ],
            "description": "For the whole window, before the convenience fee and tax; `rules` as the rules charge now.",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "flat",
                  "rules"
                ]
              },
              "amount": {
                "type": "string"
              },
              "currency": {
                "type": "string"
              }
            }
          },
          "inventory": {
            "type": "integer",
            "nullable": true
          },
          "remaining": {
            "type": "integer",
            "nullable": true
          },
          "soldOut": {
            "type": "boolean"
          },
          "salesOpenAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "salesCloseAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "onSale": {
            "type": "boolean"
          },
          "bookingUrl": {
            "type": "string",
            "nullable": true
          },
          "plateRequired": {
            "type": "boolean"
          },
          "liveFree": {
            "type": "integer",
            "nullable": true,
            "description": "Free spaces now, where something measures them."
          },
          "note": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "CommerceEventQuoteRequest": {
        "type": "object",
        "required": [
          "lotId"
        ],
        "properties": {
          "lotId": {
            "type": "string",
            "format": "uuid"
          },
          "vehicle": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommerceVehicle"
              }
            ],
            "nullable": true,
            "description": "Required where `plateRequired`."
          }
        }
      },
      "CommerceEventQuote": {
        "type": "object",
        "required": [
          "quoteRef",
          "lotId",
          "startsAt",
          "endsAt",
          "fees",
          "total",
          "expiresAt"
        ],
        "properties": {
          "quoteRef": {
            "type": "string"
          },
          "lotId": {
            "type": "string",
            "format": "uuid"
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "format": "date-time"
          },
          "fees": {
            "$ref": "#/components/schemas/CommerceFees"
          },
          "total": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CommerceEventPaymentSessionRequest": {
        "type": "object",
        "required": [
          "lotId"
        ],
        "properties": {
          "lotId": {
            "type": "string",
            "format": "uuid"
          },
          "origin": {
            "type": "string",
            "description": "For a card form framed in a web page, the page's origin."
          },
          "saveCard": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CommerceEventOrderRequest": {
        "type": "object",
        "required": [
          "lotId",
          "idempotencyKey",
          "quoteRef",
          "paymentToken"
        ],
        "properties": {
          "lotId": {
            "type": "string",
            "format": "uuid"
          },
          "idempotencyKey": {
            "type": "string"
          },
          "quoteRef": {
            "type": "string"
          },
          "paymentToken": {
            "type": "string"
          },
          "cardExpiry": {
            "type": "string",
            "nullable": true
          },
          "saveCard": {
            "type": "boolean",
            "default": false
          },
          "vehicle": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommerceVehicle"
              }
            ],
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true,
            "description": "A guest gives an email or a phone, for the receipt."
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "E.164."
          },
          "challenge": {
            "type": "string",
            "nullable": true,
            "description": "Turnstile's token; required without a token."
          }
        }
      },
      "CommerceEventBooking": {
        "type": "object",
        "required": [
          "order",
          "code",
          "receipt",
          "event",
          "lot"
        ],
        "properties": {
          "order": {
            "$ref": "#/components/schemas/CommerceOrder"
          },
          "code": {
            "type": "string",
            "description": "The booking's code: the receipt's, and the buyer's to cancel with."
          },
          "receipt": {
            "type": "string",
            "description": "The receipt's link."
          },
          "event": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "startsAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "lot": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            }
          }
        }
      },
      "CommerceValidationCode": {
        "type": "object",
        "required": [
          "businessName",
          "minutes",
          "usableUntil",
          "zones"
        ],
        "properties": {
          "businessName": {
            "type": "string",
            "example": "Example Cafe"
          },
          "minutes": {
            "type": "integer",
            "example": 120
          },
          "usableUntil": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "zones": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "rightKey"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "rightKey": {
                  "type": "string",
                  "enum": [
                    "space",
                    "vehicle"
                  ]
                }
              }
            }
          }
        }
      },
      "CommerceRedeemRequest": {
        "type": "object",
        "required": [
          "code",
          "zoneId"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "zoneId": {
            "type": "string",
            "format": "uuid",
            "description": "One of the code's zones."
          },
          "spaceNumber": {
            "type": "string",
            "description": "Required where the zone's `rightKey` is `space`."
          },
          "vehicle": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommerceVehicle"
              }
            ],
            "description": "Required where the zone's `rightKey` is `vehicle`."
          }
        }
      },
      "CommerceRedemption": {
        "type": "object",
        "required": [
          "validUntil",
          "zoneId",
          "businessName"
        ],
        "properties": {
          "validUntil": {
            "type": "string",
            "format": "date-time"
          },
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "businessName": {
            "type": "string",
            "example": "Example Cafe"
          }
        }
      },
      "CommerceCheckinOffer": {
        "type": "object",
        "required": [
          "id",
          "business",
          "name",
          "minutes",
          "needsCode"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "business": {
            "type": "string",
            "example": "Example Cafe"
          },
          "name": {
            "type": "string",
            "example": "Two hours with lunch"
          },
          "minutes": {
            "type": "integer",
            "example": 120
          },
          "needsCode": {
            "type": "boolean",
            "description": "Checking in takes the code shown at the business today."
          }
        }
      },
      "CommerceCheckinRequest": {
        "type": "object",
        "required": [
          "zoneId",
          "vehicle"
        ],
        "properties": {
          "zoneId": {
            "type": "string",
            "format": "uuid",
            "description": "Where the car is parked; one of the offer's zones."
          },
          "vehicle": {
            "$ref": "#/components/schemas/CommerceVehicle"
          },
          "code": {
            "type": "string",
            "description": "Today's code, for an offer with `needsCode`."
          }
        }
      },
      "CommerceCheckin": {
        "type": "object",
        "required": [
          "validUntil",
          "business",
          "zoneId",
          "minutes"
        ],
        "properties": {
          "validUntil": {
            "type": "string",
            "format": "date-time"
          },
          "business": {
            "type": "string",
            "example": "Example Cafe"
          },
          "zoneId": {
            "type": "string",
            "format": "uuid"
          },
          "minutes": {
            "type": "integer",
            "example": 120
          }
        }
      },
      "LiveError": {
        "type": "object",
        "description": "`detail` when the request is refused (401, 403, 404, 503);\n`error` with a code when the station is refused.\n",
        "properties": {
          "detail": {
            "type": "string",
            "example": "Missing or invalid Authorization header"
          },
          "error": {
            "type": "string",
            "enum": [
              "not_a_station_member",
              "station_operator_mismatch"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "The status's name (`Forbidden`), or a code an app acts on (`not_a_station_member`).",
            "example": "Forbidden"
          },
          "message": {
            "type": "string",
            "description": "Why, when there is more to say."
          },
          "path": {
            "type": "string",
            "description": "On a 404 for a path that does not exist."
          }
        }
      },
      "Station": {
        "type": "object",
        "properties": {
          "station_id": {
            "type": "string",
            "format": "uuid"
          },
          "operator_id": {
            "type": "string",
            "format": "uuid"
          },
          "org_alias": {
            "type": "string",
            "description": "The station operator's org alias, for X-Active-Org. An officer in several orgs acts for this one at the station.\n"
          },
          "name": {
            "type": "string"
          },
          "view": {
            "type": "string",
            "enum": [
              "station",
              "custom"
            ],
            "description": "Derived from the station's application: `station` for the built-in station screen (`enforcement-station`), `custom` for a registry module. A station made before applications existed, and not edited since, returns what it stored.\n"
          },
          "application": {
            "type": "object",
            "nullable": true,
            "description": "The enforcement application this station shows; null for a station made before applications existed and not edited since. Additive: view and config already say what to show.\n",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string",
                "example": "Reservation desk"
              }
            }
          },
          "zone_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "config": {
            "type": "object",
            "description": "The view's configuration; `{}` for `station`. A `custom` station\nnames a module from the registry -- its\napplication's module and major, `{\"module\", \"major\"}` -- returned\nresolved against\n`https://modules.parkeze.com/registry.json` (cached for 5 minutes;\nif a refresh fails the last good copy is used):\n\n- `{\"module\", \"major\", \"module_url\", \"element\"}` -- load\n  `module_url` (always on `https://modules.parkeze.com`) and create\n  `element`.\n- `{\"module\", \"major\", \"error\": \"module_not_served\"}` -- the\n  registry does not serve that module or major. Show it; load\n  nothing.\n- `{\"module\", \"major\", \"error\": \"registry_unavailable\"}` -- the\n  registry has not been reached since this service started.\n\nA station without an application still holding an older\n`{\"module_url\", \"element\"}` is returned unchanged until it is\n\nedited in the operator console.\n",
            "properties": {
              "module": {
                "type": "string",
                "example": "reservation-desk"
              },
              "major": {
                "type": "integer",
                "example": 1
              },
              "module_url": {
                "type": "string",
                "format": "uri",
                "example": "https://modules.parkeze.com/reservation-desk/v1/reservation-desk.js"
              },
              "element": {
                "type": "string",
                "example": "parkeze-reservation-desk"
              },
              "error": {
                "type": "string",
                "enum": [
                  "module_not_served",
                  "registry_unavailable"
                ]
              }
            }
          }
        }
      },
      "Block": {
        "type": "object",
        "description": "A zone's spaces held for a window, as one thing. `event` lets anyone\npark without a booking; `facilities` keeps the spaces for facilities\nvehicles. Neither can be booked over.\n",
        "properties": {
          "block_id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "event",
              "facilities"
            ]
          },
          "zone_id": {
            "type": "string",
            "format": "uuid"
          },
          "zone_name": {
            "type": "string",
            "nullable": true
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "lpns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_by": {
            "type": "string",
            "nullable": true
          },
          "source_app": {
            "type": "string",
            "nullable": true
          },
          "spaces": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "space_uuid": {
                  "type": "string",
                  "format": "uuid"
                },
                "space_label": {
                  "type": "string",
                  "nullable": true
                },
                "hold_id": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      },
      "SpaceHold": {
        "type": "object",
        "description": "A time-windowed block on a parking space. The native primitive every\noptional app blocks a space with \u2014 reservations, maintenance, EV\ncharging, valet \u2014 so this array covers every reason a space can be\nunavailable, not only bookings.\n",
        "properties": {
          "hold_id": {
            "type": "string",
            "format": "uuid"
          },
          "space_uuid": {
            "type": "string",
            "format": "uuid"
          },
          "space_label": {
            "type": "string",
            "nullable": true,
            "description": "Friendly name, falling back to the space number."
          },
          "space_number": {
            "type": "string",
            "nullable": true
          },
          "zone_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "zone_name": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "enum": [
              "maintenance",
              "reserved",
              "ev_charging",
              "valet",
              "other",
              "open",
              "facilities"
            ],
            "description": "Why the space is unavailable. `open` is an event block (anyone may\npark), `facilities` a facilities block; see Blocks. Reasons are values, not endpoints \u2014\nan app added later appears here without a change to this API.\n"
          },
          "permits_parking": {
            "type": "boolean",
            "description": "**Read this before deciding to ticket.** For `reserved`, true only\nfor the vehicle named in `reservation.vehicle_lpn`. For `open` and\n`facilities`, true for anyone: the space needs no booking in the\nwindow. For every other reason false \u2014 a `maintenance` hold is the\nopposite of an excuse.\n"
          },
          "held_from": {
            "type": "string",
            "format": "date-time"
          },
          "held_until": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Null means open-ended, which is what maintenance is."
          },
          "active_now": {
            "type": "boolean",
            "description": "Whether the hold is in force at the time of the request."
          },
          "source_ref": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "The record that caused the hold, if any."
          },
          "source_app": {
            "type": "string",
            "nullable": true
          },
          "created_by": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "lpns": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "string"
            },
            "description": "Plates a facilities block is for, when known. Informational."
          },
          "reservation": {
            "type": "object",
            "nullable": true,
            "description": "Booking detail for a hold a reservation produced, resolved through\n`source_ref`. Null for every other reason \u2014 there is no guest to\ncheck a plate against on a maintenance hold.\n",
            "properties": {
              "reservation_id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "type": "string"
              },
              "reserved_from": {
                "type": "string",
                "format": "date-time"
              },
              "reserved_until": {
                "type": "string",
                "format": "date-time"
              },
              "guest_name": {
                "type": "string",
                "nullable": true
              },
              "vehicle_lpn": {
                "type": "string",
                "nullable": true
              },
              "vehicle_make": {
                "type": "string",
                "nullable": true
              },
              "vehicle_model": {
                "type": "string",
                "nullable": true
              },
              "vehicle_color": {
                "type": "string",
                "nullable": true
              }
            }
          }
        }
      },
      "VehicleError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "VehicleRecord": {
        "type": "object",
        "required": [
          "id",
          "lpn",
          "phone_number",
          "email",
          "make",
          "model",
          "color",
          "year",
          "is_primary",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "This vehicle in the person's list."
          },
          "lpn": {
            "type": "string",
            "description": "The plate, upper-cased, letters and digits only."
          },
          "phone_number": {
            "type": "string",
            "nullable": true,
            "description": "The phone number the vehicle is kept under, where the token verified one."
          },
          "email": {
            "type": "string",
            "nullable": true,
            "description": "The email the vehicle is kept under, where the token verified one."
          },
          "make": {
            "type": "string",
            "nullable": true
          },
          "model": {
            "type": "string",
            "nullable": true
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer",
            "nullable": true
          },
          "is_primary": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "example": {
          "id": "2d3e4f50-0000-4000-8000-000000000005",
          "lpn": "TEST123",
          "phone_number": "+15555550100",
          "email": "driver@example.com",
          "make": "Example",
          "model": "Hatchback",
          "color": "Blue",
          "year": 2022,
          "is_primary": true,
          "created_at": "2026-01-15T15:00:00+00:00",
          "updated_at": "2026-01-15T15:00:00+00:00"
        }
      },
      "VehicleCreateRequest": {
        "type": "object",
        "required": [
          "lpn"
        ],
        "properties": {
          "lpn": {
            "type": "string",
            "description": "The plate; at most 12 letters and digits once spaces and dashes are removed."
          },
          "make": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "minimum": 1900,
            "maximum": 2100
          },
          "is_primary": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "VehicleUpdateRequest": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "lpn": {
            "type": "string"
          },
          "make": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "nullable": true,
            "minimum": 1900,
            "maximum": 2100
          },
          "is_primary": {
            "type": "boolean"
          }
        }
      }
    },
    "responses": {
      "BrandNotModified": {
        "description": "The `If-None-Match` ETag is current; no body."
      },
      "BrandNotFound": {
        "description": "No such organization, version or file.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BrandError"
            }
          }
        }
      },
      "CommerceEventNotFound": {
        "description": "No such event, or one not published.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            },
            "example": {
              "error": "No such event."
            }
          }
        }
      },
      "CommerceBadRequest": {
        "description": "The request is incomplete or invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            }
          }
        }
      },
      "CommerceUnauthorized": {
        "description": "No token, or one that is expired, not a person's, or not enabled for paying.",
        "headers": {
          "WWW-Authenticate": {
            "description": "`Bearer` when no token was sent.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            },
            "example": {
              "error": "Sign in to pay."
            }
          }
        }
      },
      "CommerceNotFound": {
        "description": "No such zone, or one the person may not see.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            },
            "example": {
              "error": "No such zone."
            }
          }
        }
      },
      "CommerceOrderNotFound": {
        "description": "No such order of this person's.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            },
            "example": {
              "error": "No such order."
            }
          }
        }
      },
      "CommercePaymentRefused": {
        "description": "The card was declined, or the seller refused the purchase. The message says why.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            },
            "example": {
              "error": "The card was declined."
            }
          }
        }
      },
      "CommerceNotAvailable": {
        "description": "This zone's seller cannot be bought from through Parkeze yet.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            }
          }
        }
      },
      "CommerceUnavailable": {
        "description": "The seller, the payment processor or sign-in did not answer. Try again.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            }
          }
        }
      },
      "CommerceTooMany": {
        "description": "Too many tries. Wait for `Retry-After` seconds.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CommerceError"
            }
          }
        }
      },
      "CommerceInvalidRequest": {
        "description": "A required query parameter is missing or has the wrong type.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      },
      "VehicleUnauthorized": {
        "description": "No token, or one that is expired, invalid, or not from Parkeze's sign-in.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/VehicleError"
            },
            "example": {
              "error": "Missing or invalid Authorization header"
            }
          }
        }
      },
      "VehicleBadId": {
        "description": "The id is not a UUID.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/VehicleError"
            },
            "example": {
              "error": "Invalid UUID format"
            }
          }
        }
      },
      "VehicleNotFound": {
        "description": "No such vehicle of this person's.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/VehicleError"
            },
            "example": {
              "error": "Vehicle not found"
            }
          }
        }
      }
    },
    "parameters": {
      "BrandAlias": {
        "name": "alias",
        "in": "path",
        "required": true,
        "description": "The organization's alias.",
        "schema": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$"
        },
        "example": "example-org"
      },
      "BrandVersion": {
        "name": "version",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 999999999
        },
        "example": 1
      },
      "BrandIfNoneMatch": {
        "name": "If-None-Match",
        "in": "header",
        "required": false,
        "description": "An `ETag` this file was served with before.",
        "schema": {
          "type": "string"
        }
      },
      "CommerceZoneId": {
        "name": "zone_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "3f0c1d2e-0000-4000-8000-000000000001"
      },
      "CommerceEventId": {
        "name": "event_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "0b1c2d3e-0000-4000-8000-000000000010"
      },
      "CommerceOrderId": {
        "name": "order_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "5e4d3c2b-0000-4000-8000-000000000003"
      },
      "Station": {
        "name": "X-Station",
        "in": "header",
        "required": false,
        "description": "The station a signed-in person is working at, a `station_id` from\n`GET /v1/stations/mine`. Narrows the answer to the station's zones.\n",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "VehicleId": {
        "name": "vehicle_id",
        "in": "path",
        "required": true,
        "description": "The vehicle's `id`.",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "2d3e4f50-0000-4000-8000-000000000005"
      }
    },
    "headers": {
      "BrandCacheControl": {
        "schema": {
          "type": "string",
          "example": "public, max-age=31536000, immutable"
        }
      },
      "BrandETag": {
        "description": "The file's SHA-256, quoted.",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}
