{
  "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
                }
              }
            }
          }
        }
      }
    }
  },
  "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": {
        "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
      },
      "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": {
          "status": {
            "type": "string",
            "const": "unavailable"
          },
          "reason": {
            "type": "string",
            "const": "PARTNER_RESEARCH_NOT_ENABLED"
          },
          "channels": {
            "type": "object",
            "properties": {
              "app": {
                "type": "string",
                "const": "not_evaluated"
              },
              "partner_report": {
                "type": "string",
                "const": "not_approved"
              },
              "raw_data": {
                "type": "string",
                "const": "not_approved"
              }
            },
            "required": [
              "app",
              "partner_report",
              "raw_data"
            ],
            "additionalProperties": false
          },
          "footprint": {
            "type": "array",
            "items": {
              "not": {}
            }
          },
          "source_periods": {
            "type": "array",
            "items": {
              "not": {}
            }
          },
          "research_available": {
            "type": "boolean",
            "const": false
          },
          "units_reserved": {
            "type": "number",
            "const": 0
          },
          "required_inputs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "missing_sections": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "status",
          "reason",
          "channels",
          "footprint",
          "source_periods",
          "research_available",
          "units_reserved",
          "required_inputs",
          "missing_sections"
        ],
        "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
      }
    },
    "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."
            }
          }
        }
      }
    }
  }
}
