{
  "openapi": "3.0.3",
  "info": {
    "title": "NGBVD Granular Power BI API",
    "version": "2026-10-31.2",
    "description": "Confidential granular observations prepared offline, including approved Survivor Code/CRB and readable labels. Operational database primary/foreign keys are excluded; HMAC relationship handles remain for unambiguous joins. GET/HEAD only: no create, edit or delete operations. Existing TLS, client/IP/scope/signature/audit controls remain. Local HTTP requires the separate explicit loopback-only development exception. Pages remain bounded to 1000 rows and 4 MiB of data. This contract is not a security certification."
  },
  "servers": [
    {
      "url": "https://ngbvd.mglsd.go.ug/api/v2/power-bi"
    }
  ],
  "security": [
    {
      "BasicClient": []
    },
    {
      "ClientKey": [],
      "ClientSecret": []
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getPowerBiRoot",
        "summary": "Read authorized snapshot manifest",
        "x-required-client-scope": "powerbi.manifest.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManifestResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/manifest": {
      "get": {
        "operationId": "getPowerBiManifest",
        "summary": "Read authorized snapshot manifest",
        "x-required-client-scope": "powerbi.manifest.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManifestResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/schema": {
      "get": {
        "operationId": "getPowerBiSchema",
        "summary": "Read authorized field dictionary",
        "x-required-client-scope": "powerbi.schema.read",
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/datasets/survivors": {
      "get": {
        "operationId": "getPowerBiSurvivors",
        "summary": "One recorded survivor intake",
        "x-required-client-scope": "powerbi.survivors.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Previous next_cursor; client, dataset, policy, snapshot and expiry bound."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurvivorsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/datasets/incidents": {
      "get": {
        "operationId": "getPowerBiIncidents",
        "summary": "One incident record",
        "x-required-client-scope": "powerbi.incidents.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Previous next_cursor; client, dataset, policy, snapshot and expiry bound."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/datasets/perpetrators": {
      "get": {
        "operationId": "getPowerBiPerpetrators",
        "summary": "One recorded perpetrator observation",
        "x-required-client-scope": "powerbi.perpetrators.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Previous next_cursor; client, dataset, policy, snapshot and expiry bound."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerpetratorsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/datasets/witnesses": {
      "get": {
        "operationId": "getPowerBiWitnesses",
        "summary": "One recorded witness observation",
        "x-required-client-scope": "powerbi.witnesses.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Previous next_cursor; client, dataset, policy, snapshot and expiry bound."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WitnessesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/datasets/actions": {
      "get": {
        "operationId": "getPowerBiActions",
        "summary": "One reported action or referral",
        "x-required-client-scope": "powerbi.actions.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Previous next_cursor; client, dataset, policy, snapshot and expiry bound."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/datasets/action_services": {
      "get": {
        "operationId": "getPowerBiActionServices",
        "summary": "One distinct service linked to an action",
        "x-required-client-scope": "powerbi.action_services.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Previous next_cursor; client, dataset, policy, snapshot and expiry bound."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionServicesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    },
    "/datasets/case_status_history": {
      "get": {
        "operationId": "getPowerBiCaseStatusHistory",
        "summary": "One case status history entry",
        "x-required-client-scope": "powerbi.case_status_history.read",
        "parameters": [
          {
            "name": "snapshot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Pin the same ready snapshot UUID for every table in the refresh. Omitted first requests use the current version."
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Previous next_cursor; client, dataset, policy, snapshot and expiry bound."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized prepared data; Cache-Control private, no-store.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseStatusHistoryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "503": {
            "$ref": "#/components/responses/503"
          },
          "405": {
            "$ref": "#/components/responses/405"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "success",
          "error",
          "request_id"
        ],
        "additionalProperties": false,
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string",
            "pattern": "^[A-Z0-9_]+$"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ManifestMetadata": {
        "type": "object",
        "required": [
          "snapshot_id",
          "schema_version",
          "captured_at_utc",
          "business_date_eat",
          "completed_at_utc",
          "source_lag_seconds_at_capture",
          "source_timezone",
          "pseudonym_key_id",
          "refresh_schedule",
          "datasets",
          "snapshot_schema_version",
          "readable_fields_ready",
          "read_only",
          "source_primary_keys_exposed"
        ],
        "properties": {
          "snapshot_id": {
            "type": "string",
            "format": "uuid"
          },
          "schema_version": {
            "type": "string"
          },
          "captured_at_utc": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at_utc": {
            "type": "string",
            "format": "date-time"
          },
          "business_date_eat": {
            "type": "string",
            "format": "date"
          },
          "source_lag_seconds_at_capture": {
            "type": "integer",
            "nullable": true,
            "minimum": 0
          },
          "source_timezone": {
            "type": "string"
          },
          "pseudonym_key_id": {
            "type": "string"
          },
          "refresh_schedule": {
            "type": "string"
          },
          "datasets": {
            "type": "object",
            "description": "Only explicitly authorized feeds; no national row totals.",
            "additionalProperties": {
              "type": "object",
              "required": [
                "grain",
                "path"
              ],
              "properties": {
                "grain": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                }
              }
            }
          },
          "snapshot_schema_version": {
            "type": "string"
          },
          "readable_fields_ready": {
            "type": "boolean"
          },
          "read_only": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "source_primary_keys_exposed": {
            "type": "boolean",
            "enum": [
              false
            ]
          }
        }
      },
      "PageMetadata": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ManifestMetadata"
          },
          {
            "type": "object",
            "required": [
              "dataset",
              "page_rows",
              "has_more",
              "next_cursor"
            ],
            "properties": {
              "dataset": {
                "type": "string",
                "enum": [
                  "survivors",
                  "incidents",
                  "perpetrators",
                  "witnesses",
                  "actions",
                  "action_services",
                  "case_status_history"
                ]
              },
              "page_rows": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "has_more": {
                "type": "boolean"
              },
              "next_cursor": {
                "type": "string",
                "nullable": true,
                "description": "Opaque encrypted token; continue when has_more, including on short pages."
              }
            }
          }
        ]
      },
      "ManifestResponse": {
        "type": "object",
        "required": [
          "success",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "metadata": {
            "$ref": "#/components/schemas/ManifestMetadata"
          }
        }
      },
      "SchemaResponse": {
        "type": "object",
        "required": [
          "success",
          "schema_version",
          "datasets",
          "code_lists",
          "excluded",
          "notes",
          "read_only",
          "allowed_methods"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "schema_version": {
            "type": "string"
          },
          "datasets": {
            "type": "object",
            "additionalProperties": {
              "type": "object"
            }
          },
          "code_lists": {
            "type": "object"
          },
          "excluded": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "read_only": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "allowed_methods": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "GET",
                "HEAD"
              ]
            }
          }
        }
      },
      "SurvivorsRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "survivor_code",
          "crb_number",
          "district_name",
          "subcounty_name",
          "parish_name",
          "region_name",
          "sub_region_name",
          "partner_name",
          "partner_alt_name",
          "creator_role_name",
          "source_created_at",
          "source_updated_at",
          "quality_flags",
          "interview_date",
          "interview_time_name",
          "was_referred",
          "gender_name",
          "nationality_name",
          "identity_document_type_name",
          "national_status_name",
          "national_status_category_name",
          "children_count",
          "religion_name",
          "marital_status_name",
          "separated_from_children",
          "has_disability",
          "disability_name",
          "education_name",
          "occupation_name",
          "employment_status",
          "previously_reported",
          "reporter_gender_name",
          "reporter_relationship_name",
          "reporter_type",
          "age_at_intake_years",
          "is_child_at_intake",
          "age_basis",
          "record_key",
          "survivor_key"
        ],
        "properties": {
          "survivor_code": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "crb_number": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "district_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "subcounty_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "parish_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "region_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "sub_region_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "partner_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "partner_alt_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "creator_role_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "source_created_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "source_updated_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "quality_flags": {
            "description": "list of field names with invalid or unresolved values",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "interview_date": {
            "description": "date or null",
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "interview_time_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "was_referred": {
            "description": "boolean or null",
            "type": "boolean",
            "nullable": true
          },
          "gender_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "nationality_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "identity_document_type_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "national_status_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "national_status_category_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "children_count": {
            "description": "integer or null",
            "type": "integer",
            "nullable": true
          },
          "religion_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "marital_status_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "separated_from_children": {
            "description": "boolean or null",
            "type": "boolean",
            "nullable": true
          },
          "has_disability": {
            "description": "boolean or null",
            "type": "boolean",
            "nullable": true
          },
          "disability_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "education_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "occupation_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "employment_status": {
            "description": "text or null",
            "type": "string",
            "nullable": true,
            "enum": [
              "Unemployed",
              "Employed",
              null
            ]
          },
          "previously_reported": {
            "description": "boolean or null",
            "type": "boolean",
            "nullable": true
          },
          "reporter_gender_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "reporter_relationship_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "reporter_type": {
            "description": "text or null",
            "type": "string",
            "nullable": true,
            "enum": [
              "Survivor",
              "Other",
              null
            ]
          },
          "age_at_intake_years": {
            "description": "integer or null",
            "type": "integer",
            "nullable": true
          },
          "is_child_at_intake": {
            "description": "boolean or null",
            "type": "boolean",
            "nullable": true
          },
          "age_basis": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "record_key": {
            "description": "opaque relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          },
          "survivor_key": {
            "description": "opaque survivor relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          }
        },
        "x-display-fields": [
          "survivor_code",
          "crb_number"
        ],
        "x-technical-relationship-fields": [
          "record_key",
          "survivor_key"
        ]
      },
      "SurvivorsResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/SurvivorsRow"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/PageMetadata"
          }
        }
      },
      "IncidentsRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "survivor_code",
          "crb_number",
          "source_created_at",
          "source_updated_at",
          "quality_flags",
          "incident_type_name",
          "incident_date",
          "incident_time_name",
          "age_at_incident_years",
          "is_child_at_incident",
          "age_basis",
          "incident_district_name",
          "incident_subcounty_name",
          "incident_parish_name",
          "incident_region_name",
          "incident_sub_region_name",
          "record_key",
          "survivor_key"
        ],
        "properties": {
          "survivor_code": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "crb_number": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "source_created_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "source_updated_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "quality_flags": {
            "description": "list of field names with invalid or unresolved values",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "incident_type_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "incident_date": {
            "description": "date or null",
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "incident_time_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "age_at_incident_years": {
            "description": "integer or null",
            "type": "integer",
            "nullable": true
          },
          "is_child_at_incident": {
            "description": "boolean or null",
            "type": "boolean",
            "nullable": true
          },
          "age_basis": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "incident_district_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "incident_subcounty_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "incident_parish_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "incident_region_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "incident_sub_region_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "record_key": {
            "description": "opaque relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          },
          "survivor_key": {
            "description": "opaque survivor relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          }
        },
        "x-display-fields": [
          "survivor_code",
          "crb_number"
        ],
        "x-technical-relationship-fields": [
          "record_key",
          "survivor_key"
        ]
      },
      "IncidentsResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/IncidentsRow"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/PageMetadata"
          }
        }
      },
      "PerpetratorsRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "survivor_code",
          "crb_number",
          "source_created_at",
          "source_updated_at",
          "quality_flags",
          "nationality_name",
          "identity_document_type_name",
          "religion_name",
          "national_status_name",
          "national_status_category_name",
          "legacy_national_status_name",
          "employment_status",
          "gender_name",
          "age_group_name",
          "education_name",
          "occupation_name",
          "relationship_name",
          "threatened_survivor",
          "record_key",
          "survivor_key"
        ],
        "properties": {
          "survivor_code": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "crb_number": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "source_created_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "source_updated_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "quality_flags": {
            "description": "list of field names with invalid or unresolved values",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "nationality_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "identity_document_type_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "religion_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "national_status_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "national_status_category_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "legacy_national_status_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "employment_status": {
            "description": "text or null",
            "type": "string",
            "nullable": true,
            "enum": [
              "Unemployed",
              "Employed",
              null
            ]
          },
          "gender_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "age_group_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "education_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "occupation_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "relationship_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "threatened_survivor": {
            "description": "boolean or null",
            "type": "boolean",
            "nullable": true
          },
          "record_key": {
            "description": "opaque relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          },
          "survivor_key": {
            "description": "opaque survivor relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          }
        },
        "x-display-fields": [
          "survivor_code",
          "crb_number"
        ],
        "x-technical-relationship-fields": [
          "record_key",
          "survivor_key"
        ]
      },
      "PerpetratorsResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/PerpetratorsRow"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/PageMetadata"
          }
        }
      },
      "WitnessesRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "survivor_code",
          "crb_number",
          "source_created_at",
          "source_updated_at",
          "quality_flags",
          "relationship_name",
          "age_group_name",
          "gender_name",
          "record_key",
          "survivor_key"
        ],
        "properties": {
          "survivor_code": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "crb_number": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "source_created_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "source_updated_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "quality_flags": {
            "description": "list of field names with invalid or unresolved values",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "relationship_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "age_group_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "gender_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "record_key": {
            "description": "opaque relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          },
          "survivor_key": {
            "description": "opaque survivor relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          }
        },
        "x-display-fields": [
          "survivor_code",
          "crb_number"
        ],
        "x-technical-relationship-fields": [
          "record_key",
          "survivor_key"
        ]
      },
      "WitnessesResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/WitnessesRow"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/PageMetadata"
          }
        }
      },
      "ActionsRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "survivor_code",
          "crb_number",
          "source_created_at",
          "source_updated_at",
          "quality_flags",
          "reported_to_name",
          "report_date",
          "referred_to_name",
          "referral_date",
          "action_name",
          "record_key",
          "survivor_key"
        ],
        "properties": {
          "survivor_code": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "crb_number": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "source_created_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "source_updated_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "quality_flags": {
            "description": "list of field names with invalid or unresolved values",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "reported_to_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "report_date": {
            "description": "date or null",
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "referred_to_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "referral_date": {
            "description": "date or null",
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "action_name": {
            "description": "derived authority, date and service label or null; not a unique identifier",
            "type": "string",
            "nullable": true,
            "maxLength": 1024
          },
          "record_key": {
            "description": "opaque relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          },
          "survivor_key": {
            "description": "opaque survivor relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          }
        },
        "x-display-fields": [
          "survivor_code",
          "crb_number",
          "action_name"
        ],
        "x-technical-relationship-fields": [
          "record_key",
          "survivor_key"
        ]
      },
      "ActionsResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/ActionsRow"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/PageMetadata"
          }
        }
      },
      "ActionServicesRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "survivor_code",
          "crb_number",
          "quality_flags",
          "action_name",
          "service_name",
          "link_source",
          "record_key",
          "survivor_key",
          "action_key"
        ],
        "properties": {
          "survivor_code": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "crb_number": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "quality_flags": {
            "description": "list of field names with invalid or unresolved values",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "action_name": {
            "description": "derived authority, date and service label or null; not a unique identifier",
            "type": "string",
            "nullable": true,
            "maxLength": 1024
          },
          "service_name": {
            "description": "text",
            "type": "string"
          },
          "link_source": {
            "description": "junction or legacy_csv or both",
            "type": "string"
          },
          "record_key": {
            "description": "opaque relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          },
          "survivor_key": {
            "description": "opaque survivor relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          },
          "action_key": {
            "description": "opaque action relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          }
        },
        "x-display-fields": [
          "survivor_code",
          "crb_number",
          "action_name",
          "service_name"
        ],
        "x-technical-relationship-fields": [
          "record_key",
          "survivor_key",
          "action_key"
        ]
      },
      "ActionServicesResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/ActionServicesRow"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/PageMetadata"
          }
        }
      },
      "CaseStatusHistoryRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "survivor_code",
          "crb_number",
          "source_created_at",
          "source_updated_at",
          "quality_flags",
          "case_status_name",
          "pending_point_name",
          "status_date",
          "record_key",
          "survivor_key"
        ],
        "properties": {
          "survivor_code": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "crb_number": {
            "description": "confidential business reference text or null",
            "type": "string",
            "nullable": true,
            "maxLength": 25
          },
          "source_created_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "source_updated_at": {
            "description": "source local datetime or null",
            "type": "string",
            "nullable": true
          },
          "quality_flags": {
            "description": "list of field names with invalid or unresolved values",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "case_status_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "pending_point_name": {
            "description": "text or null",
            "type": "string",
            "nullable": true
          },
          "status_date": {
            "description": "date or null",
            "type": "string",
            "nullable": true,
            "format": "date"
          },
          "record_key": {
            "description": "opaque relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          },
          "survivor_key": {
            "description": "opaque survivor relationship handle; not a database primary key",
            "type": "string",
            "pattern": "^[a-f0-9]{32}$",
            "minLength": 32,
            "maxLength": 32,
            "readOnly": true
          }
        },
        "x-display-fields": [
          "survivor_code",
          "crb_number"
        ],
        "x-technical-relationship-fields": [
          "record_key",
          "survivor_key"
        ]
      },
      "CaseStatusHistoryResponse": {
        "type": "object",
        "required": [
          "success",
          "data",
          "metadata"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/CaseStatusHistoryRow"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/PageMetadata"
          }
        }
      }
    },
    "securitySchemes": {
      "BasicClient": {
        "type": "http",
        "scheme": "basic",
        "description": "Dedicated client key as username and secret as password, stored in Power BI/gateway credentials. HTTPS and approved egress IP required."
      },
      "ClientKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Client-Key"
      },
      "ClientSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Client-Secret"
      }
    },
    "responses": {
      "400": {
        "description": "Invalid query, cursor or page size",
        "headers": {
          "X-Request-ID": {
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "401": {
        "description": "Missing/invalid/expired credentials or signature",
        "headers": {
          "X-Request-ID": {
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "403": {
        "description": "HTTPS, scope, network or policy denied",
        "headers": {
          "X-Request-ID": {
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "409": {
        "description": "Cursor conflict, replay or unavailable requested version",
        "headers": {
          "X-Request-ID": {
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "429": {
        "description": "Rate or concurrency budget exceeded",
        "headers": {
          "X-Request-ID": {
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          "Retry-After": {
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Wait this many seconds; actual rate window is respected."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "503": {
        "description": "Disabled, stale, not initialized, store/source readiness or audit unavailable",
        "headers": {
          "X-Request-ID": {
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          "Retry-After": {
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Wait this many seconds; actual rate window is respected."
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "405": {
        "description": "Method not allowed. Power BI endpoints accept GET/HEAD only and provide no record mutation operations.",
        "headers": {
          "Allow": {
            "schema": {
              "type": "string"
            },
            "description": "GET, HEAD"
          }
        }
      }
    }
  }
}
