{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "title": "Coup Atlas canonical coup record",
 "type": "array",
 "items": {
  "type": "object",
  "required": [
   "id",
   "country",
   "country_iso3",
   "region",
   "subregion",
   "date",
   "year",
   "event_type",
   "outcome",
   "coup_status",
   "actor_type",
   "description",
   "source_dataset",
   "citation_note",
   "notes",
   "sources",
   "lat",
   "lng"
  ],
  "additionalProperties": false,
  "properties": {
   "id": {
    "type": "string",
    "pattern": "^[0-9]{9,12}(_[0-9])?$"
   },
   "country": {
    "type": "string",
    "minLength": 1
   },
   "country_iso3": {
    "type": "string",
    "pattern": "^[A-Z]{3}$"
   },
   "region": {
    "enum": [
     "Africa",
     "Americas",
     "Asia",
     "Europe",
     "Oceania"
    ]
   },
   "subregion": {
    "type": "string",
    "minLength": 1
   },
   "date": {
    "type": "string",
    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
   },
   "year": {
    "type": "integer",
    "minimum": 1900,
    "maximum": 2100
   },
   "event_type": {
    "enum": [
     "Military coup",
     "Auto-coup",
     "Counter-coup",
     "Dissident coup",
     "Forced resignation",
     "Foreign-backed coup",
     "Palace coup",
     "Popular revolt",
     "Rebel coup",
     "Coup (actor type unspecified)"
    ]
   },
   "outcome": {
    "type": "string",
    "minLength": 1
   },
   "coup_status": {
    "enum": [
     "Successful",
     "Attempted",
     "Conspiracy"
    ]
   },
   "actor_type": {
    "type": "string"
   },
   "target_leader": {
    "type": [
     "string",
     "null"
    ]
   },
   "leader_fate": {
    "type": [
     "string",
     "null"
    ]
   },
   "leader_in_power": {
    "type": [
     "string",
     "null"
    ]
   },
   "leader_in_power_military": {
    "type": [
     "boolean",
     "null"
    ]
   },
   "regime_type": {
    "type": [
     "string",
     "null"
    ]
   },
   "last_election": {
    "type": [
     "string",
     "null"
    ]
   },
   "last_election_kind": {
    "type": [
     "string",
     "null"
    ]
   },
   "last_election_timing": {
    "type": [
     "string",
     "null"
    ]
   },
   "days_since_election": {
    "type": [
     "integer",
     "null"
    ]
   },
   "description": {
    "type": "string"
   },
   "source_dataset": {
    "type": "string"
   },
   "citation_note": {
    "type": "string",
    "minLength": 10
   },
   "notes": {
    "type": "string",
    "minLength": 10
   },
   "sources": {
    "type": "array",
    "items": {
     "type": "string"
    }
   },
   "background": {
    "type": [
     "string",
     "null"
    ]
   },
   "key_figures": {
    "type": [
     "array",
     "null"
    ]
   },
   "lat": {
    "type": [
     "number",
     "null"
    ],
    "minimum": -90,
    "maximum": 90
   },
   "lng": {
    "type": [
     "number",
     "null"
    ],
    "minimum": -180,
    "maximum": 180
   },
   "tactics": {
    "type": [
     "array",
     "null"
    ],
    "items": {
     "type": "string"
    }
   },
   "lead_actor_type": {
    "type": [
     "string",
     "null"
    ]
   },
   "duration_days": {
    "type": [
     "integer",
     "null"
    ],
    "minimum": 0
   },
   "cline_id": {
    "type": [
     "string",
     "null"
    ]
   },
   "powell_thyne_id": {
    "type": [
     "string",
     "null"
    ]
   },
   "cam_id": {
    "type": [
     "string",
     "null"
    ]
   },
   "agreement_status": {
    "enum": [
     "agree",
     "partial",
     "disagree",
     "unique_to_us",
     null
    ]
   },
   "confidence": {
    "enum": [
     "high",
     "medium",
     "low",
     null
    ]
   },
   "added_on": {
    "description": "The date this record entered the Coup Atlas, which is not the date of the event. The feed is ordered by this so a newly researched old coup still surfaces. Stamped once by the build and never changed after.",
    "type": "string",
    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
   },
   "vdem_v2x_polyarchy": {
    "description": "V-Dem electoral democracy index (v2x_polyarchy) for the country in the year before the event; 0-1 low to high. Null where V-Dem does not cover the country-year.",
    "type": [
     "number",
     "null"
    ],
    "minimum": 0,
    "maximum": 1
   },
   "deaths": {
    "description": "Reported deaths associated with the event, from the Center for Systemic Peace coup list. Null where CSP records no figure.",
    "type": [
     "integer",
     "null"
    ],
    "minimum": 0
   },
   "adverse_regime_change": {
    "description": "True where the Center for Systemic Peace records an adverse regime change following the event.",
    "type": [
     "boolean",
     "null"
    ]
   },
   "source_trail": {
    "description": "The `sources` trail grouped by outlet and rejoined into whole citations, derived by build/citations.mjs. Never hand-edited; `sources` remains the archival raw value.",
    "type": [
     "array",
     "null"
    ],
    "items": {
     "type": "object",
     "additionalProperties": false,
     "required": [
      "outlet",
      "cites"
     ],
     "properties": {
      "outlet": {
       "type": [
        "string",
        "null"
       ]
      },
      "cites": {
       "type": "array",
       "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
         "text"
        ],
        "properties": {
         "text": {
          "type": "string"
         },
         "url": {
          "type": "string",
          "pattern": "^https?://\\S+$"
         }
        }
       }
      }
     }
    }
   }
  }
 }
}