{
  "openapi": "3.1.0",
  "info": {
    "title": "Normatia API",
    "version": "1.0.0",
    "description": "API de normativa de edificación española: el catálogo normativo, la normativa que aplica a cada territorio, el contexto de tus proyectos y consultas en lenguaje natural con sus fuentes. La documentación completa está en https://docs.normatia.com.",
    "contact": {
      "name": "Normatia",
      "email": "hola@normatia.com",
      "url": "https://docs.normatia.com"
    }
  },
  "paths": {
    "/api/v1/codes/search": {
      "get": {
        "tags": [
          "Normativa (anterior)"
        ],
        "summary": "Buscar normativas",
        "description": "Búsqueda paginada de colecciones normativas por título, ámbito o etiqueta. Devuelve las normativas coincidentes con metadatos de paginación.",
        "operationId": "searchCodes",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Búsqueda parcial por título",
              "title": "Q"
            },
            "description": "Búsqueda parcial por título"
          },
          {
            "name": "normative_scope",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filtra por ámbito: national | regional | municipal",
              "title": "Normative Scope"
            },
            "description": "Filtra por ámbito: national | regional | municipal"
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filtra por etiqueta",
              "title": "Tag"
            },
            "description": "Filtra por etiqueta"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Número de página (base 1)",
              "default": 1,
              "title": "Page"
            },
            "description": "Número de página (base 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "description": "Resultados por página (máximo 50)",
              "default": 20,
              "title": "Page Size"
            },
            "description": "Resultados por página (máximo 50)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCodesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/codes/{slug}": {
      "get": {
        "tags": [
          "Normativa (anterior)"
        ],
        "summary": "Detalle de normativa",
        "description": "Devuelve el detalle completo de una colección normativa, incluyendo todas sus versiones de documento. Usa los slugs de versión de la respuesta para consultar versiones específicas.",
        "operationId": "getCode",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/codes/{slug}/latest": {
      "get": {
        "tags": [
          "Normativa (anterior)"
        ],
        "summary": "Versiones vigentes de una normativa",
        "description": "Devuelve todos los documentos con estado vigente de una normativa. Una normativa puede tener varios documentos activos simultáneamente (p.ej. norma principal y anejos). Devuelve un array vacío si no hay versiones vigentes.",
        "operationId": "getCodeLatest",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CodeVersionSummaryResponse"
                  },
                  "title": "Response Get Code Latest Api V1 Codes  Slug  Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/codes/{slug}/{version}": {
      "get": {
        "tags": [
          "Normativa (anterior)"
        ],
        "summary": "Detalle de una versión concreta",
        "description": "Devuelve el detalle completo de una versión específica de una normativa, incluyendo su índice de secciones. Permite conocer la estructura de la regulación antes de realizar una consulta.",
        "operationId": "getCodeVersion",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodeVersionDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/location/search": {
      "get": {
        "tags": [
          "Territorio (anterior)"
        ],
        "summary": "Buscar localización",
        "description": "Busca en todos los niveles geográficos (país, comunidad autónoma, provincia, municipio) por nombre. La búsqueda es insensible a mayúsculas y tildes. Devuelve un máximo de 50 resultados.",
        "operationId": "searchLocations",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Texto de búsqueda (insensible a mayúsculas y tildes)",
              "title": "Q"
            },
            "description": "Texto de búsqueda (insensible a mayúsculas y tildes)"
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filtra por nivel: country | region | province | municipality",
              "title": "Level"
            },
            "description": "Filtra por nivel: country | region | province | municipality"
          },
          {
            "name": "ancestor_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filtra por ID de geografía ancestro (ej. 'ES-41' para la provincia de Sevilla)",
              "title": "Ancestor Id"
            },
            "description": "Filtra por ID de geografía ancestro (ej. 'ES-41' para la provincia de Sevilla)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/location/{geo_id}": {
      "get": {
        "tags": [
          "Territorio (anterior)"
        ],
        "summary": "Detalle de localización",
        "description": "Devuelve el detalle completo de una geografía: ancestros resueltos, tech_data (zona climática, nieve, sísmica, etc.) y todas las normativas aplicables resueltas a través de la jerarquía territorial.",
        "operationId": "getLocation",
        "parameters": [
          {
            "name": "geo_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Geo Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/project/info": {
      "get": {
        "tags": [
          "Proyectos"
        ],
        "summary": "Información de un proyecto",
        "description": "Devuelve el contexto completo de un proyecto: ubicación geográfica, datos técnicos del territorio (zona climática, viento, nieve, sísmica...), descripción del proyecto, normativas aplicables y archivos subidos. Sin `project_id` responde sobre el proyecto activo del usuario.",
        "operationId": "getProjectInfo",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Proyecto concreto sobre el que informar. Si se omite se usa el proyecto activo del usuario.",
              "title": "Project Id"
            },
            "description": "Proyecto concreto sobre el que informar. Si se omite se usa el proyecto activo del usuario."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectInfoResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects": {
      "get": {
        "tags": [
          "Proyectos"
        ],
        "summary": "Proyectos accesibles del usuario",
        "description": "Lista los proyectos a los que el usuario tiene acceso, con su ubicación y cuál está marcado como activo. Sirve para obtener el `project_id` que se pasa a `/api/v1/project/info` y a las consultas, y así trabajar sobre un proyecto concreto sin cambiar el activo en la web.",
        "operationId": "listProjects",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verify": {
      "post": {
        "tags": [
          "Comprobaciones"
        ],
        "summary": "Verificar cumplimiento normativo",
        "description": "Comprueba si un parámetro técnico concreto de un elemento constructivo cumple con los límites normativos aplicables. El motor RAG recupera las secciones normativas relevantes y devuelve un resultado estructurado con el valor límite, las condiciones de aplicación y las fuentes trazables.",
        "operationId": "verify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/ask": {
      "post": {
        "tags": [
          "Consultas"
        ],
        "summary": "Consulta agéntica en lenguaje natural",
        "description": "Ejecuta el motor agéntico de Normatia sobre un proyecto: el modelo decide qué buscar en la normativa aplicable, consulta la memoria y los cálculos guardados del proyecto y responde citando las fuentes con marcadores `[N]`.\n\nSin `project_id` usa el proyecto activo del usuario; con él, cualquier proyecto al que tenga acceso, sin necesidad de cambiar el activo. Consume 1 crédito.",
        "operationId": "askV2",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskV2Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskV2Response"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/coverage": {
      "get": {
        "tags": [
          "Capas y cobertura"
        ],
        "summary": "Qué hay cargado en un municipio",
        "description": "Para un municipio: si están cargados el Catastro (parcelas, edificios, inmuebles y direcciones), las fuentes de planeamiento y cada capa de afección, completa, parcial o sin datos. Una capa sin datos sale `no_data` en las parcelas de ese municipio: no quiere decir que no las afecte.",
        "operationId": "getCoverage",
        "parameters": [
          {
            "name": "place",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "El municipio: `ES-` y su código INE (ES-41091), o el código INE",
              "title": "Place"
            },
            "description": "El municipio: `ES-` y su código INE (ES-41091), o el código INE"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Coverage"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/keys": {
      "get": {
        "tags": [
          "Cuenta"
        ],
        "summary": "Tus claves en esta organización",
        "description": "Las claves del usuario de la clave en su organización, activas y revocadas, sin la clave completa (Normatia solo guarda su huella). Las de otros miembros no aparecen.",
        "operationId": "listKeys",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/keys/{key_id}": {
      "delete": {
        "tags": [
          "Cuenta"
        ],
        "summary": "Revocar una clave",
        "description": "Revoca una clave del usuario en esta organización, también la que hace la petición. Deja de funcionar en menos de un minuto en todas las rutas y en el servidor MCP. No se puede deshacer: para seguir, crea otra en Mi cuenta > Claves API. Una clave de prueba o con permisos limitados solo puede revocarse a sí misma.",
        "operationId": "revokeKey",
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/layers": {
      "get": {
        "tags": [
          "Capas y cobertura"
        ],
        "summary": "Las capas de afección",
        "description": "Todas las capas que se cruzan con una parcela en `constraints`: su nombre, su tema, si se mira por intersección o por distancia, si es contexto, y sus fuentes con su licencia y atribución.",
        "operationId": "listLayers",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LayerList"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Cuenta"
        ],
        "summary": "La clave, su organización y sus límites",
        "description": "Comprueba que la clave funciona y devuelve de qué organización es, qué tiene activado (API y MCP), sus límites por minuto y cuántas consultas le quedan este mes.",
        "operationId": "getMe",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/parcels": {
      "get": {
        "tags": [
          "Parcelas"
        ],
        "summary": "Las parcelas de un punto",
        "description": "La parcela que contiene el punto (latitud y longitud WGS84) o, si no cae en ninguna, las que están a menos de 50 m, de la más cercana a la más lejana. Una lista vacía: no hay ninguna parcela cerca (el mar, una plaza grande) o es un territorio que no está en la base.",
        "operationId": "findParcelsAtPoint",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "maximum": 90,
              "minimum": -90,
              "description": "Latitud WGS84",
              "title": "Lat"
            },
            "description": "Latitud WGS84"
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "maximum": 180,
              "minimum": -180,
              "description": "Longitud WGS84",
              "title": "Lon"
            },
            "description": "Longitud WGS84"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ParcelsAtPoint"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/parcels/{ref}": {
      "get": {
        "tags": [
          "Parcelas"
        ],
        "summary": "Una parcela por su referencia catastral",
        "description": "La parcela de esa referencia catastral (14 caracteres, o los 20 de un inmueble), de la base territorial de Normatia: municipio, clase catastral, superficie, centroide, recuadro y portales. Con `include`, en la misma llamada: `constraints` (cada capa de afección: afectada, no afectada o sin dato), `zoning` (clase de suelo, zona con sus parámetros y ámbitos), `buildings` (lo edificado), `units` (los inmuebles) y `geometry` (el polígono en GeoJSON). Lo que no está cargado en su municipio sale null o sin dato, nunca como «no afectada».",
        "operationId": "getParcel",
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 14,
              "maxLength": 24,
              "description": "Referencia catastral: 14 caracteres (o 20)",
              "title": "Ref"
            },
            "description": "Referencia catastral: 14 caracteres (o 20)"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Bloques que añadir, separados por comas: constraints, zoning, buildings, units, geometry",
              "examples": [
                "constraints,zoning"
              ],
              "title": "Include"
            },
            "description": "Bloques que añadir, separados por comas: constraints, zoning, buildings, units, geometry"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Parcel"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/places": {
      "get": {
        "tags": [
          "Municipios"
        ],
        "summary": "Buscar un municipio",
        "description": "Municipios, provincias y comunidades por su nombre, sin distinguir mayúsculas ni tildes, o por el código INE. Primero los que se llaman exactamente así; entre los municipios, los más poblados.",
        "operationId": "listPlaces",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "El nombre o el código INE",
              "title": "Q"
            },
            "description": "El nombre o el código INE"
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "region",
                    "province",
                    "municipality"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Level"
            }
          },
          {
            "name": "within",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Solo los que están dentro de ese lugar (ES-41, ES-C01)",
              "title": "Within"
            },
            "description": "Solo los que están dentro de ese lugar (ES-41, ES-C01)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "default": 10,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceList"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/places/{place}": {
      "get": {
        "tags": [
          "Municipios"
        ],
        "summary": "Un municipio y sus datos técnicos",
        "description": "El lugar con su provincia y su comunidad. En un municipio, además, su ubicación y sus datos técnicos (zona climática, sismicidad, nieve, viento, pluviometría, radón, rayo...), cada uno con la norma de donde sale, y cuántas normas le aplican, de la estatal a la municipal.",
        "operationId": "getPlace",
        "parameters": [
          {
            "name": "place",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Place"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceDetail"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/regulations": {
      "get": {
        "tags": [
          "Normativa"
        ],
        "summary": "El catálogo normativo",
        "description": "Las normas, con su versión vigente. Se filtra por texto en el título (`q`), por ámbito (`scope`), por etiqueta (`tag`), por lugar (`place`: las que aplican a ese municipio, de la estatal a la municipal) y por si el texto de la vigente está curado a mano (`curated`). Paginado por cursor.",
        "operationId": "listRegulations",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "description": "Texto en el título",
              "title": "Q"
            },
            "description": "Texto en el título"
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "national",
                    "regional",
                    "municipal"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Scope"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tag"
            }
          },
          {
            "name": "place",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "`ES-` y el código INE: las normas que aplican allí",
              "title": "Place"
            },
            "description": "`ES-` y el código INE: las normas que aplican allí"
          },
          {
            "name": "curated",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "true: solo las de texto curado a mano. false: las de texto automático o sin texto",
              "title": "Curated"
            },
            "description": "true: solo las de texto curado a mano. false: las de texto automático o sin texto"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegulationList"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/regulations/{slug}": {
      "get": {
        "tags": [
          "Normativa"
        ],
        "summary": "Una norma y sus versiones",
        "operationId": "getRegulation",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegulationDetail"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/regulations/{slug}/contents": {
      "get": {
        "tags": [
          "Normativa"
        ],
        "summary": "El índice de una versión",
        "description": "Las secciones de la versión pedida (`version`) o de la vigente. Una versión sin texto (`has_text: false`) da un índice vacío y el enlace a su documento original.",
        "operationId": "getRegulationContents",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "El slug de la versión; sin él, la vigente",
              "title": "Version"
            },
            "description": "El slug de la versión; sin él, la vigente"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contents"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/regulations/{slug}/sections/{section}": {
      "get": {
        "tags": [
          "Normativa"
        ],
        "summary": "El texto de una sección",
        "description": "Los bloques de una sección (artículos, apartados, tablas), en su orden y con su jerarquía, de la versión pedida o de la vigente. El texto va en plano; con `format=html`, también con su formato.",
        "operationId": "getRegulationSection",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "section",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Section"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "El slug de la versión; sin él, la vigente",
              "title": "Version"
            },
            "description": "El slug de la versión; sin él, la vigente"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "text",
                "html"
              ],
              "type": "string",
              "default": "text",
              "title": "Format"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Section"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sandbox": {
      "get": {
        "tags": [
          "Entorno de pruebas"
        ],
        "summary": "Lo que hay en el entorno de pruebas",
        "description": "Las parcelas que responde una clave de prueba (sk-normatia-test-), con el caso que cubre cada una. Sirve con cualquier clave.",
        "operationId": "getSandbox",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxInfo"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "Cuenta"
        ],
        "summary": "Consumo de la organización",
        "description": "Las llamadas y los créditos de la organización de la clave entre dos fechas (en UTC, ambas incluidas), por ruta y por día, con la parte de esta clave y el cupo que queda. Por defecto, el mes en curso. Como mucho, 92 días por petición.",
        "operationId": "getUsage",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Primer día, AAAA-MM-DD. Por defecto, el 1 del mes.",
              "title": "From"
            },
            "description": "Primer día, AAAA-MM-DD. Por defecto, el 1 del mes."
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Último día, AAAA-MM-DD. Por defecto, hoy.",
              "title": "To"
            },
            "description": "Último día, AAAA-MM-DD. Por defecto, hoy."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Datos no válidos.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "Falta la clave, no es válida o está revocada.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "La organización de la clave no tiene activada la API, o la clave no tiene el permiso de la ruta (insufficient_scope).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Límite por minuto superado (con Retry-After) o cupo del mes agotado.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "500": {
            "description": "Error interno. Indica el X-Request-Id si escribes a soporte.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Address": {
        "properties": {
          "street": {
            "type": "string",
            "title": "Street",
            "description": "Como la escribe el Catastro: «PS NUESTRA SEÑORA DE LA O»"
          },
          "number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Number"
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Postal Code"
          }
        },
        "type": "object",
        "required": [
          "street"
        ],
        "title": "Address"
      },
      "AncestorDetail": {
        "properties": {
          "geo_id": {
            "type": "string",
            "title": "Geo Id",
            "description": "Identificador geográfico del ancestro"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Nombre del ancestro"
          },
          "level": {
            "type": "string",
            "title": "Level",
            "description": "Nivel geográfico: country | region | province"
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "name",
          "level"
        ],
        "title": "AncestorDetail"
      },
      "ApplicableCode": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Slug identificador de la normativa aplicable"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Título completo de la normativa"
          },
          "normative_scope": {
            "type": "string",
            "title": "Normative Scope",
            "description": "Ámbito normativo: national | regional | municipal"
          },
          "match_reason": {
            "type": "string",
            "title": "Match Reason",
            "description": "Motivo por el que aplica: direct (directa) | inherited (heredada del ancestro)"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "normative_scope",
          "match_reason"
        ],
        "title": "ApplicableCode"
      },
      "AskV2Project": {
        "properties": {
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "geo_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geo Id"
          },
          "location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location"
          }
        },
        "type": "object",
        "required": [
          "project_id"
        ],
        "title": "AskV2Project",
        "description": "Proyecto contra el que se resolvió la consulta"
      },
      "AskV2Request": {
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Query",
            "description": "Pregunta en lenguaje natural"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project Id",
            "description": "Proyecto sobre el que consultar. Si se omite se usa el proyecto activo del usuario."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "query"
        ],
        "title": "AskV2Request",
        "description": "Request de la consulta agéntica (POST /api/v2/ask)"
      },
      "AskV2Response": {
        "properties": {
          "answer": {
            "type": "string",
            "title": "Answer"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/AskV2Source"
            },
            "type": "array",
            "title": "Sources",
            "default": []
          },
          "project": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AskV2Project"
              },
              {
                "type": "null"
              }
            ]
          },
          "iterations": {
            "type": "integer",
            "title": "Iterations",
            "default": 0
          },
          "searches": {
            "type": "integer",
            "title": "Searches",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "answer"
        ],
        "title": "AskV2Response",
        "description": "Respuesta de la consulta agéntica"
      },
      "AskV2Source": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index",
            "description": "Número de la fuente, el N de las citas [N]"
          },
          "citation_type": {
            "type": "string",
            "title": "Citation Type",
            "description": "article, document, collection o user_document",
            "default": ""
          },
          "document_title": {
            "type": "string",
            "title": "Document Title",
            "default": ""
          },
          "section_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Section Title"
          },
          "block_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Block Title"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "url_valid": {
            "type": "boolean",
            "title": "Url Valid",
            "default": true
          },
          "block_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Block Id"
          }
        },
        "type": "object",
        "required": [
          "index"
        ],
        "title": "AskV2Source",
        "description": "Fuente citada en una respuesta agéntica.\n\nEs la misma información que `CitationSource` del chat web, en snake_case para\nmantener la convención del resto de la API pública."
      },
      "Block": {
        "properties": {
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug",
            "description": "Su identificador en la sección (`articulo-12`), si lo tiene"
          },
          "parent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent",
            "description": "El slug del bloque que lo contiene"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "article, paragraph, list, table... como en la base"
          },
          "level": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Level"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text",
            "description": "El texto plano"
          },
          "html": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Html",
            "description": "El texto con su formato (tablas, listas), si se pide format=html"
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "Block"
      },
      "Buildings": {
        "properties": {
          "built": {
            "type": "boolean",
            "title": "Built",
            "description": "false: el Catastro está cargado y no hay nada edificado"
          },
          "condition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Condition",
            "description": "funcional | deteriorado | ruina"
          },
          "year_built": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year Built"
          },
          "built_area_m2": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Built Area M2"
          },
          "dwellings": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dwellings"
          },
          "units": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Units",
            "description": "Inmuebles catastrales"
          },
          "floors_above": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Floors Above"
          },
          "floors_below": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Floors Below"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "default": "Dirección General del Catastro (INSPIRE, edificios)"
          }
        },
        "type": "object",
        "required": [
          "built"
        ],
        "title": "Buildings"
      },
      "ClimateZone": {
        "properties": {
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value",
            "description": "α1 a E1: la letra de invierno y el número de verano"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "type": "object",
        "required": [
          "source"
        ],
        "title": "ClimateZone"
      },
      "CodeDetailResponse": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Slug identificador único de la normativa"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Título completo de la normativa"
          },
          "short_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Title",
            "description": "Título corto para presentación"
          },
          "normative_scope": {
            "type": "string",
            "title": "Normative Scope",
            "description": "Ámbito normativo: national | regional | municipal"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Descripción de la normativa"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Etiquetas de categorización"
          },
          "country_code": {
            "type": "string",
            "title": "Country Code",
            "description": "Código de país ISO 3166-1 alpha-2",
            "default": "es"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/CodeVersion"
            },
            "type": "array",
            "title": "Documents",
            "description": "Todas las versiones de documentos de esta normativa"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "normative_scope"
        ],
        "title": "CodeDetailResponse"
      },
      "CodeFilter": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Slug de la normativa (p.ej. 'cte-db-he')"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Versión concreta del documento (p.ej. '2022'). Si se omite, se usan todos los documentos activos"
          }
        },
        "type": "object",
        "required": [
          "slug"
        ],
        "title": "CodeFilter",
        "description": "Filtro de normativa por slug de colección (con versión opcional)"
      },
      "CodeLabel": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "label": {
            "type": "string",
            "title": "Label"
          }
        },
        "type": "object",
        "required": [
          "code",
          "label"
        ],
        "title": "CodeLabel"
      },
      "CodeSection": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Slug de la sección (usado como ancla en la interfaz web)"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Título de la sección"
          },
          "order": {
            "type": "integer",
            "title": "Order",
            "description": "Orden de presentación"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "order"
        ],
        "title": "CodeSection"
      },
      "CodeSummary": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Slug identificador único de la normativa"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Título completo de la normativa"
          },
          "short_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Title",
            "description": "Título corto para presentación"
          },
          "normative_scope": {
            "type": "string",
            "title": "Normative Scope",
            "description": "Ámbito normativo: national | regional | municipal"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Etiquetas de categorización"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "normative_scope"
        ],
        "title": "CodeSummary"
      },
      "CodeVersion": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version",
            "description": "Slug del documento usado como identificador de versión"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Título de esta versión"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Estado del documento: active | repealed | draft | in_progress"
          },
          "published_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published Date",
            "description": "Fecha de publicación (YYYY-MM-DD)"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date",
            "description": "Fecha de entrada en vigor (YYYY-MM-DD)"
          },
          "is_internal": {
            "type": "boolean",
            "title": "Is Internal",
            "description": "True si el contenido está alojado en Normatia y disponible para consulta RAG",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "version",
          "title",
          "status"
        ],
        "title": "CodeVersion"
      },
      "CodeVersionDetailResponse": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Slug de la colección (normativa padre)"
          },
          "version": {
            "type": "string",
            "title": "Version",
            "description": "Slug del documento (versión)"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Título de esta versión"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Estado del documento: active | repealed | draft | in_progress"
          },
          "published_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published Date",
            "description": "Fecha de publicación (YYYY-MM-DD)"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date",
            "description": "Fecha de entrada en vigor (YYYY-MM-DD)"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Descripción de esta versión"
          },
          "author": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author",
            "description": "Organismo emisor o autor"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url",
            "description": "URL de la fuente oficial"
          },
          "is_internal": {
            "type": "boolean",
            "title": "Is Internal",
            "description": "True si el contenido está alojado en Normatia y disponible para consulta RAG",
            "default": false
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/CodeSection"
            },
            "type": "array",
            "title": "Sections",
            "description": "Índice de secciones ordenado"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "version",
          "title",
          "status"
        ],
        "title": "CodeVersionDetailResponse"
      },
      "CodeVersionSummaryResponse": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug",
            "description": "Slug de la colección (normativa padre)"
          },
          "version": {
            "type": "string",
            "title": "Version",
            "description": "Slug del documento (versión)"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Título de esta versión"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Estado del documento: active | repealed | draft | in_progress"
          },
          "published_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published Date",
            "description": "Fecha de publicación (YYYY-MM-DD)"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date",
            "description": "Fecha de entrada en vigor (YYYY-MM-DD)"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Descripción de esta versión"
          },
          "author": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author",
            "description": "Organismo emisor o autor"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url",
            "description": "URL de la fuente oficial"
          },
          "is_internal": {
            "type": "boolean",
            "title": "Is Internal",
            "description": "True si el contenido está alojado en Normatia y disponible para consulta RAG",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "slug",
          "version",
          "title",
          "status"
        ],
        "title": "CodeVersionSummaryResponse"
      },
      "ConstraintLayer": {
        "properties": {
          "layer": {
            "type": "string",
            "title": "Layer",
            "description": "El código de la capa: `carreteras`, `costas`, `dph`..."
          },
          "affected": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Affected",
            "description": "true afectada, false no afectada, null sin dato: null NUNCA quiere decir «no afectada»"
          },
          "status": {
            "type": "string",
            "enum": [
              "affected",
              "partially_affected",
              "context",
              "not_affected",
              "no_data"
            ],
            "title": "Status"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label",
            "description": "Afecta, Exige trámite, Riesgo técnico, A verificar o Informativa (contexto)"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary",
            "description": "El hecho en una frase, con sus magnitudes"
          },
          "distance_m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance M"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason",
            "description": "Por qué no hay dato (`no_coverage`) o por qué es dudoso"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "required": [
          "layer",
          "affected",
          "status"
        ],
        "title": "ConstraintLayer"
      },
      "Constraints": {
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/ConstraintsSummary"
          },
          "layers": {
            "items": {
              "$ref": "#/components/schemas/ConstraintLayer"
            },
            "type": "array",
            "title": "Layers"
          }
        },
        "type": "object",
        "required": [
          "summary",
          "layers"
        ],
        "title": "Constraints"
      },
      "ConstraintsSummary": {
        "properties": {
          "affected": {
            "type": "integer",
            "title": "Affected"
          },
          "context": {
            "type": "integer",
            "title": "Context"
          },
          "not_affected": {
            "type": "integer",
            "title": "Not Affected"
          },
          "no_data": {
            "type": "integer",
            "title": "No Data"
          }
        },
        "type": "object",
        "required": [
          "affected",
          "context",
          "not_affected",
          "no_data"
        ],
        "title": "ConstraintsSummary"
      },
      "Contents": {
        "properties": {
          "object": {
            "type": "string",
            "const": "contents",
            "title": "Object",
            "default": "contents"
          },
          "regulation": {
            "type": "string",
            "title": "Regulation"
          },
          "version": {
            "$ref": "#/components/schemas/VersionSummary"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "sections": {
            "items": {
              "$ref": "#/components/schemas/SectionSummary"
            },
            "type": "array",
            "title": "Sections"
          }
        },
        "type": "object",
        "required": [
          "regulation",
          "version",
          "sections"
        ],
        "title": "Contents"
      },
      "Coverage": {
        "properties": {
          "object": {
            "type": "string",
            "const": "coverage",
            "title": "Object",
            "default": "coverage"
          },
          "place": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Place"
          },
          "cadastre": {
            "additionalProperties": {
              "type": "string",
              "enum": [
                "complete",
                "partial",
                "no_data"
              ]
            },
            "type": "object",
            "title": "Cadastre",
            "description": "parcels, buildings, units y addresses"
          },
          "planning": {
            "items": {
              "$ref": "#/components/schemas/CoverageSource"
            },
            "type": "array",
            "title": "Planning",
            "description": "Las fuentes de planeamiento del municipio, las de contraste incluidas"
          },
          "layers": {
            "items": {
              "$ref": "#/components/schemas/LayerCoverage"
            },
            "type": "array",
            "title": "Layers"
          },
          "summary": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Summary"
          }
        },
        "type": "object",
        "required": [
          "place",
          "cadastre",
          "layers",
          "summary"
        ],
        "title": "Coverage"
      },
      "CoverageSource": {
        "properties": {
          "dataset": {
            "type": "string",
            "title": "Dataset"
          },
          "organization": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "La versión o fecha del dataset en la base"
          },
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "partial",
              "no_data"
            ],
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "dataset",
          "status"
        ],
        "title": "CoverageSource"
      },
      "DesignTemperatures": {
        "properties": {
          "winter_p99_c": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Winter P99 C",
            "description": "Temperatura exterior de cálculo en invierno, percentil 99"
          },
          "summer_p1_c": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summer P1 C",
            "description": "Temperatura exterior de cálculo en verano, percentil 1"
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Source"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "DesignTemperatures"
      },
      "Drainage": {
        "properties": {
          "zone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zone",
            "description": "A o B"
          },
          "isohyet": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Isohyet"
          },
          "intensity_mm_h": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intensity Mm H",
            "description": "Intensidad pluviométrica, en mm/h"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "type": "object",
        "required": [
          "source"
        ],
        "title": "Drainage"
      },
      "ErrorResponse": {
        "type": "object",
        "description": "Error de las rutas /api/v1 y /api/v2: el código va en `detail.error`.",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "type": "string",
                "example": "api_not_enabled"
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        }
      },
      "GeoContext": {
        "properties": {
          "geo_id": {
            "type": "string",
            "title": "Geo Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "climate_zone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Climate Zone"
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "name"
        ],
        "title": "GeoContext",
        "description": "Contexto geográfico incluido en la respuesta de verificación"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "KeyInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ],
            "title": "Mode",
            "description": "test: una clave de prueba, que solo responde con el entorno de pruebas.",
            "default": "live"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "El nombre que se le dio al crearla."
          },
          "hint": {
            "type": "string",
            "title": "Hint",
            "description": "Los últimos caracteres de la clave, para reconocerla."
          },
          "scopes": {
            "items": {
              "type": "string",
              "enum": [
                "data",
                "ask",
                "mcp"
              ]
            },
            "type": "array",
            "title": "Scopes",
            "description": "Lo que puede hacer la clave: data (parcelas, municipios, normativa y proyectos; no gasta), ask (consultas y comprobaciones; gastan cupo) y mcp (el servidor MCP). Una de prueba, solo data."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "hint",
          "created_at"
        ],
        "title": "KeyInfo"
      },
      "KeyListItem": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ],
            "title": "Mode",
            "default": "live"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "hint": {
            "type": "string",
            "title": "Hint",
            "description": "Los últimos caracteres de la clave."
          },
          "scopes": {
            "items": {
              "type": "string",
              "enum": [
                "data",
                "ask",
                "mcp"
              ]
            },
            "type": "array",
            "title": "Scopes",
            "description": "Lo que puede hacer la clave: data (parcelas, municipios, normativa y proyectos; no gasta), ask (consultas y comprobaciones; gastan cupo) y mcp (el servidor MCP). Una de prueba, solo data."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked"
            ],
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "current": {
            "type": "boolean",
            "title": "Current",
            "description": "Si es la clave con la que se hace esta petición."
          }
        },
        "type": "object",
        "required": [
          "id",
          "hint",
          "status",
          "created_at",
          "current"
        ],
        "title": "KeyListItem"
      },
      "KeyListResponse": {
        "properties": {
          "keys": {
            "items": {
              "$ref": "#/components/schemas/KeyListItem"
            },
            "type": "array",
            "title": "Keys"
          }
        },
        "type": "object",
        "required": [
          "keys"
        ],
        "title": "KeyListResponse"
      },
      "LandClass": {
        "properties": {
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          },
          "instrument": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instrument"
          },
          "label": {
            "type": "string",
            "title": "Label"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "LandClass"
      },
      "Layer": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code",
            "description": "El código de la capa, el mismo de `constraints.layers[].layer`"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Group",
            "description": "El tema del informe de afecciones: Agua, Medio natural..."
          },
          "mode": {
            "type": "string",
            "title": "Mode",
            "description": "intersects: si la parcela la toca; distance: a qué distancia está; raster"
          },
          "distance_m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance M",
            "description": "Hasta qué distancia se mira, si es por distancia"
          },
          "informative": {
            "type": "boolean",
            "title": "Informative",
            "description": "Contexto, no una afección"
          },
          "declared_coverage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Coverage"
          },
          "provinces_without_data": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Provinces Without Data"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/LayerSource"
            },
            "type": "array",
            "title": "Sources"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name",
          "mode",
          "informative",
          "sources"
        ],
        "title": "Layer"
      },
      "LayerCoverage": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "partial",
              "no_data"
            ],
            "title": "Status",
            "description": "complete: todos sus datasets cargados en el municipio; no_data: ninguno"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/CoverageSource"
            },
            "type": "array",
            "title": "Sources"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name",
          "status",
          "sources"
        ],
        "title": "LayerCoverage"
      },
      "LayerList": {
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/Layer"
            },
            "type": "array",
            "title": "Data"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "LayerList"
      },
      "LayerSource": {
        "properties": {
          "dataset": {
            "type": "string",
            "title": "Dataset"
          },
          "organization": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License"
          },
          "attribution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attribution"
          },
          "catalog_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Catalog Url"
          },
          "verified_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified At"
          }
        },
        "type": "object",
        "required": [
          "dataset"
        ],
        "title": "LayerSource"
      },
      "Lightning": {
        "properties": {
          "ground_flash_density": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ground Flash Density",
            "description": "Ng, impactos por km² y año"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "type": "object",
        "required": [
          "source"
        ],
        "title": "Lightning"
      },
      "Location": {
        "properties": {
          "latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latitude"
          },
          "longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Longitude"
          },
          "altitude_m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Altitude M",
            "description": "Metros sobre el nivel del mar"
          },
          "area_km2": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area Km2"
          },
          "population": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Population"
          }
        },
        "type": "object",
        "title": "Location"
      },
      "LocationDetailResponse": {
        "properties": {
          "geo_id": {
            "type": "string",
            "title": "Geo Id",
            "description": "Identificador geográfico semántico"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Nombre de la localización"
          },
          "level": {
            "type": "string",
            "title": "Level",
            "description": "Nivel geográfico: country | region | province | municipality"
          },
          "ancestors": {
            "items": {
              "$ref": "#/components/schemas/AncestorDetail"
            },
            "type": "array",
            "title": "Ancestors",
            "description": "Ancestros geográficos ordenados de país a padre inmediato"
          },
          "tech_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tech Data",
            "description": "Datos técnicos de la localización (p.ej. zona climática, carga de nieve, zona sísmica)"
          },
          "applicable_codes": {
            "items": {
              "$ref": "#/components/schemas/ApplicableCode"
            },
            "type": "array",
            "title": "Applicable Codes",
            "description": "Normativas aplicables a esta localización (propias + heredadas de ancestros)"
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "name",
          "level"
        ],
        "title": "LocationDetailResponse"
      },
      "LocationSearchResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/LocationSearchResult"
            },
            "type": "array",
            "title": "Results",
            "description": "Lista de localizaciones encontradas (máximo 50)"
          }
        },
        "type": "object",
        "required": [
          "results"
        ],
        "title": "LocationSearchResponse"
      },
      "LocationSearchResult": {
        "properties": {
          "geo_id": {
            "type": "string",
            "title": "Geo Id",
            "description": "Identificador geográfico semántico (p.ej. 'ES-41091')"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Nombre de la localización"
          },
          "level": {
            "type": "string",
            "title": "Level",
            "description": "Nivel geográfico: country | region | province | municipality"
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "name",
          "level"
        ],
        "title": "LocationSearchResult"
      },
      "MeResponse": {
        "properties": {
          "key": {
            "$ref": "#/components/schemas/KeyInfo"
          },
          "user": {
            "$ref": "#/components/schemas/UserInfo"
          },
          "organization": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrganizationInfo"
              },
              {
                "type": "null"
              }
            ],
            "description": "La organización de la clave. Null si el usuario ya no es miembro de ella."
          },
          "rate_limits": {
            "$ref": "#/components/schemas/RateLimits"
          },
          "quota": {
            "$ref": "#/components/schemas/Quota"
          }
        },
        "type": "object",
        "required": [
          "key",
          "user",
          "rate_limits",
          "quota"
        ],
        "title": "MeResponse"
      },
      "MonthlySeries": {
        "properties": {
          "monthly": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Monthly",
            "description": "12 valores, de enero a diciembre"
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Source"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "MonthlySeries"
      },
      "OrganizationInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "plan": {
            "type": "string",
            "title": "Plan"
          },
          "api_enabled": {
            "type": "boolean",
            "title": "Api Enabled"
          },
          "mcp_enabled": {
            "type": "boolean",
            "title": "Mcp Enabled"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "plan",
          "api_enabled",
          "mcp_enabled"
        ],
        "title": "OrganizationInfo"
      },
      "OtherZone": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "percent": {
            "type": "number",
            "title": "Percent"
          }
        },
        "type": "object",
        "required": [
          "code",
          "percent"
        ],
        "title": "OtherZone"
      },
      "PaginatedCodesResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CodeSummary"
            },
            "type": "array",
            "title": "Items",
            "description": "Normativas de esta página"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total de normativas que coinciden con el filtro"
          },
          "page": {
            "type": "integer",
            "title": "Page",
            "description": "Página actual (empieza en 1)"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "description": "Número de resultados por página"
          },
          "total_pages": {
            "type": "integer",
            "title": "Total Pages",
            "description": "Número total de páginas"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "total_pages"
        ],
        "title": "PaginatedCodesResponse"
      },
      "Parcel": {
        "properties": {
          "object": {
            "type": "string",
            "const": "parcel",
            "title": "Object",
            "default": "parcel"
          },
          "ref": {
            "type": "string",
            "title": "Ref",
            "description": "La referencia catastral de 14 caracteres"
          },
          "place": {
            "$ref": "#/components/schemas/src__api__v1__parcelas__Place"
          },
          "cadastral_class": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CodeLabel"
              },
              {
                "type": "null"
              }
            ]
          },
          "main_use": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Main Use",
            "description": "Uso principal de lo edificado (residencial, industrial...)"
          },
          "area_m2": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area M2",
            "description": "Superficie oficial del Catastro, o medida en su huso UTM"
          },
          "centroid": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Point"
              },
              {
                "type": "null"
              }
            ]
          },
          "bbox": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bbox",
            "description": "[oeste, sur, este, norte], en grados"
          },
          "addresses": {
            "items": {
              "$ref": "#/components/schemas/Address"
            },
            "type": "array",
            "title": "Addresses",
            "description": "Los portales, el más cercano a su punto primero"
          },
          "constraints": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Constraints"
              },
              {
                "type": "null"
              }
            ],
            "description": "Con include=constraints"
          },
          "zoning": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Zoning"
              },
              {
                "type": "null"
              }
            ],
            "description": "Con include=zoning. Vacío si el planeamiento de su municipio no está cargado"
          },
          "buildings": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Buildings"
              },
              {
                "type": "null"
              }
            ],
            "description": "Con include=buildings. null si el Catastro de edificios no está cargado en su municipio"
          },
          "units": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Units"
              },
              {
                "type": "null"
              }
            ],
            "description": "Con include=units. null si los datos del Catastro no están cargados en su municipio"
          },
          "geometry": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geometry",
            "description": "Con include=geometry: GeoJSON (MultiPolygon, WGS84)"
          },
          "disclaimer": {
            "type": "string",
            "title": "Disclaimer"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "place",
          "disclaimer"
        ],
        "title": "Parcel"
      },
      "ParcelAtPoint": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "contains_point": {
            "type": "boolean",
            "title": "Contains Point",
            "description": "true si el punto cae dentro de la parcela"
          },
          "distance_m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Distance M",
            "description": "Distancia del punto a la parcela, si no lo contiene"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "contains_point"
        ],
        "title": "ParcelAtPoint"
      },
      "ParcelsAtPoint": {
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/ParcelAtPoint"
            },
            "type": "array",
            "title": "Data"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ParcelsAtPoint"
      },
      "PlaceDetail": {
        "properties": {
          "object": {
            "type": "string",
            "const": "place",
            "title": "Object",
            "default": "place"
          },
          "geo_id": {
            "type": "string",
            "title": "Geo Id",
            "description": "ES-41091 (municipio), ES-41 (provincia), ES-C01 (comunidad) o ES"
          },
          "ine": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ine",
            "description": "El código INE del municipio o de la provincia"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Como lo escribe el INE: «Puerto de Santa María, El»"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Para enseñar, con el artículo delante: «El Puerto de Santa María»"
          },
          "level": {
            "type": "string",
            "enum": [
              "country",
              "region",
              "province",
              "municipality"
            ],
            "title": "Level"
          },
          "province": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaceRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "region": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaceRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "location": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Location"
              },
              {
                "type": "null"
              }
            ],
            "description": "Solo en los municipios"
          },
          "technical_data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TechnicalData"
              },
              {
                "type": "null"
              }
            ],
            "description": "Solo en los municipios"
          },
          "regulations": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Regulations",
            "description": "Cuántas normas aplican, por ámbito: national, regional y municipal"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Links"
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "name",
          "display_name",
          "level"
        ],
        "title": "PlaceDetail"
      },
      "PlaceList": {
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/src__api__v1__lugares__Place"
            },
            "type": "array",
            "title": "Data"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "description": "Hay más resultados que `limit`: afina la búsqueda"
          }
        },
        "type": "object",
        "required": [
          "data",
          "has_more"
        ],
        "title": "PlaceList"
      },
      "PlaceRef": {
        "properties": {
          "geo_id": {
            "type": "string",
            "title": "Geo Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "name"
        ],
        "title": "PlaceRef"
      },
      "PlanningArea": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "instrument": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instrument"
          },
          "percent": {
            "type": "number",
            "title": "Percent"
          }
        },
        "type": "object",
        "required": [
          "code",
          "percent"
        ],
        "title": "PlanningArea"
      },
      "Point": {
        "properties": {
          "lat": {
            "type": "number",
            "title": "Lat"
          },
          "lon": {
            "type": "number",
            "title": "Lon"
          }
        },
        "type": "object",
        "required": [
          "lat",
          "lon"
        ],
        "title": "Point"
      },
      "Problem": {
        "type": "object",
        "description": "Error en formato RFC 9457 (rutas /v1). `code` es lo que debe mirar un programa.",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "example": "https://docs.normatia.com/api-reference/errores/#api_not_enabled"
          },
          "title": {
            "type": "string",
            "example": "Sin acceso"
          },
          "status": {
            "type": "integer",
            "example": 403
          },
          "detail": {
            "type": "string",
            "example": "Tu organización no tiene activado el acceso por API."
          },
          "code": {
            "type": "string",
            "example": "api_not_enabled"
          },
          "request_id": {
            "type": "string",
            "example": "req_4f0c2a9e6b1d4c3e8a7f5b2d1e0c9a8b"
          }
        },
        "additionalProperties": true
      },
      "ProjectInfoCalculation": {
        "properties": {
          "calculation_id": {
            "type": "string",
            "title": "Calculation Id"
          },
          "calculator_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calculator Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "compliant": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compliant"
          }
        },
        "type": "object",
        "required": [
          "calculation_id"
        ],
        "title": "ProjectInfoCalculation",
        "description": "Cálculo que el usuario guardó con las calculadoras de Normatia"
      },
      "ProjectInfoCalculator": {
        "properties": {
          "calculator_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calculator Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "type": "object",
        "title": "ProjectInfoCalculator",
        "description": "Calculadora disponible en Normatia (la rellena el usuario, no el agente)"
      },
      "ProjectInfoCollection": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "scope": {
            "type": "string",
            "title": "Scope"
          },
          "scope_label": {
            "type": "string",
            "title": "Scope Label"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Versión vigente de la normativa. Es la única respuesta válida a qué edición se aplica: no debe deducirse de otra fuente."
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "scope",
          "scope_label"
        ],
        "title": "ProjectInfoCollection",
        "description": "Normativa aplicable al proyecto"
      },
      "ProjectInfoDocument": {
        "properties": {
          "titulo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Titulo"
          },
          "tipo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tipo"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "type": "object",
        "title": "ProjectInfoDocument",
        "description": "Documento generado por el asistente en el proyecto"
      },
      "ProjectInfoGeo": {
        "properties": {
          "geo_id": {
            "type": "string",
            "title": "Geo Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "level": {
            "type": "string",
            "title": "Level"
          },
          "ancestors": {
            "type": "string",
            "title": "Ancestors",
            "default": ""
          },
          "climate_zone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Climate Zone"
          },
          "tech_data_summary": {
            "type": "string",
            "title": "Tech Data Summary",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "name",
          "level"
        ],
        "title": "ProjectInfoGeo",
        "description": "Contexto geográfico resumido para get_project_info"
      },
      "ProjectInfoMemoryFact": {
        "properties": {
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "title": "ProjectInfoMemoryFact",
        "description": "Dato que el usuario aportó sobre su obra (memoria del proyecto)"
      },
      "ProjectInfoResponse": {
        "properties": {
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "description": "Si es el proyecto activo del usuario en la web",
            "default": false
          },
          "project_description": {
            "type": "string",
            "title": "Project Description"
          },
          "geo_context": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProjectInfoGeo"
              },
              {
                "type": "null"
              }
            ]
          },
          "collection_count": {
            "type": "integer",
            "title": "Collection Count"
          },
          "file_count": {
            "type": "integer",
            "title": "File Count"
          },
          "files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Files",
            "default": []
          },
          "collections": {
            "items": {
              "$ref": "#/components/schemas/ProjectInfoCollection"
            },
            "type": "array",
            "title": "Collections",
            "default": []
          },
          "unselected_collections": {
            "items": {
              "$ref": "#/components/schemas/ProjectInfoUnselectedCollection"
            },
            "type": "array",
            "title": "Unselected Collections",
            "default": []
          },
          "generated_documents": {
            "items": {
              "$ref": "#/components/schemas/ProjectInfoDocument"
            },
            "type": "array",
            "title": "Generated Documents",
            "default": []
          },
          "memory": {
            "items": {
              "$ref": "#/components/schemas/ProjectInfoMemoryFact"
            },
            "type": "array",
            "title": "Memory",
            "default": []
          },
          "calculations": {
            "items": {
              "$ref": "#/components/schemas/ProjectInfoCalculation"
            },
            "type": "array",
            "title": "Calculations",
            "default": []
          },
          "available_calculators": {
            "items": {
              "$ref": "#/components/schemas/ProjectInfoCalculator"
            },
            "type": "array",
            "title": "Available Calculators",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "project_id",
          "project_description",
          "collection_count",
          "file_count"
        ],
        "title": "ProjectInfoResponse",
        "description": "Respuesta del endpoint de información de proyecto"
      },
      "ProjectInfoUnselectedCollection": {
        "properties": {
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope"
          }
        },
        "type": "object",
        "title": "ProjectInfoUnselectedCollection",
        "description": "Normativa aplicable al territorio que el proyecto NO tiene seleccionada"
      },
      "ProjectListItem": {
        "properties": {
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "geo_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geo Id"
          },
          "location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location",
            "description": "Nombre del municipio/territorio del proyecto"
          },
          "collection_count": {
            "type": "integer",
            "title": "Collection Count",
            "default": 0
          },
          "file_count": {
            "type": "integer",
            "title": "File Count",
            "default": 0
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "description": "Proyecto activo del usuario: el que se usa si no se indica project_id",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "project_id",
          "name"
        ],
        "title": "ProjectListItem",
        "description": "Un proyecto en la lista de proyectos accesibles del usuario"
      },
      "ProjectListResponse": {
        "properties": {
          "projects": {
            "items": {
              "$ref": "#/components/schemas/ProjectListItem"
            },
            "type": "array",
            "title": "Projects",
            "default": []
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          }
        },
        "type": "object",
        "title": "ProjectListResponse",
        "description": "Respuesta del endpoint de listado de proyectos"
      },
      "Quota": {
        "properties": {
          "unlimited": {
            "type": "boolean",
            "title": "Unlimited",
            "description": "Si las consultas de la organización no tienen tope mensual."
          },
          "remaining": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining",
            "description": "Consultas que quedan este mes. Sin tope, null."
          },
          "resets_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resets At",
            "description": "Cuándo se reinicia el cupo."
          }
        },
        "type": "object",
        "required": [
          "unlimited"
        ],
        "title": "Quota"
      },
      "Radon": {
        "properties": {
          "listed": {
            "type": "boolean",
            "title": "Listed",
            "description": "Si el municipio figura en el Apéndice B. false: la sección HS 6 no es preceptiva"
          },
          "zone": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "I",
                  "II"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Zone"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "type": "object",
        "required": [
          "listed",
          "source"
        ],
        "title": "Radon"
      },
      "RateLimits": {
        "properties": {
          "data_per_minute": {
            "type": "integer",
            "title": "Data Per Minute",
            "description": "Rutas de datos: normativa, localización, proyectos y cuenta."
          },
          "intelligence_per_minute": {
            "type": "integer",
            "title": "Intelligence Per Minute",
            "description": "Consultas y comprobaciones (ask, verify)."
          },
          "mcp_per_minute": {
            "type": "integer",
            "title": "Mcp Per Minute",
            "description": "Peticiones al servidor MCP."
          }
        },
        "type": "object",
        "required": [
          "data_per_minute",
          "intelligence_per_minute",
          "mcp_per_minute"
        ],
        "title": "RateLimits"
      },
      "Regulation": {
        "properties": {
          "object": {
            "type": "string",
            "const": "regulation",
            "title": "Object",
            "default": "regulation"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "short_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Title"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope",
            "description": "national, regional o municipal"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "current_version": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VersionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "La vigente hoy"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title"
        ],
        "title": "Regulation"
      },
      "RegulationDetail": {
        "properties": {
          "object": {
            "type": "string",
            "const": "regulation",
            "title": "Object",
            "default": "regulation"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "short_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Title"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope",
            "description": "national, regional o municipal"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "current_version": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VersionSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "La vigente hoy"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/VersionSummary"
            },
            "type": "array",
            "title": "Versions",
            "description": "En el orden del catálogo: la vigente primero"
          },
          "related_documents": {
            "items": {
              "$ref": "#/components/schemas/RelatedDocument"
            },
            "type": "array",
            "title": "Related Documents",
            "description": "Comentarios, guías y documentos de apoyo, sin texto en la API"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title"
        ],
        "title": "RegulationDetail"
      },
      "RegulationList": {
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/Regulation"
            },
            "type": "array",
            "title": "Data"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor",
            "description": "Para la página siguiente: `cursor=`"
          }
        },
        "type": "object",
        "required": [
          "data",
          "has_more"
        ],
        "title": "RegulationList"
      },
      "RelatedDocument": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "comentarios, guia, documento_apoyo, modificaciones, divulgativo..."
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "published_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published Date"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "title",
          "type"
        ],
        "title": "RelatedDocument"
      },
      "SandboxInfo": {
        "properties": {
          "object": {
            "type": "string",
            "const": "sandbox",
            "title": "Object",
            "default": "sandbox"
          },
          "recorded_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recorded At",
            "description": "Cuándo se grabaron las parcelas de urban"
          },
          "parcels": {
            "items": {
              "$ref": "#/components/schemas/SandboxParcel"
            },
            "type": "array",
            "title": "Parcels"
          },
          "docs_url": {
            "type": "string",
            "title": "Docs Url"
          }
        },
        "type": "object",
        "required": [
          "parcels",
          "docs_url"
        ],
        "title": "SandboxInfo"
      },
      "SandboxParcel": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref"
          },
          "place": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Place"
          },
          "case": {
            "type": "string",
            "title": "Case",
            "description": "Qué caso cubre: afectada por una capa, sin planeamiento cargado, varias zonas..."
          },
          "centroid": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Centroid"
          }
        },
        "type": "object",
        "required": [
          "ref",
          "place",
          "case"
        ],
        "title": "SandboxParcel"
      },
      "Section": {
        "properties": {
          "object": {
            "type": "string",
            "const": "section",
            "title": "Object",
            "default": "section"
          },
          "regulation": {
            "type": "string",
            "title": "Regulation"
          },
          "version": {
            "$ref": "#/components/schemas/VersionSummary"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "blocks": {
            "items": {
              "$ref": "#/components/schemas/Block"
            },
            "type": "array",
            "title": "Blocks"
          }
        },
        "type": "object",
        "required": [
          "regulation",
          "version",
          "slug",
          "blocks"
        ],
        "title": "Section"
      },
      "SectionSummary": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "order": {
            "type": "integer",
            "title": "Order"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "order"
        ],
        "title": "SectionSummary"
      },
      "Seismic": {
        "properties": {
          "basic_acceleration_g": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basic Acceleration G",
            "description": "ab, en g. null si el municipio no figura en el Anejo 1"
          },
          "contribution_coefficient_k": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Contribution Coefficient K"
          },
          "below_0_04g": {
            "type": "boolean",
            "title": "Below 0 04G",
            "description": "El municipio no figura en el Anejo 1: ab < 0,04g y la norma no es obligatoria (art. 1.2.3)",
            "default": false
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "type": "object",
        "required": [
          "source"
        ],
        "title": "Seismic"
      },
      "Snow": {
        "properties": {
          "ground_load_kn_m2": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ground Load Kn M2",
            "description": "sk, sobrecarga de nieve en terreno horizontal"
          },
          "winter_climate_zone": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Winter Climate Zone",
            "description": "La zona de clima invernal, de 1 a 7"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "type": "object",
        "required": [
          "source"
        ],
        "title": "Snow"
      },
      "Source": {
        "properties": {
          "citation": {
            "type": "string",
            "title": "Citation",
            "description": "La norma y el anejo de donde sale el dato"
          },
          "regulation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regulation",
            "description": "El slug de la norma en /v1/regulations, si está en el catálogo"
          }
        },
        "type": "object",
        "required": [
          "citation"
        ],
        "title": "Source"
      },
      "TechnicalData": {
        "properties": {
          "climate_zone": {
            "$ref": "#/components/schemas/ClimateZone"
          },
          "design_temperatures": {
            "$ref": "#/components/schemas/DesignTemperatures"
          },
          "seismic": {
            "$ref": "#/components/schemas/Seismic"
          },
          "snow": {
            "$ref": "#/components/schemas/Snow"
          },
          "wind": {
            "$ref": "#/components/schemas/src__api__v1__lugares__Zone",
            "description": "Zona eólica: A, B o C"
          },
          "rainfall_hs1": {
            "$ref": "#/components/schemas/src__api__v1__lugares__Zone",
            "description": "Zona pluviométrica de promedios: I a V"
          },
          "drainage_hs5": {
            "$ref": "#/components/schemas/Drainage"
          },
          "thermal_zone_hs3": {
            "$ref": "#/components/schemas/src__api__v1__lugares__Zone",
            "description": "W, X, Y o Z"
          },
          "radon": {
            "$ref": "#/components/schemas/Radon"
          },
          "lightning": {
            "$ref": "#/components/schemas/Lightning"
          },
          "solar_irradiation_kwh_m2_day": {
            "$ref": "#/components/schemas/MonthlySeries"
          },
          "mains_water_temperature_c": {
            "$ref": "#/components/schemas/MonthlySeries"
          }
        },
        "type": "object",
        "required": [
          "climate_zone",
          "design_temperatures",
          "seismic",
          "snow",
          "wind",
          "rainfall_hs1",
          "drainage_hs5",
          "thermal_zone_hs3",
          "radon",
          "lightning",
          "solar_irradiation_kwh_m2_day",
          "mains_water_temperature_c"
        ],
        "title": "TechnicalData"
      },
      "Unit": {
        "properties": {
          "ref": {
            "type": "string",
            "title": "Ref",
            "description": "La referencia catastral del inmueble, de 20 caracteres"
          },
          "use": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use",
            "description": "residencial, comercial, oficinas, almacen_estacionamiento..."
          },
          "area_m2": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area M2"
          },
          "year_built": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year Built"
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address",
            "description": "La vía y el número del inmueble: «CL VIRGEN DEL CORO 20»"
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Postal Code"
          }
        },
        "type": "object",
        "required": [
          "ref"
        ],
        "title": "Unit"
      },
      "Units": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "by_use": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "By Use",
            "description": "Cuántos hay de cada uso (`sin_uso` sin él)"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/Unit"
            },
            "type": "array",
            "title": "Data",
            "description": "Como mucho 200 de cada uso; `total` y `by_use` cuentan todos"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "description": "Si hay más inmuebles que los de `data`"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source",
            "description": "La Dirección General del Catastro o la Diputación foral"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date",
            "description": "La de los datos del Catastro de su municipio"
          },
          "note": {
            "type": "string",
            "title": "Note",
            "default": "Elaborado a partir de datos del Catastro. No es información catastral."
          }
        },
        "type": "object",
        "required": [
          "total",
          "has_more"
        ],
        "title": "Units"
      },
      "UsageByDay": {
        "properties": {
          "calls": {
            "type": "integer",
            "title": "Calls"
          },
          "credits": {
            "type": "integer",
            "title": "Credits"
          },
          "errors": {
            "type": "integer",
            "title": "Errors",
            "description": "Llamadas que acabaron en un estado 4xx o 5xx."
          },
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          }
        },
        "type": "object",
        "required": [
          "calls",
          "credits",
          "errors",
          "date"
        ],
        "title": "UsageByDay"
      },
      "UsageByEndpoint": {
        "properties": {
          "calls": {
            "type": "integer",
            "title": "Calls"
          },
          "credits": {
            "type": "integer",
            "title": "Credits"
          },
          "errors": {
            "type": "integer",
            "title": "Errors",
            "description": "Llamadas que acabaron en un estado 4xx o 5xx."
          },
          "endpoint": {
            "type": "string",
            "title": "Endpoint"
          }
        },
        "type": "object",
        "required": [
          "calls",
          "credits",
          "errors",
          "endpoint"
        ],
        "title": "UsageByEndpoint"
      },
      "UsageResponse": {
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "organization",
              "key"
            ],
            "title": "Scope",
            "description": "De quién son las cifras: de toda la organización de la clave o solo de esta clave."
          },
          "organization_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization Id"
          },
          "from": {
            "type": "string",
            "format": "date",
            "title": "From"
          },
          "to": {
            "type": "string",
            "format": "date",
            "title": "To"
          },
          "totals": {
            "$ref": "#/components/schemas/UsageRow"
          },
          "by_endpoint": {
            "items": {
              "$ref": "#/components/schemas/UsageByEndpoint"
            },
            "type": "array",
            "title": "By Endpoint"
          },
          "by_day": {
            "items": {
              "$ref": "#/components/schemas/UsageByDay"
            },
            "type": "array",
            "title": "By Day"
          },
          "this_key": {
            "$ref": "#/components/schemas/UsageRow",
            "description": "La parte de esta clave."
          },
          "quota": {
            "$ref": "#/components/schemas/Quota"
          }
        },
        "type": "object",
        "required": [
          "scope",
          "from",
          "to",
          "totals",
          "by_endpoint",
          "by_day",
          "this_key",
          "quota"
        ],
        "title": "UsageResponse"
      },
      "UsageRow": {
        "properties": {
          "calls": {
            "type": "integer",
            "title": "Calls"
          },
          "credits": {
            "type": "integer",
            "title": "Credits"
          },
          "errors": {
            "type": "integer",
            "title": "Errors",
            "description": "Llamadas que acabaron en un estado 4xx o 5xx."
          }
        },
        "type": "object",
        "required": [
          "calls",
          "credits",
          "errors"
        ],
        "title": "UsageRow"
      },
      "UserInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "UserInfo"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerifyRequest": {
        "properties": {
          "element": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Element",
            "description": "Elemento constructivo o instalación a verificar (p.ej. 'fachada de ladrillo cara vista')"
          },
          "parameter": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Parameter",
            "description": "Parámetro o requisito que se comprueba (p.ej. 'transmitancia térmica')"
          },
          "value": {
            "type": "number",
            "minimum": 0.0,
            "title": "Value",
            "description": "Valor del proyecto a verificar"
          },
          "unit": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1,
            "title": "Unit",
            "description": "Unidad del valor (p.ej. 'W/m²K')"
          },
          "geo_id": {
            "type": "string",
            "minLength": 1,
            "title": "Geo Id",
            "description": "Identificador geográfico del municipio"
          },
          "codes": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CodeFilter"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Codes",
            "description": "Normativas concretas contra las que verificar. Si se omite, se usan todas las aplicables a la localización"
          },
          "context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context",
            "description": "Texto libre con características del proyecto relevantes para la verificación (uso, tipo de intervención, superficie, número de plantas, etc.)"
          }
        },
        "type": "object",
        "required": [
          "element",
          "parameter",
          "value",
          "unit",
          "geo_id"
        ],
        "title": "VerifyRequest",
        "description": "Request para verificación de cumplimiento normativo"
      },
      "VerifyResponse": {
        "properties": {
          "is_compliant": {
            "type": "boolean",
            "title": "Is Compliant",
            "description": "True si el valor cumple el límite normativo"
          },
          "result_status": {
            "type": "string",
            "title": "Result Status",
            "description": "Estado del resultado: compliant | conditional | non_compliant | undetermined"
          },
          "element": {
            "type": "string",
            "title": "Element",
            "description": "Eco del elemento enviado en el request"
          },
          "parameter": {
            "type": "string",
            "title": "Parameter",
            "description": "Eco del parámetro enviado en el request"
          },
          "provided_value": {
            "type": "number",
            "title": "Provided Value",
            "description": "Valor enviado por el usuario"
          },
          "limit_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit Value",
            "description": "Límite normativo cuantificable encontrado. null para verificaciones booleanas o cuando result_status = undetermined"
          },
          "unit": {
            "type": "string",
            "title": "Unit",
            "description": "Unidad de medida"
          },
          "conditions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Conditions",
            "description": "Condiciones o requisitos adicionales que aplican aunque el resultado sea compliant"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/VerifySource"
            },
            "type": "array",
            "title": "Sources",
            "description": "Fuentes normativas consultadas para determinar el cumplimiento"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings",
            "description": "Avisos no bloqueantes sobre limitaciones o cobertura parcial de la normativa"
          },
          "geo_context": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GeoContext"
              },
              {
                "type": "null"
              }
            ],
            "description": "Contexto geográfico utilizado"
          }
        },
        "type": "object",
        "required": [
          "is_compliant",
          "result_status",
          "element",
          "parameter",
          "provided_value",
          "unit"
        ],
        "title": "VerifyResponse",
        "description": "Resultado de una verificación de cumplimiento normativo"
      },
      "VerifySource": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index",
            "description": "Índice de la fuente (base 1) para referencia fácil en citas"
          },
          "code_slug": {
            "type": "string",
            "title": "Code Slug",
            "description": "Slug de la normativa de origen"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Slug del documento / versión utilizada"
          },
          "document_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Title",
            "description": "Título completo del documento"
          },
          "section_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Section Title",
            "description": "Título de la sección o artículo"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "URL directa a la sección en Normatia"
          }
        },
        "type": "object",
        "required": [
          "index",
          "code_slug"
        ],
        "title": "VerifySource",
        "description": "Fuente normativa citada en una verificación"
      },
      "VersionSummary": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version",
            "description": "El slug de la versión"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "active, repealed, draft o in_progress"
          },
          "published_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published Date"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date"
          },
          "has_text": {
            "type": "boolean",
            "title": "Has Text",
            "description": "Si Normatia tiene su texto (índice y secciones)",
            "default": false
          },
          "curated": {
            "type": "boolean",
            "title": "Curated",
            "description": "Texto revisado a mano por Normatia. false con texto: convertido de forma automática y sin revisar, contrástalo con `source_url`",
            "default": false
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url",
            "description": "El documento original"
          }
        },
        "type": "object",
        "required": [
          "version",
          "title"
        ],
        "title": "VersionSummary"
      },
      "ZoneParameter": {
        "properties": {
          "value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          }
        },
        "type": "object",
        "title": "ZoneParameter"
      },
      "Zoning": {
        "properties": {
          "land_class": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LandClass"
              },
              {
                "type": "null"
              }
            ]
          },
          "zone": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/src__api__v1__parcelas__Zone"
              },
              {
                "type": "null"
              }
            ]
          },
          "other_zones": {
            "items": {
              "$ref": "#/components/schemas/OtherZone"
            },
            "type": "array",
            "title": "Other Zones"
          },
          "areas": {
            "items": {
              "$ref": "#/components/schemas/PlanningArea"
            },
            "type": "array",
            "title": "Areas",
            "description": "Ámbitos de planeamiento que la tocan"
          },
          "zone_from_other_municipality": {
            "type": "boolean",
            "title": "Zone From Other Municipality",
            "description": "Una zona del municipio vecino la toca: el límite municipal no casa con la parcela",
            "default": false
          },
          "contrast_land_class": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LandClass"
              },
              {
                "type": "null"
              }
            ],
            "description": "La clase de suelo de las fuentes de contraste (el SIU), aparte"
          }
        },
        "type": "object",
        "title": "Zoning"
      },
      "src__api__v1__lugares__Place": {
        "properties": {
          "object": {
            "type": "string",
            "const": "place",
            "title": "Object",
            "default": "place"
          },
          "geo_id": {
            "type": "string",
            "title": "Geo Id",
            "description": "ES-41091 (municipio), ES-41 (provincia), ES-C01 (comunidad) o ES"
          },
          "ine": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ine",
            "description": "El código INE del municipio o de la provincia"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Como lo escribe el INE: «Puerto de Santa María, El»"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Para enseñar, con el artículo delante: «El Puerto de Santa María»"
          },
          "level": {
            "type": "string",
            "enum": [
              "country",
              "region",
              "province",
              "municipality"
            ],
            "title": "Level"
          },
          "province": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaceRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "region": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaceRef"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "name",
          "display_name",
          "level"
        ],
        "title": "Place"
      },
      "src__api__v1__lugares__Zone": {
        "properties": {
          "zone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zone"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          }
        },
        "type": "object",
        "required": [
          "source"
        ],
        "title": "Zone"
      },
      "src__api__v1__parcelas__Place": {
        "properties": {
          "geo_id": {
            "type": "string",
            "title": "Geo Id",
            "description": "El identificador de lugar de la API: `ES-` y el código INE"
          },
          "ine": {
            "type": "string",
            "title": "Ine"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "geo_id",
          "ine"
        ],
        "title": "Place"
      },
      "src__api__v1__parcelas__Zone": {
        "properties": {
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          },
          "instrument": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instrument"
          },
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "percent": {
            "type": "number",
            "title": "Percent",
            "description": "Qué parte de la parcela cae en la zona"
          },
          "global_use": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Global Use"
          },
          "typology": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Typology"
          },
          "parameters": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ZoneParameter"
            },
            "type": "object",
            "title": "Parameters",
            "description": "Los parámetros validados: edificabilidad, altura, plantas, ocupación, parcela mínima, usos..."
          }
        },
        "type": "object",
        "required": [
          "code",
          "percent"
        ],
        "title": "Zone"
      }
    },
    "securitySchemes": {
      "claveApi": {
        "type": "http",
        "scheme": "bearer",
        "description": "La clave de API de tu organización: `Authorization: Bearer sk-normatia-...`. Se crea en normatia.com, Mi cuenta > Claves API."
      }
    }
  },
  "tags": [
    {
      "name": "Cuenta",
      "description": "La clave, su organización, el consumo y las claves."
    },
    {
      "name": "Parcelas",
      "description": "La parcela por su referencia catastral, de la base territorial de Normatia: afecciones, planeamiento, edificación y geometría."
    },
    {
      "name": "Normativa (anterior)",
      "description": "El catálogo normativo: buscar normas y leer sus versiones y su estructura."
    },
    {
      "name": "Normativa",
      "description": "La normativa como dato: el catálogo, sus versiones con su vigencia, el índice y el texto de cada sección."
    },
    {
      "name": "Capas y cobertura",
      "description": "Las capas de afección con sus fuentes y licencias, y qué hay cargado en cada municipio."
    },
    {
      "name": "Municipios",
      "description": "Municipios, provincias y comunidades, con los datos técnicos de cada municipio y la norma de donde sale cada uno."
    },
    {
      "name": "Entorno de pruebas",
      "description": "Lo que responde una clave de prueba (sk-normatia-test-): las parcelas de prueba y el caso que cubre cada una."
    },
    {
      "name": "Territorio (anterior)",
      "description": "Municipios, provincias y comunidades, con sus datos técnicos y la normativa que les aplica."
    },
    {
      "name": "Proyectos",
      "description": "Los proyectos de la organización de la clave y su contexto."
    },
    {
      "name": "Consultas",
      "description": "Preguntas en lenguaje natural sobre un proyecto, con fuentes. Gastan un crédito."
    },
    {
      "name": "Comprobaciones",
      "description": "Si un valor técnico cumple el límite de la normativa aplicable. Gastan un crédito."
    }
  ],
  "servers": [
    {
      "url": "https://api.normatia.com",
      "description": "Producción"
    }
  ],
  "security": [
    {
      "claveApi": []
    }
  ]
}
