{
  "components": {
    "schemas": {
      "Body_upload_document_v1_etrc_documents_post": {
        "properties": {
          "beneficial_owner_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Beneficial Owner Id"
          },
          "country_of_issuance": {
            "title": "Country Of Issuance",
            "type": "string"
          },
          "dividend_event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dividend Event Id"
          },
          "document_type": {
            "title": "Document Type",
            "type": "string"
          },
          "file": {
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "type": "string"
          },
          "validity_from": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validity From"
          },
          "validity_until": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validity Until"
          }
        },
        "required": [
          "document_type",
          "country_of_issuance",
          "file"
        ],
        "title": "Body_upload_document_v1_etrc_documents_post",
        "type": "object"
      },
      "CorrectIn": {
        "properties": {
          "paying_agent_lei": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paying Agent Lei"
          }
        },
        "title": "CorrectIn",
        "type": "object"
      },
      "DividendEventIn": {
        "properties": {
          "coaf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coaf"
          },
          "credit_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credit Kind"
          },
          "currency": {
            "default": "EUR",
            "title": "Currency",
            "type": "string"
          },
          "ex_date": {
            "title": "Ex Date",
            "type": "string"
          },
          "faster_track": {
            "default": "standard",
            "title": "Faster Track",
            "type": "string"
          },
          "gross_amount_per_share": {
            "title": "Gross Amount Per Share",
            "type": "number"
          },
          "isin": {
            "title": "Isin",
            "type": "string"
          },
          "issuer_name": {
            "title": "Issuer Name",
            "type": "string"
          },
          "pay_date": {
            "title": "Pay Date",
            "type": "string"
          },
          "record_date": {
            "title": "Record Date",
            "type": "string"
          },
          "security_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Type"
          },
          "source_country": {
            "default": "DE",
            "title": "Source Country",
            "type": "string"
          }
        },
        "required": [
          "isin",
          "issuer_name",
          "ex_date",
          "pay_date",
          "record_date",
          "gross_amount_per_share"
        ],
        "title": "DividendEventIn",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "InstitutionIn": {
        "properties": {
          "chain_role": {
            "title": "Chain Role",
            "type": "string"
          },
          "country": {
            "title": "Country",
            "type": "string"
          },
          "legal_name": {
            "title": "Legal Name",
            "type": "string"
          },
          "lei": {
            "title": "Lei",
            "type": "string"
          },
          "taxreclaim_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Taxreclaim User Id"
          }
        },
        "required": [
          "legal_name",
          "lei",
          "country",
          "chain_role"
        ],
        "title": "InstitutionIn",
        "type": "object"
      },
      "RefundIn": {
        "properties": {
          "refunded_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refunded Amount"
          },
          "refunded_on": {
            "format": "date",
            "title": "Refunded On",
            "type": "string"
          }
        },
        "required": [
          "refunded_on"
        ],
        "title": "RefundIn",
        "type": "object"
      },
      "RejectIn": {
        "properties": {
          "reason": {
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "RejectIn",
        "type": "object"
      },
      "ResolveIn": {
        "properties": {
          "resolution": {
            "title": "Resolution",
            "type": "string"
          }
        },
        "required": [
          "resolution"
        ],
        "title": "ResolveIn",
        "type": "object"
      },
      "SelfDeclarationIn": {
        "properties": {
          "beneficial_owner_confirmed": {
            "default": false,
            "title": "Beneficial Owner Confirmed",
            "type": "boolean"
          },
          "beneficial_owner_id": {
            "title": "Beneficial Owner Id",
            "type": "string"
          },
          "declaration_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declaration Year"
          },
          "declared_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Address"
          },
          "declared_residence_country": {
            "title": "Declared Residence Country",
            "type": "string"
          },
          "declared_tin": {
            "title": "Declared Tin",
            "type": "string"
          },
          "entitled_to_relief": {
            "title": "Entitled To Relief",
            "type": "boolean"
          },
          "no_disqualifying_arrangements": {
            "title": "No Disqualifying Arrangements",
            "type": "boolean"
          }
        },
        "required": [
          "beneficial_owner_id",
          "entitled_to_relief",
          "no_disqualifying_arrangements",
          "declared_residence_country",
          "declared_tin"
        ],
        "title": "SelfDeclarationIn",
        "type": "object"
      },
      "SetModuleIn": {
        "properties": {
          "module": {
            "title": "Module",
            "type": "string"
          }
        },
        "required": [
          "module"
        ],
        "title": "SetModuleIn",
        "type": "object"
      },
      "SubmissionIn": {
        "properties": {
          "beneficial_owners": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Beneficial Owners",
            "type": "array"
          },
          "custody_chain_links": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Custody Chain Links",
            "type": "array"
          },
          "etrcs": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Etrcs",
            "type": "array"
          },
          "security_positions": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Security Positions",
            "type": "array"
          },
          "submission_ref": {
            "title": "Submission Ref",
            "type": "string"
          }
        },
        "required": [
          "submission_ref"
        ],
        "title": "SubmissionIn",
        "type": "object"
      },
      "ValidateIn": {
        "properties": {
          "dividend_event_id": {
            "title": "Dividend Event Id",
            "type": "string"
          }
        },
        "required": [
          "dividend_event_id"
        ],
        "title": "ValidateIn",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "app__api__v1__annex2__GenerateIn": {
        "properties": {
          "channel": {
            "default": "direct",
            "title": "Channel",
            "type": "string"
          },
          "dividend_event_id": {
            "title": "Dividend Event Id",
            "type": "string"
          }
        },
        "required": [
          "dividend_event_id"
        ],
        "title": "GenerateIn",
        "type": "object"
      },
      "app__api__v1__reports__GenerateIn": {
        "properties": {
          "dividend_event_id": {
            "title": "Dividend Event Id",
            "type": "string"
          },
          "paying_agent_lei": {
            "title": "Paying Agent Lei",
            "type": "string"
          }
        },
        "required": [
          "dividend_event_id",
          "paying_agent_lei"
        ],
        "title": "GenerateIn",
        "type": "object"
      }
    }
  },
  "info": {
    "title": "ChainPipe",
    "version": "0.0.1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/analytics/summary": {
      "get": {
        "description": "Reports by saga state, reclaim pipeline by status/jurisdiction, billing.",
        "operationId": "summary_v1_analytics_summary_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Summary V1 Analytics Summary Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Summary",
        "tags": [
          "analytics"
        ]
      }
    },
    "/v1/annex2": {
      "get": {
        "operationId": "list_reports_v1_annex2_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Reports V1 Annex2 Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Reports",
        "tags": [
          "annex2"
        ]
      }
    },
    "/v1/annex2/generate": {
      "post": {
        "operationId": "generate_v1_annex2_generate_post",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__api__v1__annex2__GenerateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Generate V1 Annex2 Generate Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Generate",
        "tags": [
          "annex2"
        ]
      }
    },
    "/v1/annex2/{report_id}": {
      "get": {
        "operationId": "get_report_v1_annex2__report_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "report_id",
            "required": true,
            "schema": {
              "title": "Report Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Report V1 Annex2  Report Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Report",
        "tags": [
          "annex2"
        ]
      }
    },
    "/v1/annex2/{report_id}/xml": {
      "get": {
        "operationId": "report_xml_v1_annex2__report_id__xml_get",
        "parameters": [
          {
            "in": "path",
            "name": "report_id",
            "required": true,
            "schema": {
              "title": "Report Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Report Xml",
        "tags": [
          "annex2"
        ]
      }
    },
    "/v1/cfi": {
      "get": {
        "description": "Current CFI registration state incl. decision-window countdown.",
        "operationId": "cfi_status_v1_cfi_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Cfi Status V1 Cfi Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cfi Status",
        "tags": [
          "cfi"
        ]
      }
    },
    "/v1/cfi/alerts": {
      "get": {
        "description": "Counterparty CFI alerts for the calling institution (tenancy-scoped).",
        "operationId": "list_alerts_v1_cfi_alerts_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Alerts V1 Cfi Alerts Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Alerts",
        "tags": [
          "cfi"
        ]
      }
    },
    "/v1/cfi/register": {
      "post": {
        "operationId": "register_v1_cfi_register_post",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Register V1 Cfi Register Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register",
        "tags": [
          "cfi"
        ]
      }
    },
    "/v1/dividend-events": {
      "post": {
        "operationId": "create_event_v1_dividend_events_post",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DividendEventIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Create Event V1 Dividend Events Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Event",
        "tags": [
          "dividend-events"
        ]
      }
    },
    "/v1/dividend-events/{event_id}": {
      "get": {
        "operationId": "get_event_v1_dividend_events__event_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "event_id",
            "required": true,
            "schema": {
              "title": "Event Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Event V1 Dividend Events  Event Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Event",
        "tags": [
          "dividend-events"
        ]
      }
    },
    "/v1/dividend-events/{event_id}/sla": {
      "get": {
        "description": "FASTER quick-refund SLA for the event: deadline + days remaining + status.",
        "operationId": "event_sla_v1_dividend_events__event_id__sla_get",
        "parameters": [
          {
            "in": "path",
            "name": "event_id",
            "required": true,
            "schema": {
              "title": "Event Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Event Sla V1 Dividend Events  Event Id  Sla Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Event Sla",
        "tags": [
          "dividend-events"
        ]
      }
    },
    "/v1/etrc/coverage": {
      "get": {
        "description": "Per-BO eTRC coverage for a dividend event's record date (read-only).\n\nShows which beneficial owners have a usable (verified, in-window) eTRC\ncovering the record date \u2014 the relief-eligibility precondition \u2014 and why any\nare uncovered. Writes nothing.",
        "operationId": "etrc_coverage_v1_etrc_coverage_get",
        "parameters": [
          {
            "in": "query",
            "name": "dividend_event_id",
            "required": true,
            "schema": {
              "title": "Dividend Event Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Etrc Coverage V1 Etrc Coverage Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Etrc Coverage",
        "tags": [
          "etrc"
        ]
      }
    },
    "/v1/etrc/documents": {
      "get": {
        "description": "List all documents for the calling institution, with optional filters.",
        "operationId": "list_documents_v1_etrc_documents_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "document_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Document Type"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Documents V1 Etrc Documents Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Documents",
        "tags": [
          "etrc"
        ]
      },
      "post": {
        "description": "Upload an eTRC or supporting document (multipart/form-data).\n\nThe file bytes are not stored (MVP: only the SHA-256 hash and a storage ref\nare persisted; production wires this to S3 via app/storage/objects.py).",
        "operationId": "upload_document_v1_etrc_documents_post",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_document_v1_etrc_documents_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Upload Document V1 Etrc Documents Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Document",
        "tags": [
          "etrc"
        ]
      }
    },
    "/v1/etrc/documents/expiring": {
      "get": {
        "description": "Documents expiring within N days (default 30).",
        "operationId": "list_expiring_v1_etrc_documents_expiring_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Expiring V1 Etrc Documents Expiring Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Expiring",
        "tags": [
          "etrc"
        ]
      }
    },
    "/v1/etrc/documents/{doc_id}": {
      "get": {
        "description": "Fetch a single document (must belong to the calling institution).",
        "operationId": "get_document_v1_etrc_documents__doc_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Document V1 Etrc Documents  Doc Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Document",
        "tags": [
          "etrc"
        ]
      }
    },
    "/v1/etrc/documents/{doc_id}/reject": {
      "patch": {
        "description": "Ops: reject a document with a required reason.",
        "operationId": "reject_document_v1_etrc_documents__doc_id__reject_patch",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Reject Document V1 Etrc Documents  Doc Id  Reject Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reject Document",
        "tags": [
          "etrc"
        ]
      }
    },
    "/v1/etrc/documents/{doc_id}/verify": {
      "patch": {
        "description": "Ops: mark a document as verified.",
        "operationId": "verify_document_v1_etrc_documents__doc_id__verify_patch",
        "parameters": [
          {
            "in": "path",
            "name": "doc_id",
            "required": true,
            "schema": {
              "title": "Doc Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Verify Document V1 Etrc Documents  Doc Id  Verify Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify Document",
        "tags": [
          "etrc"
        ]
      }
    },
    "/v1/institutions": {
      "post": {
        "description": "Onboard an institution (a TaxReclaim ACCOUNT holder, not an end user).\n\nProvisions/looks-up the institution's TaxReclaim account and stores its user_id,\nso filed reclaims always have an owner. Mints an API key (shown once).",
        "operationId": "create_institution_v1_institutions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstitutionIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Create Institution V1 Institutions Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Institution",
        "tags": [
          "institutions"
        ]
      }
    },
    "/v1/institutions/{institution_id}/module": {
      "patch": {
        "description": "Set the capability module for an institution (ops action, no auth gate).",
        "operationId": "set_institution_module_v1_institutions__institution_id__module_patch",
        "parameters": [
          {
            "in": "path",
            "name": "institution_id",
            "required": true,
            "schema": {
              "title": "Institution Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetModuleIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Set Institution Module V1 Institutions  Institution Id  Module Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Institution Module",
        "tags": [
          "institutions"
        ]
      }
    },
    "/v1/liability/exposure": {
      "get": {
        "operationId": "liability_exposure_v1_liability_exposure_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Liability Exposure V1 Liability Exposure Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Liability Exposure",
        "tags": [
          "liability"
        ]
      }
    },
    "/v1/pricing": {
      "get": {
        "description": "The public subscription tier catalog (amounts in minor units).",
        "operationId": "list_plans_v1_pricing_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Plans V1 Pricing Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Plans",
        "tags": [
          "pricing"
        ]
      }
    },
    "/v1/pricing/quote": {
      "get": {
        "description": "Cost of *uuid_count* billable UUIDs under every tier + the cheapest fit.",
        "operationId": "quote_v1_pricing_quote_get",
        "parameters": [
          {
            "in": "query",
            "name": "uuid_count",
            "required": false,
            "schema": {
              "default": 0,
              "title": "Uuid Count",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Quote V1 Pricing Quote Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Quote",
        "tags": [
          "pricing"
        ]
      }
    },
    "/v1/reclaims": {
      "get": {
        "operationId": "list_reclaims_v1_reclaims_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Reclaims V1 Reclaims Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Reclaims",
        "tags": [
          "reclaims"
        ]
      }
    },
    "/v1/reclaims/{claim_id}/refund": {
      "post": {
        "operationId": "record_refund_v1_reclaims__claim_id__refund_post",
        "parameters": [
          {
            "in": "path",
            "name": "claim_id",
            "required": true,
            "schema": {
              "title": "Claim Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Record Refund V1 Reclaims  Claim Id  Refund Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Record Refund",
        "tags": [
          "reclaims"
        ]
      }
    },
    "/v1/relief-instructions": {
      "get": {
        "description": "FASTER relief-at-source instructions issued for the calling institution.",
        "operationId": "list_relief_instructions_v1_relief_instructions_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Relief Instructions V1 Relief Instructions Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Relief Instructions",
        "tags": [
          "faster"
        ]
      }
    },
    "/v1/reports/batch": {
      "post": {
        "description": "Pack all completed reports for the tenant into a KAFE envelope and submit to DIP.",
        "operationId": "submit_kafe_batch_v1_reports_batch_post",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Submit Kafe Batch V1 Reports Batch Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Kafe Batch",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/generate": {
      "post": {
        "operationId": "generate_v1_reports_generate_post",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__api__v1__reports__GenerateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Generate V1 Reports Generate Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Generate",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/validate": {
      "post": {
        "description": "Read-only explainable preflight: run every pre-report gate and accumulate.\n\nCreates NO report, mints NO uuid, writes NO audit row, and has NO idempotency.\nReturns a structured, human-readable artifact showing why a filing would\npass/fail and how the custody chain reconciles.",
        "operationId": "validate_v1_reports_validate_post",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Validate V1 Reports Validate Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Validate",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/{report_id}": {
      "get": {
        "operationId": "get_report_v1_reports__report_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "report_id",
            "required": true,
            "schema": {
              "title": "Report Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Report V1 Reports  Report Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Report",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/{report_id}/correct": {
      "post": {
        "description": "Generate a correction report: mint correction UUIDs, supersede originals.",
        "operationId": "correct_v1_reports__report_id__correct_post",
        "parameters": [
          {
            "in": "path",
            "name": "report_id",
            "required": true,
            "schema": {
              "title": "Report Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/CorrectIn"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Correct V1 Reports  Report Id  Correct Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Correct",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/{report_id}/status": {
      "get": {
        "description": "Client-facing filing status + audit timeline for one report (read-only).\n\nTenant-scoped: returns 404 when the report is missing or owned by another\ninstitution. Writes nothing.",
        "operationId": "report_status_v1_reports__report_id__status_get",
        "parameters": [
          {
            "in": "path",
            "name": "report_id",
            "required": true,
            "schema": {
              "title": "Report Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Report Status V1 Reports  Report Id  Status Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Report Status",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/{report_id}/validate": {
      "post": {
        "description": "Re-run the explainable preflight against a PERSISTED report (read-only).\n\nSame gates and artifact as ``POST /reports/validate``, keyed on the report\nrather than the event \u2014 so a client holding a report id can re-check a filing\n(e.g. after correcting a beneficial owner) without tracking the event id.\nCreates NO report, mints NO uuid, writes NO audit row, and has NO idempotency.",
        "operationId": "validate_report_v1_reports__report_id__validate_post",
        "parameters": [
          {
            "in": "path",
            "name": "report_id",
            "required": true,
            "schema": {
              "title": "Report Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Validate Report V1 Reports  Report Id  Validate Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Validate Report",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/reports/{report_id}/xml": {
      "get": {
        "description": "Download the rendered MiKaDiv FM XML for one report (read-only).\n\nThe report row carries only ``xml_payload_ref``; the bytes live in object\nstorage (``app.storage.objects``). Tenant-scoped like ``/status``. Returns 409\nwhile the report has not yet rendered XML (pre-``generating_xml``, or rejected\nat an earlier gate).",
        "operationId": "report_xml_v1_reports__report_id__xml_get",
        "parameters": [
          {
            "in": "path",
            "name": "report_id",
            "required": true,
            "schema": {
              "title": "Report Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Report Xml",
        "tags": [
          "reports"
        ]
      }
    },
    "/v1/self-declarations": {
      "get": {
        "description": "List the calling institution's self-declarations, with optional filters.",
        "operationId": "list_declarations_v1_self_declarations_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "beneficial_owner_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Beneficial Owner Id"
            }
          },
          {
            "in": "query",
            "name": "year",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Year"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Declarations V1 Self Declarations Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Declarations",
        "tags": [
          "self-declarations"
        ]
      },
      "post": {
        "description": "Submit (or resubmit \u2014 idempotent per BO+year) a self-declaration.\n\nDiscrepancy detection runs at ingest: mismatches vs the stored BO KYC data\nand any verified eTRC park the declaration in ``discrepancy`` (which blocks\nfast-track relief) instead of ``valid``.",
        "operationId": "submit_declaration_v1_self_declarations_post",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelfDeclarationIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Submit Declaration V1 Self Declarations Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Submit Declaration",
        "tags": [
          "self-declarations"
        ]
      }
    },
    "/v1/self-declarations/expiring": {
      "get": {
        "description": "Valid declarations whose calendar-year validity ends within N days.\n\nA declaration for year Y expires on Dec 31 of Y (mirrors\n``/etrc/documents/expiring``).",
        "operationId": "list_expiring_v1_self_declarations_expiring_get",
        "parameters": [
          {
            "in": "query",
            "name": "days",
            "required": false,
            "schema": {
              "default": 30,
              "title": "Days",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response List Expiring V1 Self Declarations Expiring Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Expiring",
        "tags": [
          "self-declarations"
        ]
      }
    },
    "/v1/self-declarations/{decl_id}": {
      "get": {
        "description": "Fetch a single declaration (must belong to the calling institution).",
        "operationId": "get_declaration_v1_self_declarations__decl_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "decl_id",
            "required": true,
            "schema": {
              "title": "Decl Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Declaration V1 Self Declarations  Decl Id  Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Declaration",
        "tags": [
          "self-declarations"
        ]
      }
    },
    "/v1/self-declarations/{decl_id}/resolve": {
      "patch": {
        "description": "Ops: resolve a discrepant declaration back to ``valid`` with a note.",
        "operationId": "resolve_declaration_v1_self_declarations__decl_id__resolve_patch",
        "parameters": [
          {
            "in": "path",
            "name": "decl_id",
            "required": true,
            "schema": {
              "title": "Decl Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Resolve Declaration V1 Self Declarations  Decl Id  Resolve Patch",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Resolve Declaration",
        "tags": [
          "self-declarations"
        ]
      }
    },
    "/v1/submissions": {
      "post": {
        "description": "Validate, then UPSERT BO / position / chain / eTRC docs for the calling tenant.\n\nUpsert (on natural keys) makes resubmission idempotent and lets corrections reflect\namended data instead of duplicating records. Digital eTRCs are verified at ingest.",
        "operationId": "create_submission_v1_submissions_post",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmissionIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Create Submission V1 Submissions Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Submission",
        "tags": [
          "submissions"
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "get_usage_v1_usage_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Usage V1 Usage Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Usage",
        "tags": [
          "usage"
        ]
      }
    },
    "/v1/usage/billing-summary": {
      "get": {
        "description": "Project the tenant's billable UUID usage against every pricing tier.\n\nRead-only: counts the institution's metered usage events and quotes each\npublic tier so the client sees, transparently, which plan fits.",
        "operationId": "billing_summary_v1_usage_billing_summary_get",
        "parameters": [
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Billing Summary V1 Usage Billing Summary Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Billing Summary",
        "tags": [
          "usage"
        ]
      }
    },
    "/v1/uuids": {
      "get": {
        "description": "Serve the active UUID for a (beneficial owner, dividend event).",
        "operationId": "get_uuid_v1_uuids_get",
        "parameters": [
          {
            "in": "query",
            "name": "beneficial_owner_id",
            "required": true,
            "schema": {
              "title": "Beneficial Owner Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "dividend_event_id",
            "required": true,
            "schema": {
              "title": "Dividend Event Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-api-key",
            "required": false,
            "schema": {
              "default": "",
              "title": "X-Api-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Get Uuid V1 Uuids Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Uuid",
        "tags": [
          "uuids"
        ]
      }
    }
  }
}
