{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://preparedboard.com/standard/v1/board-seats.schema.json",
  "title": "prepared-board.board-seats.v1",
  "description": "Open board and commission seats collected from public postings (GET /api/agent/board-seats). Every seat links its original posting and the date we last checked it. Prepared Board is not affiliated with the posting organizations. Human page: https://preparedboard.com/board-seats",
  "type": "object",
  "required": [
    "format",
    "schema",
    "provenance",
    "notice",
    "privacy",
    "expiryDays",
    "generatedAt",
    "total",
    "count",
    "page",
    "perPage",
    "totalPages",
    "next",
    "prev",
    "sources",
    "seats"
  ],
  "properties": {
    "format": {
      "const": "prepared-board.board-seats.v1"
    },
    "schema": {
      "type": "string",
      "format": "uri"
    },
    "provenance": {
      "const": "Collected from public postings"
    },
    "notice": {
      "type": "string"
    },
    "privacy": {
      "type": "string"
    },
    "expiryDays": {
      "type": "integer"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "total": {
      "type": "integer",
      "minimum": 0
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "page": {
      "type": "integer",
      "minimum": 1
    },
    "perPage": {
      "type": "integer",
      "minimum": 1
    },
    "totalPages": {
      "type": "integer",
      "minimum": 0
    },
    "next": {
      "type": [
        "string",
        "null"
      ]
    },
    "prev": {
      "type": [
        "string",
        "null"
      ]
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "kind",
          "url",
          "lastCheckedAt",
          "status",
          "seatsFound"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "lastCheckedAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "enum": [
              "ok",
              "gone",
              "blocked",
              "robots-disallowed",
              "error"
            ]
          },
          "seatsFound": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "seats": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/seat"
      }
    }
  },
  "$defs": {
    "seat": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "url",
        "title",
        "organization",
        "body",
        "seat",
        "openings",
        "detail",
        "location",
        "sector",
        "postedDate",
        "firstSeenAt",
        "lastSeenAt",
        "lastCheckedAt",
        "expiresAt",
        "source",
        "sources",
        "provenance",
        "affiliation",
        "managedByOrganization",
        "organizationNote"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^bs-[0-9a-f]{12}$"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "This listing on preparedboard.com."
        },
        "title": {
          "type": "string"
        },
        "organization": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "name",
            "postingUrl"
          ],
          "properties": {
            "name": {
              "type": "string"
            },
            "postingUrl": {
              "type": "string",
              "format": "uri",
              "description": "The original public posting. This is the only contact link we keep."
            }
          }
        },
        "body": {
          "type": "string",
          "description": "The board, committee or commission."
        },
        "seat": {
          "type": "string",
          "description": "The seat or role."
        },
        "openings": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "description": "Number of open seats when the posting says."
        },
        "detail": {
          "type": [
            "string",
            "null"
          ],
          "description": "Short factual detail from the posting. Never names or contact details."
        },
        "location": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "city",
            "state",
            "stateName",
            "region"
          ],
          "properties": {
            "city": {
              "type": [
                "string",
                "null"
              ]
            },
            "state": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "stateName": {
              "type": "string"
            },
            "region": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "sector": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "label"
          ],
          "properties": {
            "id": {
              "enum": [
                "nonprofit",
                "public-municipal",
                "public-state",
                "hospitality",
                "company"
              ]
            },
            "label": {
              "type": "string"
            }
          }
        },
        "postedDate": {
          "type": [
            "string",
            "null"
          ],
          "description": "Posted or 'as of' date exactly as the posting gives it, or null."
        },
        "firstSeenAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastSeenAt": {
          "type": "string",
          "format": "date-time",
          "description": "Last time we saw this seat on its source."
        },
        "lastCheckedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Last time we checked the source."
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "description": "When the listing comes off if it is not seen again."
        },
        "source": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "url",
            "name",
            "kind",
            "kindLabel"
          ],
          "properties": {
            "url": {
              "type": "string",
              "format": "uri"
            },
            "name": {
              "type": "string"
            },
            "kind": {
              "type": "string"
            },
            "kindLabel": {
              "type": "string"
            }
          }
        },
        "sources": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "url",
              "name",
              "kind"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              }
            }
          }
        },
        "provenance": {
          "const": "Collected from public postings"
        },
        "affiliation": {
          "type": "string"
        },
        "managedByOrganization": {
          "type": "boolean"
        },
        "organizationNote": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
