{
  "openapi": "3.1.0",
  "info": {
    "title": "Locus Partner REST — gated contract preview",
    "version": "0.2.0-preview",
    "description": "Disabled by default. Customer-approved funded research from reviewed server evidence, immutable publications and destination-bound delivery. Local fixtures are explicitly labelled. No automatic subscription, cash charge or provider acquisition."
  },
  "servers": [
    {
      "url": "https://locus.example.invalid"
    }
  ],
  "x-locus-availability": "Implemented behind separate connection and research gates; this document does not certify production enablement, funding or source rights.",
  "x-unrouted-contracts": {
    "coverage": {
      "method": "GET",
      "path": "/api/v1/coverage",
      "intendedScope": "coverage:read",
      "querySchema": "#/components/schemas/CoverageQuery",
      "responseSchema": "#/components/schemas/Coverage",
      "status": "Handler implemented; current catch-all route does not dispatch coverageGET. Do not treat this as an executable endpoint."
    }
  },
  "paths": {
    "/.well-known/oauth-authorization-server/api/v1/oauth": {
      "get": {
        "operationId": "discoverPartnerIssuer",
        "description": "Connection-gated authorization-server metadata; issuer is origin/api/v1/oauth. No dynamic registration endpoint.",
        "responses": {
          "200": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuerMetadata"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource/api/v1": {
      "get": {
        "operationId": "discoverPartnerResource",
        "description": "Connection-gated REST resource metadata; resource is origin/api/v1. Separate from MCP.",
        "responses": {
          "200": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourceMetadata"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth/authorize": {
      "get": {
        "operationId": "connectPartner",
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "code"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 2000,
              "format": "uri"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 2000
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 512
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{43}$"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "S256"
            }
          },
          {
            "name": "destination_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "partner_user_reference",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "request_reference",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "referral",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "description": "Starts an expiring server-owned intent. Continuation uses only ?intent=<opaque-reference>. Normal Locus login and verified account consent are required. No browser storage is required by the continuation.",
        "responses": {
          "200": {
            "description": "Script-free Locus consent page."
          },
          "303": {
            "description": "Intent continuation, login or registered callback; Location header.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OAuthError"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth/consent": {
      "post": {
        "operationId": "approvePartnerConnection",
        "security": [
          {
            "customerSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Consent"
              }
            }
          }
        },
        "description": "Locus browser session, same-origin POST and one-use CSRF required. Does not approve spending or report delivery.",
        "responses": {
          "303": {
            "description": "Exact registered callback with state, issuer and code or access_denied.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OAuthError"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth/token": {
      "post": {
        "operationId": "exchangePartnerCode",
        "security": [
          {
            "partnerClient": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/CodeExchange"
              }
            }
          }
        },
        "description": "Registered confidential client, S256 PKCE, exact redirect and REST resource required. Enabled research supports rotating refresh tokens for at most 30 days; replay revokes the family. No client-credentials customer grant. OAuth errors follow RFC 6749.",
        "responses": {
          "200": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessToken"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OAuthError"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth/revoke": {
      "post": {
        "operationId": "revokePartnerToken",
        "security": [
          {
            "partnerClient": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Revocation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Idempotent revocation; token existence is not disclosed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevocationResult"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OAuthError"
                    },
                    {
                      "$ref": "#/components/schemas/ApiError"
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "429": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/approvals/{id}": {
      "get": {
        "operationId": "viewCustomerApproval",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "customerSession": []
          }
        ],
        "description": "Customer browser only: verified Locus session; redirects to login when absent. Displays exact quote terms and one-use CSRF. No partner bearer authority.",
        "responses": {
          "200": {
            "description": "text/html customer approval page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "303": {
            "description": "Login redirect",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "decideCustomerApproval",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "security": [
          {
            "customerSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalDecision"
              }
            }
          }
        },
        "description": "Customer browser only: authenticated session, same-origin form and CSRF. Returns HTML with a Locus requests link. No automatic partner return redirect or approval grant in URL. Backend polls quote.",
        "responses": {
          "200": {
            "description": "text/html approved or declined; no units consumed yet",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "410": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/research/quotes": {
      "post": {
        "operationId": "quoteResearch",
        "security": [
          {
            "partnerConnection": [
              "research:quote"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              }
            }
          }
        },
        "description": "Reserves nothing. Returns canonical unique postcodes, reusable/fresh children, selected funding, maximum units and a Locus-hosted approval URL. Unsupported or unlicensed coverage is rejected.",
        "responses": {
          "201": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "429": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/research/quotes/{id}": {
      "get": {
        "operationId": "readApprovedQuote",
        "security": [
          {
            "partnerConnection": [
              "research:quote"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Bound to the same owner, client, destination and connection. approval_grant is returned only after explicit Locus approval; never place it in a URL.",
        "responses": {
          "200": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteStatus"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/research": {
      "post": {
        "operationId": "submitApprovedResearch",
        "security": [
          {
            "partnerConnection": [
              "research:execute"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResearchSubmission"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 120,
              "pattern": "^[\\w.:-]{8,120}$"
            }
          }
        ],
        "description": "Atomically consumes the exact approval, holds original selected funding and enqueues durable work before returning 202. Retrying the same key/input returns the same operation; changed terms conflict. OAuth scope alone never spends.",
        "responses": {
          "202": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Admission"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "3 seconds",
                "schema": {
                  "type": "integer",
                  "const": 3
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "410": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "429": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/research/{id}": {
      "get": {
        "operationId": "readResearchStatus",
        "security": [
          {
            "partnerConnection": [
              "research:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Polling never acquires evidence. Children have QA status and held/captured/released units. Unusable failure has no report links. Useful negative findings charge; partial comparison charges only useful fresh children.",
        "responses": {
          "200": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/research/{id}/cancel": {
      "post": {
        "operationId": "cancelResearch",
        "security": [
          {
            "partnerConnection": [
              "research:execute"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Idempotent, fenced cancellation releases only uncommitted holds. A committed useful publication remains chargeable.",
        "responses": {
          "200": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cancellation"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/{id}": {
      "get": {
        "operationId": "readReport",
        "security": [
          {
            "partnerConnection": [
              "reports:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": "Exact approved version and destination grant, with current source permissions. No implicit latest version, raw provider payloads or conditional cache bypass. Adds checksum and delivery.grant_id to the closed report projection.",
        "responses": {
          "200": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/{id}/pdf": {
      "get": {
        "operationId": "downloadReportPdf",
        "security": [
          {
            "partnerConnection": [
              "reports:pdf"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "description": "Authenticated immutable PDF stream from the same frozen publication. X-Report-Checksum hashes canonical report JSON; X-PDF-Checksum is SHA256 of the exact PDF bytes. No anonymous provider URL.",
        "responses": {
          "200": {
            "description": "application/pdf attachment; private, no-store.",
            "headers": {
              "X-Report-Checksum": {
                "schema": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              },
              "X-PDF-Checksum": {
                "schema": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/pdf"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "410": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/{id}/delivery-ack": {
      "post": {
        "operationId": "acknowledgeReportDelivery",
        "security": [
          {
            "partnerConnection": [
              "reports:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeliveryAcknowledgement"
              }
            }
          }
        },
        "description": "Idempotently records this registered destination receiving this exact version/grant. A changed receipt reference conflicts. Receipt is separate from availability, retrieval and usefulness.",
        "responses": {
          "200": {
            "description": "Successful response. Cache-Control: private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "410": {
            "description": "Rejected request. Read operation status before retrying an uncertain submission; an existing operation may already hold or have captured units."
          },
          "413": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          },
          "503": {
            "description": "Request rejected; inspect the error and any existing operation before retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "const": 60
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RevocationResult": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "IssuerMetadata": {
        "type": "object",
        "properties": {
          "issuer": {
            "type": "string",
            "format": "uri"
          },
          "authorization_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "token_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "revocation_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "response_types_supported": {
            "type": "array",
            "items": {
              "type": "string",
              "const": "code"
            }
          },
          "grant_types_supported": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "authorization_code",
                "refresh_token"
              ]
            }
          },
          "code_challenge_methods_supported": {
            "type": "array",
            "items": {
              "type": "string",
              "const": "S256"
            }
          },
          "token_endpoint_auth_methods_supported": {
            "type": "array",
            "items": {
              "type": "string",
              "const": "client_secret_basic"
            }
          },
          "scopes_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "issuer",
          "authorization_endpoint",
          "token_endpoint",
          "revocation_endpoint",
          "response_types_supported",
          "grant_types_supported",
          "code_challenge_methods_supported",
          "token_endpoint_auth_methods_supported",
          "scopes_supported"
        ],
        "additionalProperties": false
      },
      "ResourceMetadata": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string",
            "format": "uri"
          },
          "authorization_servers": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "scopes_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bearer_methods_supported": {
            "type": "array",
            "items": {
              "type": "string",
              "const": "header"
            }
          }
        },
        "required": [
          "resource",
          "authorization_servers",
          "scopes_supported",
          "bearer_methods_supported"
        ],
        "additionalProperties": false
      },
      "AuthorizationRequest": {
        "type": "object",
        "properties": {
          "response_type": {
            "type": "string",
            "const": "code"
          },
          "client_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "redirect_uri": {
            "type": "string",
            "maxLength": 2000,
            "format": "uri"
          },
          "resource": {
            "type": "string",
            "maxLength": 2000
          },
          "scope": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "state": {
            "type": "string",
            "minLength": 16,
            "maxLength": 512
          },
          "code_challenge": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "code_challenge_method": {
            "type": "string",
            "const": "S256"
          },
          "destination_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "partner_user_reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "request_reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "referral": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        },
        "required": [
          "response_type",
          "client_id",
          "redirect_uri",
          "resource",
          "scope",
          "state",
          "code_challenge",
          "code_challenge_method",
          "destination_id"
        ],
        "additionalProperties": false
      },
      "CodeExchange": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "grant_type": {
                "type": "string",
                "const": "authorization_code"
              },
              "code": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{43}$"
              },
              "code_verifier": {
                "type": "string",
                "pattern": "^[A-Za-z0-9._~-]{43,128}$"
              },
              "redirect_uri": {
                "type": "string",
                "maxLength": 2000,
                "format": "uri"
              },
              "resource": {
                "type": "string",
                "maxLength": 2000
              }
            },
            "required": [
              "grant_type",
              "code",
              "code_verifier",
              "redirect_uri",
              "resource"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "grant_type": {
                "type": "string",
                "const": "refresh_token"
              },
              "refresh_token": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{43}$"
              },
              "resource": {
                "type": "string",
                "maxLength": 2000,
                "format": "uri"
              }
            },
            "required": [
              "grant_type",
              "refresh_token",
              "resource"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Consent": {
        "type": "object",
        "properties": {
          "intent": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "csrf": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "deny"
            ]
          }
        },
        "required": [
          "intent",
          "csrf",
          "decision"
        ],
        "additionalProperties": false
      },
      "Revocation": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "token_type_hint": {
            "type": "string",
            "enum": [
              "access_token",
              "refresh_token"
            ]
          }
        },
        "required": [
          "token"
        ],
        "additionalProperties": false
      },
      "AccessToken": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "token_type": {
            "type": "string",
            "const": "Bearer"
          },
          "refresh_token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "expires_in": {
            "type": "number",
            "const": 900
          },
          "scope": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope"
        ],
        "additionalProperties": false
      },
      "CoverageQuery": {
        "type": "object",
        "properties": {
          "country_code": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "postal_code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "business_type": {
            "type": "string",
            "minLength": 2,
            "maxLength": 100
          },
          "report_kind": {
            "default": "single_location_intelligence",
            "type": "string",
            "enum": [
              "single_location_intelligence",
              "location_comparison"
            ]
          }
        },
        "required": [
          "country_code",
          "postal_code",
          "business_type"
        ],
        "additionalProperties": false
      },
      "Coverage": {
        "type": "object",
        "properties": {
          "units_reserved": {
            "type": "number",
            "const": 0
          },
          "required_inputs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "raw_data": {
            "type": "string",
            "const": "not_approved"
          },
          "status": {
            "type": "string",
            "enum": [
              "supported",
              "partial",
              "unavailable"
            ]
          },
          "reason": {
            "type": "string"
          },
          "channels": {
            "type": "object",
            "properties": {
              "app": {
                "type": "string",
                "const": "approved"
              },
              "partner_report": {
                "type": "string",
                "const": "approved"
              },
              "raw_data": {
                "type": "string",
                "const": "not_approved"
              }
            },
            "required": [
              "app",
              "partner_report",
              "raw_data"
            ],
            "additionalProperties": false
          },
          "footprint": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "country_code": {
                  "type": "string"
                },
                "postal_code": {
                  "type": "string"
                },
                "method": {
                  "type": "string",
                  "const": "postal_representative_point"
                },
                "latitude": {
                  "type": "number"
                },
                "longitude": {
                  "type": "number"
                },
                "radius_meters": {
                  "type": "number"
                }
              },
              "required": [
                "country_code",
                "postal_code",
                "method",
                "latitude",
                "longitude",
                "radius_meters"
              ],
              "additionalProperties": false
            }
          },
          "source_periods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "missing_sections": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "data_mode": {
            "type": "string",
            "enum": [
              "synthetic_local_fixture",
              "reviewed_snapshot"
            ]
          }
        },
        "required": [
          "units_reserved",
          "required_inputs",
          "raw_data",
          "status",
          "footprint",
          "source_periods"
        ],
        "additionalProperties": false
      },
      "OAuthError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "error_description"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "request_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "request_id"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "QuoteRequest": {
        "type": "object",
        "properties": {
          "operation": {
            "type": "string",
            "enum": [
              "single_location_intelligence",
              "location_comparison"
            ]
          },
          "candidates": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 250
                },
                "country_code": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$"
                },
                "postal_code": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20
                },
                "client_reference": {
                  "type": "string",
                  "maxLength": 100
                }
              },
              "required": [
                "address",
                "country_code",
                "postal_code"
              ],
              "additionalProperties": false
            }
          },
          "business_type": {
            "type": "string",
            "minLength": 2,
            "maxLength": 100
          },
          "business_niche": {
            "default": "",
            "type": "string",
            "maxLength": 100
          },
          "purpose": {
            "default": "general_local_intelligence",
            "type": "string",
            "maxLength": 100
          },
          "radius_meters": {
            "default": 1609.344,
            "type": "number",
            "exclusiveMinimum": 0,
            "maximum": 48280
          },
          "brief": {
            "default": "",
            "type": "string",
            "maxLength": 2000
          },
          "accept_partial": {
            "default": false,
            "type": "boolean"
          },
          "funding": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "subscription",
                  "add_on",
                  "locus_introductory"
                ]
              },
              "reference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 150
              }
            },
            "required": [
              "type",
              "reference"
            ],
            "additionalProperties": false
          },
          "destination": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "request_reference": {
                "type": "string",
                "maxLength": 100
              }
            },
            "required": [
              "id"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation",
          "candidates",
          "business_type",
          "funding",
          "destination"
        ],
        "additionalProperties": false
      },
      "Quote": {
        "type": "object",
        "properties": {
          "quote_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "input_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "maximum_units": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "funding": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "subscription",
                  "add_on",
                  "locus_introductory"
                ]
              },
              "reference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 150
              }
            },
            "required": [
              "type",
              "reference"
            ],
            "additionalProperties": false
          },
          "candidates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "postal_code": {
                  "type": "string"
                },
                "address": {
                  "type": "string"
                },
                "reused": {
                  "type": "boolean"
                },
                "missing_sections": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "source_period": {
                  "type": "string"
                },
                "data_mode": {
                  "type": "string",
                  "enum": [
                    "synthetic_local_fixture",
                    "reviewed_snapshot"
                  ]
                }
              },
              "required": [
                "postal_code",
                "address",
                "reused",
                "missing_sections",
                "source_period",
                "data_mode"
              ],
              "additionalProperties": false
            }
          },
          "approval_url": {
            "type": "string",
            "format": "uri"
          },
          "data_mode": {
            "type": "string",
            "enum": [
              "synthetic_local_fixture",
              "reviewed_snapshot"
            ]
          }
        },
        "required": [
          "quote_id",
          "input_hash",
          "expires_at",
          "maximum_units",
          "funding",
          "candidates",
          "approval_url",
          "data_mode"
        ],
        "additionalProperties": false
      },
      "QuoteStatus": {
        "type": "object",
        "properties": {
          "quote_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "maximum_units": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "denied",
              "expired",
              "consumed"
            ]
          },
          "approval_grant": {
            "type": "string",
            "pattern": "^[\\w-]{43}$"
          }
        },
        "required": [
          "quote_id",
          "maximum_units",
          "expires_at",
          "state"
        ],
        "additionalProperties": false
      },
      "Admission": {
        "type": "object",
        "properties": {
          "operation_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "status": {
            "type": "string",
            "const": "queued"
          },
          "status_url": {
            "type": "string"
          }
        },
        "required": [
          "operation_id",
          "status",
          "status_url"
        ],
        "additionalProperties": false
      },
      "Operation": {
        "type": "object",
        "properties": {
          "operation_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "partially_succeeded",
              "failed",
              "cancelled",
              "expired"
            ]
          },
          "children": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "postal_code": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "running",
                    "succeeded",
                    "failed",
                    "reused"
                  ]
                },
                "quality_status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "status"
              ],
              "additionalProperties": false
            }
          },
          "units": {
            "type": "object",
            "properties": {
              "held": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "captured": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "released": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "held",
              "captured",
              "released"
            ],
            "additionalProperties": false
          },
          "report": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "version": {
                "type": "number",
                "const": 1
              },
              "json_url": {
                "type": "string"
              },
              "pdf_url": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "version",
              "json_url",
              "pdf_url"
            ],
            "additionalProperties": false
          },
          "failure": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              }
            },
            "required": [
              "code"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "operation_id",
          "status",
          "children",
          "units"
        ],
        "additionalProperties": false
      },
      "Cancellation": {
        "type": "object",
        "properties": {
          "operation_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "partially_succeeded",
              "failed",
              "cancelled",
              "expired"
            ]
          }
        },
        "required": [
          "operation_id",
          "status"
        ],
        "additionalProperties": false
      },
      "Receipt": {
        "type": "object",
        "properties": {
          "report_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "state": {
            "type": "string",
            "const": "acknowledged"
          },
          "acknowledged_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "report_id",
          "version",
          "state",
          "acknowledged_at"
        ],
        "additionalProperties": false
      },
      "ApprovalDecision": {
        "type": "object",
        "properties": {
          "csrf": {
            "type": "string",
            "pattern": "^[\\w-]{43}$"
          },
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "deny"
            ]
          }
        },
        "required": [
          "csrf",
          "decision"
        ],
        "additionalProperties": false
      },
      "ResearchSubmission": {
        "type": "object",
        "properties": {
          "quote_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "approval_grant": {
            "type": "string",
            "pattern": "^[\\w-]{43}$"
          }
        },
        "required": [
          "quote_id",
          "approval_grant"
        ],
        "additionalProperties": false
      },
      "DeliveryAcknowledgement": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "destination_id": {
            "type": "string",
            "maxLength": 100
          },
          "grant_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "receipt_reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "version",
          "destination_id",
          "grant_id",
          "receipt_reference"
        ],
        "additionalProperties": false
      },
      "Report": {
        "type": "object",
        "properties": {
          "report_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "version": {
            "type": "number",
            "const": 1
          },
          "business_type": {
            "type": "string",
            "maxLength": 100
          },
          "kind": {
            "type": "string",
            "enum": [
              "single_location_intelligence",
              "location_comparison"
            ]
          },
          "locations": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "maxLength": 250
                },
                "country_code": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 2
                },
                "postal_code": {
                  "type": "string",
                  "maxLength": 20
                },
                "facts": {
                  "type": "object",
                  "properties": {
                    "population": {
                      "type": "number",
                      "minimum": 0
                    },
                    "population_density": {
                      "type": "number",
                      "minimum": 0
                    },
                    "median_household_income": {
                      "type": "number",
                      "minimum": 0
                    },
                    "age_distribution": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "pattern": "^(?:\\d{1,2}[–-]\\d{1,2}|\\d{1,2}\\+)$"
                      },
                      "additionalProperties": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "working_population": {
                      "type": "object",
                      "properties": {
                        "employed_residents": {
                          "type": "number",
                          "minimum": 0
                        },
                        "professional_residents": {
                          "type": "number",
                          "minimum": 0
                        },
                        "professional_share": {
                          "type": "number",
                          "minimum": 0
                        },
                        "year": {
                          "type": "string",
                          "maxLength": 40
                        }
                      },
                      "required": [
                        "employed_residents",
                        "professional_residents",
                        "year"
                      ],
                      "additionalProperties": false
                    },
                    "total_transport_stops": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                },
                "assessment": {
                  "type": "object",
                  "properties": {
                    "summary": {
                      "type": "string",
                      "maxLength": 12000
                    },
                    "location_score": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 10
                    },
                    "opportunities": {
                      "maxItems": 30,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 2000
                      }
                    },
                    "challenges": {
                      "maxItems": 30,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 2000
                      }
                    }
                  },
                  "required": [
                    "summary",
                    "opportunities",
                    "challenges"
                  ],
                  "additionalProperties": false
                },
                "market_landscape": {
                  "maxItems": 500,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "maxLength": 300
                      },
                      "rank": {
                        "type": "number",
                        "minimum": 0
                      },
                      "rating": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 5
                      },
                      "review_count": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "additionalProperties": false
                  }
                },
                "quality": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "useful",
                        "partial_useful"
                      ]
                    },
                    "missing_sections": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 100
                      }
                    }
                  },
                  "required": [
                    "status",
                    "missing_sections"
                  ],
                  "additionalProperties": false
                },
                "source_period": {
                  "type": "string",
                  "maxLength": 200
                },
                "attribution": {
                  "type": "string",
                  "maxLength": 3000
                },
                "data_mode": {
                  "type": "string",
                  "enum": [
                    "synthetic_local_fixture",
                    "reviewed_snapshot"
                  ]
                }
              },
              "required": [
                "label",
                "country_code",
                "postal_code",
                "facts",
                "market_landscape",
                "quality",
                "source_period",
                "attribution",
                "data_mode"
              ],
              "additionalProperties": false
            }
          },
          "unavailable_locations": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "postal_code": {
                  "type": "string",
                  "maxLength": 20
                },
                "reason": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "postal_code",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "ranking": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "withheld"
              },
              "reason": {
                "type": "string",
                "maxLength": 2000
              }
            },
            "required": [
              "status",
              "reason"
            ],
            "additionalProperties": false
          },
          "next_steps": {
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "locus_url": {
            "type": "string",
            "maxLength": 2000,
            "format": "uri"
          },
          "data_mode": {
            "type": "string",
            "enum": [
              "synthetic_local_fixture",
              "reviewed_snapshot"
            ]
          }
        },
        "required": [
          "report_id",
          "version",
          "business_type",
          "kind",
          "locations",
          "unavailable_locations",
          "ranking",
          "next_steps",
          "locus_url",
          "data_mode"
        ],
        "additionalProperties": false
      },
      "ReportResponse": {
        "type": "object",
        "properties": {
          "report_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "version": {
            "type": "number",
            "const": 1
          },
          "business_type": {
            "type": "string",
            "maxLength": 100
          },
          "kind": {
            "type": "string",
            "enum": [
              "single_location_intelligence",
              "location_comparison"
            ]
          },
          "locations": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "maxLength": 250
                },
                "country_code": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 2
                },
                "postal_code": {
                  "type": "string",
                  "maxLength": 20
                },
                "facts": {
                  "type": "object",
                  "properties": {
                    "population": {
                      "type": "number",
                      "minimum": 0
                    },
                    "population_density": {
                      "type": "number",
                      "minimum": 0
                    },
                    "median_household_income": {
                      "type": "number",
                      "minimum": 0
                    },
                    "age_distribution": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "pattern": "^(?:\\d{1,2}[–-]\\d{1,2}|\\d{1,2}\\+)$"
                      },
                      "additionalProperties": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "working_population": {
                      "type": "object",
                      "properties": {
                        "employed_residents": {
                          "type": "number",
                          "minimum": 0
                        },
                        "professional_residents": {
                          "type": "number",
                          "minimum": 0
                        },
                        "professional_share": {
                          "type": "number",
                          "minimum": 0
                        },
                        "year": {
                          "type": "string",
                          "maxLength": 40
                        }
                      },
                      "required": [
                        "employed_residents",
                        "professional_residents",
                        "year"
                      ],
                      "additionalProperties": false
                    },
                    "total_transport_stops": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                },
                "assessment": {
                  "type": "object",
                  "properties": {
                    "summary": {
                      "type": "string",
                      "maxLength": 12000
                    },
                    "location_score": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 10
                    },
                    "opportunities": {
                      "maxItems": 30,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 2000
                      }
                    },
                    "challenges": {
                      "maxItems": 30,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 2000
                      }
                    }
                  },
                  "required": [
                    "summary",
                    "opportunities",
                    "challenges"
                  ],
                  "additionalProperties": false
                },
                "market_landscape": {
                  "maxItems": 500,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "maxLength": 300
                      },
                      "rank": {
                        "type": "number",
                        "minimum": 0
                      },
                      "rating": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 5
                      },
                      "review_count": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "additionalProperties": false
                  }
                },
                "quality": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "useful",
                        "partial_useful"
                      ]
                    },
                    "missing_sections": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 100
                      }
                    }
                  },
                  "required": [
                    "status",
                    "missing_sections"
                  ],
                  "additionalProperties": false
                },
                "source_period": {
                  "type": "string",
                  "maxLength": 200
                },
                "attribution": {
                  "type": "string",
                  "maxLength": 3000
                },
                "data_mode": {
                  "type": "string",
                  "enum": [
                    "synthetic_local_fixture",
                    "reviewed_snapshot"
                  ]
                }
              },
              "required": [
                "label",
                "country_code",
                "postal_code",
                "facts",
                "market_landscape",
                "quality",
                "source_period",
                "attribution",
                "data_mode"
              ],
              "additionalProperties": false
            }
          },
          "unavailable_locations": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "postal_code": {
                  "type": "string",
                  "maxLength": 20
                },
                "reason": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "postal_code",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "ranking": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "withheld"
              },
              "reason": {
                "type": "string",
                "maxLength": 2000
              }
            },
            "required": [
              "status",
              "reason"
            ],
            "additionalProperties": false
          },
          "next_steps": {
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "locus_url": {
            "type": "string",
            "maxLength": 2000,
            "format": "uri"
          },
          "data_mode": {
            "type": "string",
            "enum": [
              "synthetic_local_fixture",
              "reviewed_snapshot"
            ]
          },
          "checksum": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "delivery": {
            "type": "object",
            "properties": {
              "grant_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "destination_id": {
                "type": "string",
                "maxLength": 100
              },
              "version": {
                "type": "number",
                "const": 1
              },
              "state": {
                "type": "string",
                "enum": [
                  "retrieved",
                  "acknowledged"
                ]
              }
            },
            "required": [
              "grant_id",
              "destination_id",
              "version",
              "state"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "report_id",
          "version",
          "business_type",
          "kind",
          "locations",
          "unavailable_locations",
          "ranking",
          "next_steps",
          "locus_url",
          "data_mode",
          "checksum",
          "delivery"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "customerSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "locus-next-auth.session-token",
        "description": "Browser-managed Locus session; never obtain or forward customer cookies from a partner backend. Same-origin CSRF also required for decisions."
      },
      "partnerClient": {
        "type": "http",
        "scheme": "basic"
      },
      "partnerConnection": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://locus.example.invalid/api/v1/oauth/authorize",
            "tokenUrl": "https://locus.example.invalid/api/v1/oauth/token",
            "scopes": {
              "coverage:read": "Read availability metadata.",
              "research:quote": "Customer and exact request/destination approval remain required.",
              "research:execute": "Customer and exact request/destination approval remain required.",
              "research:read": "Customer and exact request/destination approval remain required.",
              "reports:read": "Customer and exact request/destination approval remain required.",
              "reports:pdf": "Customer and exact request/destination approval remain required."
            }
          }
        }
      }
    }
  }
}
