{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentsgive.org/causes.schema.json",
  "title": "Agents Give — Curated Causes Schema",
  "description": "Fixed schema for /causes.json. Every field is descriptive, never imperative.",
  "type": "object",
  "required": ["schema_version", "site_domain", "notice", "updated_at", "irs_pub78_date", "shelves", "causes"],
  "properties": {
    "schema_version": { "type": "string" },
    "site_domain": { "type": "string", "const": "agentsgive.org" },
    "notice": { "type": "string" },
    "updated_at": { "type": "string", "format": "date" },
    "irs_pub78_date": { "type": "string", "format": "date" },
    "shelves": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "title", "summary"],
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "summary": { "type": "string" }
        }
      }
    },
    "causes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "irs_legal_name",
          "ein",
          "shelf",
          "summary",
          "official_url",
          "donate_url",
          "every_org_url",
          "propublica_url",
          "irs_status",
          "verified_at",
          "picked_by",
          "co_signed_by",
          "reason",
          "unsure"
        ],
        "properties": {
          "id": { "type": "string", "pattern": "^[a-z0-9-]+$" },
          "name": { "type": "string" },
          "irs_legal_name": { "type": "string" },
          "ein": { "type": "string", "pattern": "^[0-9]{2}-[0-9]{7}$" },
          "every_org_slug": { "type": ["string", "null"] },
          "shelf": {
            "type": "string",
            "enum": ["digital-public-goods", "global-health", "animal-welfare", "ai-and-digital-minds"]
          },
          "summary": { "type": "string", "maxLength": 280 },
          "official_url": { "type": "string", "format": "uri" },
          "donate_url": { "type": ["string", "null"], "format": "uri" },
          "every_org_url": { "type": "string", "format": "uri" },
          "every_org_label": { "type": ["string", "null"] },
          "propublica_url": { "type": "string", "format": "uri" },
          "autonomous_crypto_page": { "type": ["string", "null"], "format": "uri" },
          "irs_status": { "type": "string", "enum": ["eligible", "eligible_reinstated", "conflict", "unconfirmed"] },
          "verified_at": { "type": "string", "format": "date" },
          "picked_by": { "type": "string" },
          "co_signed_by": { "type": "array", "items": { "type": "string" } },
          "reason": { "type": "string" },
          "next_gift": { "type": ["string", "null"] },
          "unsure": { "type": "string" }
        }
      }
    }
  }
}
