{
  "openapi": "3.1.0",
  "info": {
    "title": "Vergunning.app API",
    "version": "1.0.0",
    "description": "Public, read-only API over official Dutch publications (permits, plans,\nevents, traffic decisions and other notices). Vergunning.app is not an\nofficial register; every record links to its official source. \"No\nresult\" never means that no permit exists. Dates keep their type\n(published, decided, effective, event).\n"
  },
  "servers": [
    {
      "url": "https://api.vergunning.app"
    }
  ],
  "paths": {
    "/api/v1/search": {
      "get": {
        "summary": "Search publications",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Category"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "verleend",
                "geweigerd",
                "gewijzigd",
                "ingetrokken"
              ]
            }
          },
          {
            "name": "authority",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "case_number",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activity",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "near",
            "in": "query",
            "description": "lon,lat",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 25,
              "maximum": 5000
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "relevance",
                "newest",
                "oldest"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 5,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta",
                    "coverage"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicationSummary"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    },
                    "coverage": {
                      "$ref": "#/components/schemas/Coverage"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/suggest": {
      "get": {
        "summary": "Typed suggestions (authority, case number, address)",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suggestions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "label",
                          "url"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "authority",
                              "case_number",
                              "address"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "detail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/publications/{id}": {
      "get": {
        "summary": "One official publication",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Publication",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PublicationDetail"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "410": {
            "description": "Removed (privacy)"
          }
        }
      }
    },
    "/api/v1/procedures/{id}": {
      "get": {
        "summary": "Procedure dossier with timeline",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Procedure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProcedureDetail"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{id}": {
      "get": {
        "summary": "Project (procedures linked by explicit source references)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/addresses/{bagId}": {
      "get": {
        "summary": "Address passport",
        "parameters": [
          {
            "name": "bagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Address",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Address"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/map": {
      "get": {
        "summary": "GeoJSON features in a bounding box (areas stay areas)",
        "parameters": [
          {
            "name": "bbox",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Category"
            }
          },
          {
            "name": "zoom",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "FeatureCollection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureCollection"
                }
              }
            }
          },
          "422": {
            "description": "Area too large"
          }
        }
      }
    },
    "/api/v1/categories": {
      "get": {
        "summary": "The eleven categories with counts",
        "responses": {
          "200": {
            "description": "Categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CategoryCount"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sources": {
      "get": {
        "summary": "Source health, coverage, exclusions and legal rule register",
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SourceStatus"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/plans/{id}/compare": {
      "get": {
        "summary": "Compare two versions of one plan",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comparison",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PlanComparison"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/letters": {
      "post": {
        "summary": "Compose an inspection, copy or Woo request (never sent by Vergunning.app)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "publication_id",
                  "route",
                  "requester",
                  "recipient",
                  "confirmed"
                ],
                "properties": {
                  "publication_id": {
                    "type": "string"
                  },
                  "route": {
                    "type": "string",
                    "enum": [
                      "inzage",
                      "afschrift",
                      "woo"
                    ]
                  },
                  "requester": {
                    "type": "object",
                    "required": [
                      "name",
                      "email"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "address": {
                        "type": "string"
                      },
                      "postcode_city": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      }
                    }
                  },
                  "recipient": {
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "postal_address": {
                        "type": "string"
                      }
                    }
                  },
                  "request": {
                    "type": "object",
                    "properties": {
                      "documents": {
                        "type": "string"
                      },
                      "period": {
                        "type": "string"
                      },
                      "format": {
                        "type": "string"
                      }
                    }
                  },
                  "store": {
                    "type": "boolean"
                  },
                  "remind_on": {
                    "type": "string",
                    "format": "date"
                  },
                  "confirmed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Letter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Letter"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Category": {
        "type": "string",
        "enum": [
          "bouwen",
          "plannen",
          "evenementen",
          "verkeer",
          "natuur",
          "milieu",
          "horeca",
          "water",
          "erfgoed",
          "apv",
          "overig"
        ]
      },
      "LocationConfidence": {
        "type": "string",
        "enum": [
          "official_geometry",
          "bag_id",
          "full_address",
          "geocoded",
          "place",
          "unknown"
        ]
      },
      "PageMeta": {
        "type": "object",
        "required": [
          "total",
          "page",
          "last_page",
          "per_page"
        ],
        "properties": {
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "last_page": {
            "type": "integer"
          },
          "per_page": {
            "type": "integer"
          },
          "filters": {
            "type": "object"
          }
        }
      },
      "Coverage": {
        "type": "object",
        "required": [
          "sources"
        ],
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          },
          "latest_publication": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        }
      },
      "Source": {
        "type": "object",
        "required": [
          "key",
          "name",
          "health"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "health": {
            "type": "string",
            "enum": [
              "ok",
              "degraded",
              "failing",
              "blocked",
              "unknown"
            ]
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "documentation_url": {
            "type": "string"
          },
          "api_version": {
            "type": "string"
          }
        }
      },
      "AuthorityRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          }
        }
      },
      "PublicationSummary": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "url",
          "title",
          "category",
          "kind",
          "published_at",
          "location",
          "source",
          "withdrawn"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "$ref": "#/components/schemas/Category"
          },
          "kind": {
            "type": "string",
            "enum": [
              "aanvraag",
              "ontwerpbesluit",
              "besluit",
              "verlenging_beslistermijn",
              "melding",
              "kennisgeving",
              "verkeersbesluit",
              "verordening",
              "beleidsregel",
              "plan",
              "mededeling",
              "onbekend"
            ]
          },
          "decision_outcome": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "verleend",
              "geweigerd",
              "gewijzigd",
              "ingetrokken",
              null
            ]
          },
          "published_at": {
            "type": "string",
            "format": "date"
          },
          "event_starts_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "event_ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "authority": {
            "$ref": "#/components/schemas/AuthorityRef"
          },
          "location": {
            "type": "object",
            "required": [
              "confidence"
            ],
            "properties": {
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "municipality": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "confidence": {
                "$ref": "#/components/schemas/LocationConfidence"
              }
            }
          },
          "source": {
            "type": "object",
            "required": [
              "identifier",
              "url"
            ],
            "properties": {
              "series": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "identifier": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          },
          "withdrawn": {
            "type": "boolean"
          }
        }
      },
      "Deadline": {
        "type": [
          "object",
          "null"
        ],
        "required": [
          "kind",
          "date",
          "basis",
          "stated",
          "note"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "basis": {
            "type": "string"
          },
          "stated": {
            "type": "boolean",
            "description": "true when the publication states the date; otherwise indicative"
          },
          "rule": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": "string"
          },
          "quote": {
            "type": "string",
            "description": "The sentence of the publication the period comes from (when read from its text)"
          },
          "period": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "amount": {
                "type": "integer"
              },
              "unit": {
                "type": "string",
                "enum": [
                  "weken",
                  "dagen",
                  "maanden"
                ]
              }
            }
          },
          "starts": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sending",
              "inspection",
              "publication",
              "dated",
              null
            ],
            "description": "The day after which the period runs, according to the text"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "pdf",
              "html",
              null
            ]
          }
        }
      },
      "Document": {
        "type": "object",
        "required": [
          "title",
          "kind",
          "availability"
        ],
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "availability": {
            "type": "string",
            "enum": [
              "online",
              "ter_inzage",
              "op_verzoek",
              "niet_openbaar",
              "onbekend"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "pages": {
            "type": [
              "integer",
              "null"
            ]
          },
          "copy_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Our stored copy of the official document (/api/documents/{id}/file)"
          },
          "copied_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        }
      },
      "PublicationDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PublicationSummary"
          },
          {
            "type": "object",
            "required": [
              "categories",
              "activities",
              "dates",
              "documents",
              "addresses",
              "versions",
              "source_detail",
              "privacy_restricted"
            ],
            "properties": {
              "abstract": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source_category": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "categories": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Category"
                }
              },
              "activities": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "case_number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "procedure_type": {
                "type": "string"
              },
              "dates": {
                "type": "object",
                "additionalProperties": {
                  "type": "string",
                  "format": "date"
                }
              },
              "deadline": {
                "$ref": "#/components/schemas/Deadline"
              },
              "geometry": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "addresses": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "bag_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "confidence": {
                      "type": "string"
                    },
                    "relation": {
                      "type": "string"
                    }
                  }
                }
              },
              "documents": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Document"
                }
              },
              "procedure": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  }
                }
              },
              "versions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "observed_at": {
                      "type": "string"
                    },
                    "changes": {
                      "type": [
                        "object",
                        "array",
                        "null"
                      ]
                    }
                  }
                }
              },
              "source_detail": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "fetched_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "manifestations": {
                    "type": "object"
                  }
                }
              },
              "privacy_restricted": {
                "type": "boolean"
              }
            }
          }
        ]
      },
      "ProcedureSummary": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "url",
          "title",
          "category",
          "status",
          "legal_validity"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "$ref": "#/components/schemas/Category"
          },
          "status": {
            "type": "string",
            "enum": [
              "aangevraagd",
              "ontwerp",
              "verleend",
              "geweigerd",
              "ingetrokken",
              "besloten_uitkomst_onbekend",
              "gemeld",
              "vastgesteld",
              "onbekend"
            ]
          },
          "legal_validity": {
            "type": "string",
            "enum": [
              "unknown",
              "no_decision",
              "final_confirmed"
            ]
          },
          "case_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "last_event_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "authority": {
            "$ref": "#/components/schemas/AuthorityRef"
          },
          "indexable": {
            "type": "boolean"
          }
        }
      },
      "TimelineEvent": {
        "type": "object",
        "required": [
          "type",
          "known"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "date_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "known": {
            "type": "boolean",
            "description": "false: an expected stage no source has confirmed"
          },
          "publication": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ProcedureDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProcedureSummary"
          },
          {
            "type": "object",
            "required": [
              "timeline",
              "publications",
              "documents"
            ],
            "properties": {
              "procedure_type": {
                "type": "string"
              },
              "location": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "location_label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "timeline": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TimelineEvent"
                }
              },
              "publications": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PublicationSummary"
                }
              },
              "documents": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Document"
                }
              },
              "deadline": {
                "$ref": "#/components/schemas/Deadline"
              },
              "geometry": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "projects": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "relations_pending_review": {
                "type": "integer"
              }
            }
          }
        ]
      },
      "Project": {
        "type": "object",
        "required": [
          "id",
          "title",
          "url",
          "procedures"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          },
          "location": {
            "type": [
              "object",
              "null"
            ]
          },
          "indexable": {
            "type": "boolean"
          },
          "procedures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProcedureSummary"
            }
          }
        }
      },
      "Address": {
        "type": "object",
        "required": [
          "id",
          "bag_id",
          "label",
          "on_address",
          "nearby",
          "nearby_radius_m",
          "areas",
          "partner_relations"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "bag_id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "street": {
            "type": [
              "string",
              "null"
            ]
          },
          "house_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "postcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "municipality": {
            "type": [
              "string",
              "null"
            ]
          },
          "point": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "lon": {
                "type": "number"
              },
              "lat": {
                "type": "number"
              }
            }
          },
          "on_address": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicationSummary"
            }
          },
          "nearby": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicationSummary"
            }
          },
          "nearby_radius_m": {
            "type": "integer"
          },
          "areas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicationSummary"
            }
          },
          "partner_relations": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "partner",
                "url",
                "label",
                "relation"
              ],
              "properties": {
                "partner": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "relation": {
                  "type": "string",
                  "enum": [
                    "same_location",
                    "nearby"
                  ]
                },
                "verified_at": {
                  "type": "string"
                }
              }
            }
          },
          "coverage": {
            "$ref": "#/components/schemas/Coverage"
          }
        }
      },
      "CategoryCount": {
        "type": "object",
        "required": [
          "key",
          "total",
          "last_30_days"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Category"
          },
          "total": {
            "type": "integer"
          },
          "last_30_days": {
            "type": "integer"
          }
        }
      },
      "SourceStatus": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Coverage"
          },
          {
            "type": "object",
            "properties": {
              "coverage": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "location_confidence": {
                "type": "object"
              },
              "excluded": {
                "type": "object"
              },
              "recent_runs": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "legal_rules": {
                "type": "object"
              }
            }
          }
        ]
      },
      "PlanComparison": {
        "type": "object",
        "required": [
          "plan",
          "from",
          "to",
          "status",
          "summary"
        ],
        "properties": {
          "plan": {
            "type": "object"
          },
          "from": {
            "type": "object"
          },
          "to": {
            "type": "object"
          },
          "status": {
            "type": "string",
            "enum": [
              "comparable",
              "incomparable"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": [
              "object",
              "array"
            ]
          }
        }
      },
      "Letter": {
        "type": "object",
        "required": [
          "id",
          "token",
          "subject",
          "body",
          "stored",
          "expires_at",
          "send_to"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "stored": {
            "type": "boolean"
          },
          "expires_at": {
            "type": "string"
          },
          "send_to": {
            "type": [
              "object",
              "array"
            ]
          }
        }
      },
      "FeatureCollection": {
        "type": "object",
        "required": [
          "type",
          "features",
          "truncated"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "FeatureCollection"
          },
          "truncated": {
            "type": "boolean"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type",
                "id",
                "geometry",
                "properties"
              ],
              "properties": {
                "type": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "geometry": {
                  "type": "object"
                },
                "properties": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "outcome": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "confidence": {
                      "type": "string"
                    },
                    "published_at": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
