{
  "openapi": "3.1.0",
  "info": {
    "title": "IDIA Protocol API",
    "version": "1.3.0",
    "description": "Enterprise reference for fourteen operations, reviewed against Hub 7c30baa8 on November 7, 2026. Source review is not production deployment or independent security verification. Includes paid hourly feature sessions, resumable SSE, sandbox, receipts and signed webhook payloads."
  },
  "servers": [
    {
      "url": "https://zxyngqciipcvveigrzqt.supabase.co/functions/v1/protocol-api",
      "description": "Production"
    }
  ],
  "security": [
    {
      "IdiaKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "IdiaKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      },
      "HubSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "Signed-in Hub Supabase session; accepted only on feature routes."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "trace_id"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object"
              },
              "resolution_url": {
                "type": "string",
                "format": "uri"
              },
              "trace_id": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "error"
        ]
      },
      "Service": {
        "type": "object",
        "properties": {
          "provisioned": {
            "type": "boolean"
          },
          "rate_cr": {
            "type": "number"
          },
          "organization_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "organization_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Wallet": {
        "type": "object",
        "properties": {
          "synapse_credits_available": {
            "type": "number"
          },
          "currency": {
            "const": "CRD"
          }
        }
      },
      "RateCard": {
        "type": "object",
        "properties": {
          "provisioned": {
            "type": "boolean"
          },
          "rate_cr": {
            "type": "number"
          },
          "unit": {
            "enum": [
              "authorized_target",
              "batch"
            ]
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "enum": [
                "receipt.anchored_l2",
                "wallet.credit_depleted",
                "telemetry.spatial_event"
              ]
            }
          },
          "credit_threshold": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookEvent": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ReceiptAnchoredEvent"
          },
          {
            "$ref": "#/components/schemas/CreditDepletedEvent"
          },
          {
            "$ref": "#/components/schemas/TelemetrySpatialEvent"
          },
          {
            "$ref": "#/components/schemas/WebhookTestEvent"
          }
        ],
        "description": "Signed envelope. SSE feature.batch_ready is a separate transport, not a subscribable webhook event."
      },
      "Receipt": {
        "type": "object",
        "properties": {
          "liability_receipt_id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "enum": [
              "ledger_recorded",
              "anchored_l2"
            ]
          },
          "payment_status": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "enterprise_tenant_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "masked_guid": {
            "type": "string"
          },
          "synapse_credits_charged": {
            "type": "number"
          },
          "blockchain_proof": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "network": {
                "const": "base_mainnet"
              },
              "aca_hash": {
                "type": "string"
              }
            },
            "description": "Null until an ACA hash is recorded. No transaction hash or Basescan URL is returned."
          }
        },
        "required": [
          "liability_receipt_id",
          "status",
          "payment_status",
          "timestamp",
          "enterprise_tenant_id",
          "masked_guid",
          "synapse_credits_charged",
          "blockchain_proof"
        ]
      },
      "ReceiptList": {
        "type": "object",
        "required": [
          "object",
          "data",
          "pagination",
          "order",
          "bulk_audit"
        ],
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Receipt"
            }
          },
          "pagination": {
            "type": "object",
            "required": [
              "limit",
              "returned_count",
              "has_more",
              "next_cursor",
              "prev_cursor"
            ],
            "properties": {
              "limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "returned_count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "has_more": {
                "type": "boolean",
                "description": "Older pages exist, even when navigating newer with ending_before."
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Pass as starting_after for older rows."
              },
              "prev_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Pass as ending_before for newer rows."
              }
            }
          },
          "order": {
            "const": "timestamp_desc"
          },
          "bulk_audit": {
            "type": "object",
            "required": [
              "hub_export",
              "on_chain"
            ],
            "properties": {
              "hub_export": {
                "type": "string",
                "format": "uri",
                "const": "https://hub.thebigidia.com/saved-activity"
              },
              "on_chain": {
                "type": "string"
              }
            }
          }
        }
      },
      "FeaturePayload": {
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "topic": {
            "enum": [
              "vault_health_sync",
              "vault_financial_ledger",
              "vault_identity_stream"
            ]
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "metrics": {
            "type": "object",
            "additionalProperties": true
          },
          "provenance": {
            "type": "object",
            "properties": {
              "source": {
                "enum": [
                  "staged_health_data",
                  "synapse_credit_ledger",
                  "egress_logs"
                ]
              },
              "status": {
                "const": "source_aggregate"
              },
              "on_chain_proof": {
                "type": "null"
              },
              "contains_personal_identifiers": {
                "const": false
              }
            }
          }
        }
      },
      "FeaturePacket": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "integer",
              "string"
            ],
            "description": "Keep as a decimal string in consumers to avoid integer precision loss."
          },
          "payload": {
            "$ref": "#/components/schemas/FeaturePayload"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "payload",
          "created_at"
        ]
      },
      "FeatureSession": {
        "type": "object",
        "properties": {
          "status": {
            "const": "active"
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "credits_charged": {
            "type": "number",
            "enum": [
              5,
              15,
              50
            ]
          },
          "reused": {
            "type": "boolean"
          },
          "topic": {
            "enum": [
              "vault_health_sync",
              "vault_financial_ledger",
              "vault_identity_stream"
            ]
          },
          "currency": {
            "const": "CRD"
          },
          "billing_unit": {
            "const": "topic_hour"
          },
          "auto_renew": {
            "const": false
          }
        },
        "required": [
          "status",
          "session_id",
          "expires_at",
          "credits_charged",
          "reused",
          "topic",
          "currency",
          "billing_unit",
          "auto_renew"
        ]
      },
      "FeatureLatest": {
        "type": "object",
        "properties": {
          "topic": {
            "enum": [
              "vault_health_sync",
              "vault_financial_ledger",
              "vault_identity_stream"
            ]
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "packets": {
            "type": "array",
            "maxItems": 1,
            "items": {
              "$ref": "#/components/schemas/FeaturePacket"
            }
          }
        },
        "required": [
          "topic",
          "session_id",
          "expires_at",
          "packets"
        ]
      },
      "FeatureSandbox": {
        "type": "object",
        "properties": {
          "environment": {
            "const": "sandbox"
          },
          "sandbox_mode": {
            "const": true
          },
          "topic": {
            "enum": [
              "vault_health_sync",
              "vault_financial_ledger",
              "vault_identity_stream"
            ]
          },
          "packets": {
            "type": "array",
            "maxItems": 0
          },
          "billing": {
            "type": "object",
            "properties": {
              "synapse_credits_deducted": {
                "const": 0
              }
            }
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "environment",
          "sandbox_mode",
          "topic",
          "packets",
          "billing",
          "note"
        ]
      },
      "VultureQuarantine": {
        "type": "object",
        "properties": {
          "status": {
            "const": "quarantined"
          },
          "reason_code": {
            "type": "string"
          },
          "raw_hash": {
            "type": "string"
          },
          "trace_id": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "reason_code",
          "raw_hash",
          "trace_id"
        ]
      },
      "VultureProof": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "hash_algorithm": {
            "const": "sha256"
          },
          "tree_rules": {
            "type": "string"
          },
          "merkle_root": {
            "type": "string"
          },
          "leaf_index": {
            "type": "integer"
          },
          "leaf_count": {
            "type": "integer"
          },
          "leaf_hash": {
            "type": "string"
          },
          "sibling_hashes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "position": {
                  "enum": [
                    "left",
                    "right"
                  ]
                },
                "hash": {
                  "type": "string"
                }
              },
              "required": [
                "position",
                "hash"
              ]
            }
          },
          "l2_anchor": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "network": {
                "const": "base_mainnet"
              },
              "transaction_hash": {
                "type": "string"
              },
              "block_number": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "explorer_url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "ReceiptAnchoredEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "const": "receipt.anchored_l2"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "properties": {
              "liability_receipt_id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "const": "anchored_l2"
              },
              "blockchain_proof": {
                "type": "object",
                "properties": {
                  "network": {
                    "const": "base_mainnet"
                  },
                  "aca_hash": {
                    "type": "string"
                  }
                }
              }
            },
            "required": [
              "liability_receipt_id",
              "status",
              "blockchain_proof"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "data"
        ]
      },
      "CreditDepletedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "const": "wallet.credit_depleted"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "properties": {
              "synapse_credits_available": {
                "type": "number"
              },
              "threshold": {
                "type": "number"
              },
              "currency": {
                "const": "CRD"
              }
            },
            "required": [
              "synapse_credits_available",
              "threshold",
              "currency"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "data"
        ]
      },
      "TelemetrySpatialEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "const": "telemetry.spatial_event"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "properties": {
              "batch_id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "const": "sanitized_and_anchored"
              },
              "records_processed": {
                "type": "integer"
              },
              "sanitized_hash": {
                "type": "string"
              },
              "l2_anchor": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "network": {
                    "const": "base_mainnet"
                  },
                  "transaction_hash": {
                    "type": "string"
                  },
                  "anchored_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "explorer_url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            },
            "required": [
              "batch_id",
              "status",
              "records_processed",
              "sanitized_hash",
              "l2_anchor"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "data"
        ]
      },
      "WebhookTestEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "const": "webhook.test"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "properties": {
              "webhook_id": {
                "type": "string",
                "format": "uuid"
              },
              "message": {
                "const": "Test delivery from the IDIA Protocol API."
              }
            },
            "required": [
              "webhook_id",
              "message"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "data"
        ]
      }
    },
    "responses": {
      "Error": {
        "description": "Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "X-RateLimit-Limit": {
            "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
            "schema": {
              "type": "integer",
              "const": 120
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Remaining requests in the current window.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          "X-RateLimit-Reset": {
            "description": "Window end, Unix timestamp in seconds.",
            "schema": {
              "type": "integer"
            }
          }
        }
      }
    },
    "parameters": {
      "Environment": {
        "name": "X-IDIA-Environment",
        "in": "header",
        "required": false,
        "description": "sandbox affects validation, ingestion and features. Feature sandbox returns JSON empty packets, even for stream, and never starts a paid session. Other reads remain real; webhook operations remain mutating.",
        "schema": {
          "type": "string",
          "enum": [
            "production",
            "sandbox"
          ],
          "default": "production"
        }
      }
    }
  },
  "paths": {
    "/v1/auth/provision-status": {
      "get": {
        "summary": "Provisioned services, rate and credit balance",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "services": {
                      "type": "object",
                      "properties": {
                        "identity_verification": {
                          "$ref": "#/components/schemas/Service"
                        },
                        "vulture": {
                          "$ref": "#/components/schemas/Service"
                        }
                      }
                    },
                    "wallet": {
                      "type": "object",
                      "properties": {
                        "synapse_credits_available": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_v1_auth_provision_status",
        "tags": [
          "Foundation"
        ]
      }
    },
    "/v1/utility/validate": {
      "post": {
        "summary": "Default-deny consent check for hashed targets",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "$ref": "#/components/parameters/Environment"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "target_type",
                  "targets"
                ],
                "properties": {
                  "campaign_id": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "target_type": {
                    "enum": [
                      "hashed_ip",
                      "hashed_maid",
                      "hashed_email",
                      "hashed_phone",
                      "hashed_identifier"
                    ]
                  },
                  "hash_algorithm": {
                    "const": "sha256"
                  },
                  "targets": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1000,
                    "items": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Production consent results or sandbox denied results; sandbox does not query the Identity Vault or issue receipts",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "const": "success"
                        },
                        "meta": {
                          "type": "object",
                          "properties": {
                            "total_targets": {
                              "type": "integer"
                            },
                            "opted_in": {
                              "type": "integer"
                            },
                            "opted_out_default_deny": {
                              "type": "integer"
                            }
                          }
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "rate_per_target": {
                              "type": "number"
                            },
                            "synapse_credits_deducted": {
                              "type": "number"
                            },
                            "remaining_balance": {
                              "type": "number"
                            }
                          }
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "target_hash": {
                                "type": "string"
                              },
                              "consent_status": {
                                "enum": [
                                  "authorized",
                                  "denied"
                                ]
                              },
                              "guid": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "liability_receipt_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "uuid"
                              }
                            }
                          }
                        }
                      },
                      "not": {
                        "required": [
                          "sandbox_mode"
                        ]
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "const": "success"
                        },
                        "environment": {
                          "const": "sandbox"
                        },
                        "sandbox_mode": {
                          "const": true
                        },
                        "meta": {
                          "type": "object",
                          "properties": {
                            "total_targets": {
                              "type": "integer"
                            },
                            "opted_in": {
                              "const": 0
                            },
                            "opted_out_default_deny": {
                              "type": "integer"
                            }
                          }
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "rate_per_target": {
                              "type": "number"
                            },
                            "synapse_credits_deducted": {
                              "const": 0
                            },
                            "remaining_balance": {
                              "type": "number"
                            },
                            "would_cost_if_all_authorized": {
                              "type": "number"
                            }
                          }
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "target_hash": {
                                "type": "string"
                              },
                              "consent_status": {
                                "const": "denied"
                              },
                              "guid": {
                                "type": "null"
                              },
                              "liability_receipt_id": {
                                "type": "null"
                              }
                            }
                          }
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_v1_utility_validate",
        "tags": [
          "Foundation"
        ]
      }
    },
    "/v1/utility/receipts/{liability_receipt_id}": {
      "get": {
        "summary": "Liability Receipt under the Liability Shield",
        "parameters": [
          {
            "name": "liability_receipt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_v1_utility_receipts_liability_receipt_id",
        "tags": [
          "Receipts"
        ]
      }
    },
    "/v1/vulture/ingest": {
      "post": {
        "summary": "Send records through The Vulture",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payload"
                ],
                "properties": {
                  "dataset_name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "compliance_framework": {
                    "enum": [
                      "standard",
                      "cjis_strict"
                    ]
                  },
                  "payload": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 500,
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Production commit or sandbox request validation (no ledger sanitization, billing or Base anchor)",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "const": "accepted_for_sanitization"
                        },
                        "batch_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "records_committed": {
                          "type": "integer"
                        },
                        "sanitized_hash": {
                          "type": "string"
                        },
                        "cjis_isolated": {
                          "type": "boolean"
                        },
                        "billing": {
                          "type": "object"
                        },
                        "verification_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "trace_id": {
                          "type": "string"
                        }
                      },
                      "not": {
                        "required": [
                          "sandbox_mode"
                        ]
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "const": "accepted_for_sanitization"
                        },
                        "environment": {
                          "const": "sandbox"
                        },
                        "sandbox_mode": {
                          "const": true
                        },
                        "batch_id": {
                          "type": "null"
                        },
                        "verification_url": {
                          "type": "null"
                        },
                        "records_committed": {
                          "const": 0
                        },
                        "records_validated": {
                          "type": "integer"
                        },
                        "raw_hash": {
                          "type": "string"
                        },
                        "cjis_isolated": {
                          "type": "boolean"
                        },
                        "billing": {
                          "type": "object",
                          "properties": {
                            "rate_cr": {
                              "type": "number"
                            },
                            "synapse_credits_deducted": {
                              "const": 0
                            },
                            "status": {
                              "const": "sandbox_not_billed"
                            }
                          }
                        },
                        "trace_id": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "description": "Quarantined",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VultureQuarantine"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/Error",
            "description": "Forwarded ingest_rejected, not a dedicated Gateway sealed error code."
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/Environment"
          }
        ],
        "operationId": "post_v1_vulture_ingest",
        "tags": [
          "Vulture"
        ]
      }
    },
    "/v1/vulture/verify/{batch_id}": {
      "get": {
        "summary": "Merkle inclusion proof and Base anchor",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batch_id": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "staged_for_notarization",
                        "anchoring_in_progress",
                        "sanitized_and_anchored"
                      ]
                    },
                    "sanitization_report": {
                      "type": "object"
                    },
                    "ingested_at": {
                      "type": "string"
                    },
                    "cryptographic_proof": {
                      "$ref": "#/components/schemas/VultureProof"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "get_v1_vulture_verify_batch_id",
        "tags": [
          "Vulture"
        ]
      }
    },
    "/v1/billing/balance": {
      "get": {
        "summary": "Read wallet, organization and provisioned rate cards",
        "responses": {
          "200": {
            "description": "Balance rounded to four decimals; no credit deduction",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "wallet": {
                      "$ref": "#/components/schemas/Wallet"
                    },
                    "organization": {
                      "type": "object",
                      "properties": {
                        "organization_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "organization_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "rate_cards": {
                      "type": "object",
                      "properties": {
                        "identity_verification": {
                          "$ref": "#/components/schemas/RateCard"
                        },
                        "vulture": {
                          "$ref": "#/components/schemas/RateCard"
                        }
                      }
                    },
                    "as_of": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_v1_billing_balance",
        "tags": [
          "Foundation"
        ]
      }
    },
    "/v1/webhooks": {
      "post": {
        "summary": "Register an HTTPS receiver (maximum 10 active per account)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048,
                    "pattern": "^https://"
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "enum": [
                        "receipt.anchored_l2",
                        "wallet.credit_depleted",
                        "telemetry.spatial_event"
                      ]
                    }
                  },
                  "credit_threshold": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "events": {
                          "contains": {
                            "const": "wallet.credit_depleted"
                          }
                        }
                      },
                      "required": [
                        "events"
                      ]
                    },
                    "then": {
                      "required": [
                        "credit_threshold"
                      ],
                      "properties": {
                        "credit_threshold": {
                          "type": "number",
                          "minimum": 0
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Secret shown once",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "webhook": {
                      "$ref": "#/components/schemas/Webhook"
                    },
                    "signing_secret": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_v1_webhooks",
        "tags": [
          "Webhooks"
        ]
      },
      "get": {
        "summary": "List owned active receivers (no signing secrets)",
        "responses": {
          "200": {
            "description": "Active receivers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get_v1_webhooks",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "summary": "Disable an owned active receiver",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "deleted": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "delete_v1_webhooks_id",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/test": {
      "post": {
        "summary": "Send direct signed tests to one or all active receivers; not queued for retries",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect delivered; API success does not imply receiver success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "webhook_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "delivered": {
                            "type": "boolean"
                          },
                          "response_status": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "post_v1_webhooks_test",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/utility/receipts": {
      "get": {
        "operationId": "get_v1_utility_receipts",
        "summary": "List owned receipt history with deterministic keyset cursors",
        "description": "Identity Verification key only; restricted to extractor_id matching the key owner. Read-only, no credit debit. Newest first (created_at DESC, id DESC). Use starting_after or ending_before, not both. No cursor alias, audit_sources, basescan_url or transaction hash. Keep filters unchanged; this is not an immutable snapshot. Source reviewed at Hub commit 5c560ca5; deployment not independently tested.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Omitted or empty uses 50; otherwise integer 1\u2013100."
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque Base64url next_cursor for strictly older (created_at, id) rows; mutually exclusive with ending_before."
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque prev_cursor for strictly newer rows, returned newest first; mutually exclusive with starting_after."
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Inclusive timestamp lower bound."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Exclusive timestamp upper bound."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "anchored_l2",
                "ledger_recorded"
              ]
            },
            "description": "Filters by ACA hash presence."
          }
        ],
        "responses": {
          "200": {
            "description": "Receipt list, including empty pages with nullable cursors",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiptList"
                },
                "example": {
                  "object": "list",
                  "data": [],
                  "pagination": {
                    "limit": 50,
                    "returned_count": 0,
                    "has_more": false,
                    "next_cursor": null,
                    "prev_cursor": null
                  },
                  "order": "timestamp_desc",
                  "bulk_audit": {
                    "hub_export": "https://hub.thebigidia.com/saved-activity",
                    "on_chain": "Anchored receipts carry an ACA hash recorded on Base mainnet; reconcile via Base event logs."
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_limit, invalid_cursor (malformed or both directions), invalid_date, invalid_status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "Receipts"
        ]
      }
    },
    "/v1/features/sessions": {
      "post": {
        "operationId": "post_v1_features_sessions",
        "summary": "Start or reuse a paid one-hour topic session",
        "description": "Active API key or signed-in Hub bearer session. Sessions charge 5/15/50 CR according to active tier; reused unexpired sessions do not debit again or extend expiry. latest/stream require an active production session. No auto-renew. Health counts suppressed below ten contributors; owner financial/identity aggregates are tenant scoped. Source aggregates carry no on-chain proof.",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "vault_health_sync",
                "vault_financial_ledger",
                "vault_identity_stream"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Environment"
          }
        ],
        "responses": {
          "200": {
            "description": "Production session/read, or zero-debit sandbox JSON; sandbox never starts sessions or returns production packets.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FeatureSession"
                    },
                    {
                      "$ref": "#/components/schemas/FeatureSandbox"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "IdiaKey": []
          },
          {
            "HubSession": []
          }
        ],
        "tags": [
          "Features"
        ]
      }
    },
    "/v1/features/latest": {
      "get": {
        "operationId": "get_v1_features_latest",
        "summary": "Read latest source aggregate packet",
        "description": "Active API key or signed-in Hub bearer session. Sessions charge 5/15/50 CR according to active tier; reused unexpired sessions do not debit again or extend expiry. latest/stream require an active production session. No auto-renew. Health counts suppressed below ten contributors; owner financial/identity aggregates are tenant scoped. Source aggregates carry no on-chain proof.",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "vault_health_sync",
                "vault_financial_ledger",
                "vault_identity_stream"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Environment"
          }
        ],
        "responses": {
          "200": {
            "description": "Production session/read, or zero-debit sandbox JSON; sandbox never starts sessions or returns production packets.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FeatureLatest"
                    },
                    {
                      "$ref": "#/components/schemas/FeatureSandbox"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "IdiaKey": []
          },
          {
            "HubSession": []
          }
        ],
        "tags": [
          "Features"
        ]
      }
    },
    "/v1/features/stream": {
      "get": {
        "operationId": "get_v1_features_stream",
        "summary": "Read resumable finite SSE stream",
        "description": "Active API key or signed-in Hub bearer session. Sessions charge 5/15/50 CR according to active tier; reused unexpired sessions do not debit again or extend expiry. latest/stream require an active production session. No auto-renew. Health counts suppressed below ten contributors; owner financial/identity aggregates are tenant scoped. Source aggregates carry no on-chain proof.",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "vault_health_sync",
                "vault_financial_ledger",
                "vault_identity_stream"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,17})$"
            },
            "description": "Preferred replay boundary; overrides cursor."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]{0,17})$"
            },
            "description": "Decimal packet ID, not receipt-history cursor."
          }
        ],
        "responses": {
          "200": {
            "description": "Production session/read, or zero-debit sandbox JSON; sandbox never starts sessions or returns production packets.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-IDIA-Session-Expires": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                },
                "description": "Production session expiry. Window closes within 45 seconds; auth/session rechecked every 10 seconds."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeatureSandbox"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "retry: 3000\n: connected\n\nid: 1\nevent: feature.batch_ready\ndata: {\"schema_version\":\"1.0\"}\n\n"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "description": "rate_limit_exceeded: details includes limit (120), retry_after seconds and reset_at (ISO-8601)",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "120 requests per key per fixed 60-second window. Omitted if limiter lookup fails.",
                "schema": {
                  "type": "integer",
                  "const": 120
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Remaining requests in the current window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Window end, Unix timestamp in seconds.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retry",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "IdiaKey": []
          },
          {
            "HubSession": []
          }
        ],
        "tags": [
          "Features"
        ]
      }
    }
  },
  "webhooks": {
    "idiaEvent": {
      "post": {
        "summary": "Receive an IDIA signed event",
        "description": "HMAC-SHA256 over timestamp + dot + exact raw body. Ten-second sender timeout, five total queued attempts; retry gaps 5/30/120/360 minutes. Direct test sends are not queued.",
        "parameters": [
          {
            "name": "X-IDIA-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<Unix seconds>,v1=<64 hex HMAC>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Receiver accepted; durable processing and event deduplication are receiver responsibilities."
          }
        }
      }
    }
  }
}
