{
  "openapi": "3.1.0",
  "info": {
    "title": "ActProof Events Live Pre-validation API",
    "version": "1.8.0",
    "summary": "Hosted source-bound profile inspection, NDJSON streaming and pre-validation preview for ActProof Events.",
    "description": "Cloudflare Pages Functions preview for DORA profile inspection, field source explanation, report linting, pre-validation and agent-optimized NDJSON profile streams. Boundary: pre-validation only; not legal advice or compliance certification.\n\nCloudflare dashboard direct upload serves static GET resources and NDJSON streams. Hosted POST execution requires Wrangler/Worker deployment. Package/CLI execution is available now."
  },
  "servers": [
    {
      "url": "https://actproof.org/api/v1",
      "description": "Hosted stateless pre-validation preview"
    }
  ],
  "x-actproof-execution-status": "static_direct_upload_streams_live__post_execution_requires_wranger_worker_deploy",
  "x-actproof-boundaries": [
    "not_legal_advice",
    "not_compliance_certification",
    "not_supervisory_approval",
    "not_submission_gateway",
    "not_cryptographic_verification_of_report_bytes",
    "not_factual_verification"
  ],
  "paths": {
    "/service-card": {
      "get": {
        "operationId": "getActProofServiceCard",
        "summary": "Get ActProof service card",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/profiles": {
      "get": {
        "operationId": "listProfiles",
        "summary": "List source-bound profiles",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/profiles/{act_id}": {
      "get": {
        "operationId": "getProfileSummary",
        "summary": "Get profile summary",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/profiles/{act_id}/coverage": {
      "get": {
        "operationId": "getSourceCoverage",
        "summary": "Get source-binding coverage",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/profiles/{act_id}/fields": {
      "get": {
        "operationId": "listProfileFields",
        "summary": "List profile fields",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "fields": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FieldSummary"
                      }
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/profiles/{act_id}/fields/{field_id}": {
      "get": {
        "operationId": "getProfileField",
        "summary": "Get one profile field",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          },
          {
            "$ref": "#/components/parameters/FieldId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/profiles/{act_id}/fields/{field_id}/source": {
      "get": {
        "operationId": "explainFieldSource",
        "summary": "Explain field source basis",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          },
          {
            "$ref": "#/components/parameters/FieldId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceExplanation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/profiles/{act_id}/stream.ndjson": {
      "get": {
        "operationId": "streamProfileNdjson",
        "summary": "Stream source-bound profile events as NDJSON",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "first_lines": {
                    "value": "{\"type\":\"profile\",\"seq\":1}\n{\"type\":\"coverage\",\"seq\":2}\n"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-ndjson-event-types": [
          "profile",
          "coverage",
          "field",
          "source_atoms",
          "field_derivation",
          "prevalidation_rule",
          "boundary",
          "end"
        ]
      }
    },
    "/profiles/{act_id}/fields.ndjson": {
      "get": {
        "operationId": "streamFieldsNdjson",
        "summary": "Stream one compact field event per line as NDJSON",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "first_lines": {
                    "value": "{\"type\":\"profile\",\"seq\":1}\n{\"type\":\"coverage\",\"seq\":2}\n"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-ndjson-event-types": [
          "field"
        ]
      }
    },
    "/profiles/{act_id}/fields/{field_id}/events.ndjson": {
      "get": {
        "operationId": "streamFieldEventsNdjson",
        "summary": "Stream one field source/derivation/prevalidation chain as NDJSON",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          },
          {
            "$ref": "#/components/parameters/FieldId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "first_lines": {
                    "value": "{\"type\":\"profile\",\"seq\":1}\n{\"type\":\"coverage\",\"seq\":2}\n"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-ndjson-event-types": [
          "field",
          "source_atoms",
          "field_derivation",
          "prevalidation_rule",
          "mcp_hint",
          "boundary",
          "end"
        ]
      }
    },
    "/profiles/{act_id}/lint-report": {
      "post": {
        "operationId": "lintDoraReport",
        "summary": "Lint a draft report",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LintRequest"
              },
              "examples": {
                "minimal_blocked": {
                  "value": {
                    "report": {
                      "entity_legal_identifier": "549300EXAMPLE00000001"
                    }
                  }
                },
                "ready_like": {
                  "value": {
                    "report": {
                      "entity_legal_identifier": "example",
                      "entity_legal_name": "example",
                      "financial_entity_type": "example",
                      "submission_type": "example",
                      "incident_reference_code": "example",
                      "detection_datetime_utc": "example",
                      "classification_datetime_utc": "example",
                      "classification_criteria_triggered": "example",
                      "affected_member_states": "example",
                      "incident_discovery_method": "example",
                      "business_continuity_plan_activated": true,
                      "initial_impact_description": "example",
                      "primary_contact_name": "example",
                      "primary_contact_email": "example",
                      "competent_authority": "example"
                    },
                    "evidence_manifest": {
                      "classification_datetime_utc": [
                        "classification_committee_record",
                        "detection_system_log_excerpt"
                      ],
                      "classification_criteria_triggered": [
                        "classification_committee_record",
                        "detection_system_log_excerpt"
                      ],
                      "affected_member_states": [
                        "classification_committee_record",
                        "detection_system_log_excerpt"
                      ],
                      "initial_impact_description": [
                        "classification_committee_record",
                        "detection_system_log_excerpt"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrevalidationResponse"
                },
                "examples": {
                  "blocked": {
                    "value": {
                      "ok": true,
                      "prevalidation_status": "blocked",
                      "ready_for_preverification": false,
                      "findings": [
                        {
                          "code": "missing_required_field",
                          "severity": "blocking",
                          "field_id": "affected_member_states",
                          "message": "Required field is missing."
                        }
                      ],
                      "safe_summary": "The draft is structurally blocked because required fields are missing. This is a pre-validation result only, not a compliance verdict."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/profiles/{act_id}/prevalidate-report": {
      "post": {
        "operationId": "prevalidateDoraReport",
        "summary": "Prevalidate a draft report",
        "parameters": [
          {
            "$ref": "#/components/parameters/ActId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LintRequest"
              },
              "examples": {
                "minimal_blocked": {
                  "value": {
                    "report": {
                      "entity_legal_identifier": "549300EXAMPLE00000001"
                    }
                  }
                },
                "ready_like": {
                  "value": {
                    "report": {
                      "entity_legal_identifier": "example",
                      "entity_legal_name": "example",
                      "financial_entity_type": "example",
                      "submission_type": "example",
                      "incident_reference_code": "example",
                      "detection_datetime_utc": "example",
                      "classification_datetime_utc": "example",
                      "classification_criteria_triggered": "example",
                      "affected_member_states": "example",
                      "incident_discovery_method": "example",
                      "business_continuity_plan_activated": true,
                      "initial_impact_description": "example",
                      "primary_contact_name": "example",
                      "primary_contact_email": "example",
                      "competent_authority": "example"
                    },
                    "evidence_manifest": {
                      "classification_datetime_utc": [
                        "classification_committee_record",
                        "detection_system_log_excerpt"
                      ],
                      "classification_criteria_triggered": [
                        "classification_committee_record",
                        "detection_system_log_excerpt"
                      ],
                      "affected_member_states": [
                        "classification_committee_record",
                        "detection_system_log_excerpt"
                      ],
                      "initial_impact_description": [
                        "classification_committee_record",
                        "detection_system_log_excerpt"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrevalidationResponse"
                },
                "examples": {
                  "blocked": {
                    "value": {
                      "ok": true,
                      "prevalidation_status": "blocked",
                      "ready_for_preverification": false,
                      "findings": [
                        {
                          "code": "missing_required_field",
                          "severity": "blocking",
                          "field_id": "affected_member_states",
                          "message": "Required field is missing."
                        }
                      ],
                      "safe_summary": "The draft is structurally blocked because required fields are missing. This is a pre-validation result only, not a compliance verdict."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "413": {
            "$ref": "#/components/responses/RequestTooLarge"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/v1/profiles/dora/fields.ndjson": {
      "get": {
        "operationId": "streamDoraFieldsNdjson",
        "summary": "Stream DORA field inventory as NDJSON",
        "responses": {
          "200": {
            "description": "NDJSON field stream",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profiles/dora/stream.ndjson": {
      "get": {
        "operationId": "streamDoraProfileNdjson",
        "summary": "Stream DORA profile events as NDJSON",
        "responses": {
          "200": {
            "description": "NDJSON profile event stream",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/profiles/dora/fields/{field_id}/events.ndjson": {
      "get": {
        "operationId": "streamDoraFieldEventsNdjson",
        "summary": "Stream one DORA field evidence chain as NDJSON",
        "parameters": [
          {
            "name": "field_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "NDJSON field event stream",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "ActId": {
        "name": "act_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Use dora or op:eu.dora.ict_incident_notification_initial.v1"
      },
      "FieldId": {
        "name": "field_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "ActProof field_id, for example classification_criteria_triggered"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "ok",
          "error",
          "message"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "recoverability": {
            "type": "string"
          },
          "suggested_next_call": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Finding": {
        "type": "object",
        "required": [
          "code",
          "severity",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "field_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": "string"
          },
          "recoverability": {
            "type": "string"
          },
          "suggested_next_call": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "FieldSummary": {
        "type": "object",
        "required": [
          "field_id",
          "required"
        ],
        "properties": {
          "field_id": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "binding_granularity": {
            "type": [
              "string",
              "null"
            ]
          },
          "interpretive_load": {
            "type": [
              "integer",
              "null"
            ]
          },
          "disclosure_tier": {
            "type": [
              "string",
              "null"
            ]
          },
          "review_status": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "SourceExplanation": {
        "type": "object",
        "required": [
          "ok",
          "act_id",
          "field_id",
          "source_atoms",
          "safe_summary",
          "boundary"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "act_id": {
            "type": "string"
          },
          "field_id": {
            "type": "string"
          },
          "source_atoms": {
            "type": "array"
          },
          "safe_summary": {
            "type": "string"
          },
          "boundary": {
            "type": "string"
          },
          "next_recommended_call": {
            "type": "object"
          }
        },
        "additionalProperties": true
      },
      "PrevalidationResponse": {
        "type": "object",
        "required": [
          "ok",
          "prevalidation_status",
          "ready_for_preverification",
          "findings",
          "safe_summary",
          "boundary"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "prevalidation_status": {
            "type": "string",
            "enum": [
              "blocked",
              "attention_required",
              "ready_for_preverification"
            ]
          },
          "ready_for_preverification": {
            "type": "boolean"
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "code",
                "severity",
                "message"
              ],
              "properties": {
                "code": {
                  "type": "string"
                },
                "severity": {
                  "type": "string"
                },
                "field_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "message": {
                  "type": "string"
                },
                "recoverability": {
                  "type": "string"
                },
                "suggested_next_call": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "safe_summary": {
            "type": "string"
          },
          "boundary": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "LintRequest": {
        "type": "object",
        "required": [
          "report"
        ],
        "properties": {
          "report": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "NdjsonEvent": {
        "type": "object",
        "required": [
          "type",
          "seq",
          "act_id"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "seq": {
            "type": "integer"
          },
          "act_id": {
            "type": "string"
          },
          "profile_semantic_hash": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "Method not allowed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "RequestTooLarge": {
        "description": "Request too large",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    }
  }
}