{
  "openapi": "3.1.0",
  "info": {
    "title": "MARCO Public API",
    "version": "1.1.0-public-truth-1.0.0",
    "description": "Public read-only JSON endpoints for the MARCO Portal + Public Truth surfaces (holders, roadmap, tokenomics, widget). Same canonical source as HTML pages."
  },
  "tags": [
    {
      "name": "MARCO Public Truth",
      "description": "Live holder metrics, Epoch roadmap, tokenomics, widget."
    },
    {
      "name": "MARCO Internal",
      "description": "Secret-authenticated internal operational endpoints."
    }
  ],
  "components": {
    "schemas": {
      "marco-token-reference": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-token-reference.json",
        "title": "marco-token-reference",
        "type": "object",
        "required": [
          "chain_id",
          "contract_address",
          "registry_version",
          "source"
        ],
        "properties": {
          "chain_id": {
            "type": [
              "integer",
              "null"
            ],
            "const": 56,
            "description": "BNB Smart Chain Mainnet"
          },
          "contract_address": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "contract_address_checksum": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "registry_version": {
            "type": "string"
          },
          "source": {
            "enum": [
              "environment",
              "registry",
              "none"
            ]
          },
          "status": {
            "enum": [
              "OK",
              "AWAITING_CANONICAL_TOKEN_SOURCE",
              "INVALID_CONTRACT_FORMAT",
              "UNSUPPORTED_CHAIN",
              "CONTRACT_SOURCE_CONFLICT"
            ]
          }
        },
        "additionalProperties": true,
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-metric": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-metric.json",
        "title": "marco-metric",
        "oneOf": [
          {
            "$ref": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-holder-metric.json"
          },
          {
            "type": "object",
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "enum": [
                  "LIVE",
                  "PLANNED",
                  "NOT_DEFINED",
                  "UNAVAILABLE"
                ]
              },
              "value": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "observed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "provenance": {
                "type": "string"
              }
            }
          }
        ],
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-metric-source": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-metric-source.json",
        "title": "marco-metric-source",
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "provenance": {
            "type": "string"
          },
          "observed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "provider_observation_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "response_hash": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-metrics-response": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-metrics-response.json",
        "title": "marco-metrics-response",
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "schema_version",
              "readings"
            ],
            "properties": {
              "schema_version": {
                "type": "string"
              },
              "data_version": {
                "type": "string"
              },
              "authority": {
                "type": "object"
              },
              "readings": {
                "type": "object"
              }
            }
          },
          "meta": {
            "type": "object"
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-holder-metric": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-holder-metric.json",
        "title": "marco-holder-metric",
        "type": "object",
        "required": [
          "status",
          "value",
          "provider"
        ],
        "properties": {
          "metric_id": {
            "const": "ON_CHAIN_HOLDERS"
          },
          "status": {
            "enum": [
              "LIVE",
              "STALE",
              "DEGRADED",
              "UNAVAILABLE"
            ]
          },
          "value": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "chain_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "contract_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider": {
            "type": "string"
          },
          "observed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "stored_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "age_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "freshness_state": {
            "enum": [
              "FRESH",
              "CACHED",
              "STALE",
              "DEGRADED",
              "NONE"
            ]
          },
          "fresh_seconds_remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cache_hit": {
            "type": "boolean"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "token_source_status": {
            "type": "string"
          },
          "provenance": {
            "type": "string"
          },
          "deltas": {
            "type": "array",
            "items": {
              "$ref": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-holder-growth-delta.json"
            }
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-holder-snapshot": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-holder-snapshot.json",
        "title": "marco-holder-snapshot",
        "type": "object",
        "required": [
          "chain_id",
          "contract_address",
          "holder_count",
          "provider",
          "observed_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "chain_id": {
            "type": "integer",
            "const": 56
          },
          "contract_address": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "holder_count": {
            "type": "integer",
            "minimum": 0
          },
          "provider": {
            "type": "string"
          },
          "provider_observation_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "stored_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "enum": [
              "LIVE"
            ]
          },
          "response_hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": "object"
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-holder-growth-delta": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-holder-growth-delta.json",
        "title": "marco-holder-growth-delta",
        "type": "object",
        "required": [
          "window",
          "status"
        ],
        "properties": {
          "window": {
            "enum": [
              "24h",
              "7d",
              "30d"
            ]
          },
          "status": {
            "enum": [
              "AVAILABLE",
              "INSUFFICIENT_HISTORY",
              "DEGRADED",
              "UNAVAILABLE"
            ]
          },
          "absolute_change": {
            "type": [
              "integer",
              "null"
            ]
          },
          "percentage_change": {
            "type": [
              "number",
              "null"
            ]
          },
          "baseline_value": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "current_value": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "baseline_observed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "current_observed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "baseline_age_difference_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "tolerance_window_seconds": {
            "type": "integer",
            "minimum": 0
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-passport-metrics": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-passport-metrics.json",
        "title": "marco-passport-metrics",
        "type": "object",
        "properties": {
          "status": {
            "enum": [
              "LIVE",
              "UNAVAILABLE"
            ]
          },
          "passports_issued": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "active_public": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "active_private": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "observed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subject_distribution": {
            "type": "object"
          },
          "subject_classification_note": {
            "type": "string"
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-roadmap-epoch": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-roadmap-epoch.json",
        "title": "marco-roadmap-epoch",
        "type": "object",
        "required": [
          "epoch_id",
          "status",
          "title"
        ],
        "properties": {
          "epoch_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "intent": {
            "type": "string"
          },
          "status": {
            "enum": [
              "FOUNDATION_ACTIVE",
              "IN_PROGRESS",
              "PLANNED",
              "PAUSED",
              "COMPLETE"
            ]
          },
          "evidence_required": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-roadmap-evidence.json"
            }
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-roadmap-response": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-roadmap-response.json",
        "title": "marco-roadmap-response",
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "north_star": {
                "type": "string"
              },
              "epochs": {
                "type": "array",
                "items": {
                  "$ref": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-roadmap-epoch.json"
                }
              }
            }
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-roadmap-evidence": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-roadmap-evidence.json",
        "title": "marco-roadmap-evidence",
        "type": "object",
        "required": [
          "kind",
          "status"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "status": {
            "enum": [
              "PRESENT",
              "MISSING",
              "PENDING"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-tokenomics-direction": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-tokenomics-direction.json",
        "title": "marco-tokenomics-direction",
        "type": "object",
        "properties": {
          "marco_role": {
            "type": "string"
          },
          "m_credits_role": {
            "type": "string"
          },
          "reserve_release_rule": {
            "type": "string"
          },
          "reserves": {
            "type": "array",
            "items": {
              "$ref": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-reserve-purpose.json"
            }
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-reserve-purpose": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-reserve-purpose.json",
        "title": "marco-reserve-purpose",
        "type": "object",
        "required": [
          "id",
          "purpose",
          "allocation_status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "allocation_status": {
            "enum": [
              "NOT_YET_FROZEN",
              "UNDER_ANALYSIS",
              "FROZEN"
            ]
          },
          "amount_percent": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-holder-widget-config": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-holder-widget-config.json",
        "title": "marco-holder-widget-config",
        "type": "object",
        "properties": {
          "variant": {
            "enum": [
              "compact",
              "badge",
              "card"
            ]
          },
          "theme": {
            "enum": [
              "dark",
              "light",
              "auto"
            ]
          },
          "locale": {
            "enum": [
              "en",
              "it"
            ]
          },
          "show_source": {
            "type": "boolean"
          },
          "show_updated": {
            "type": "boolean"
          },
          "show_passports": {
            "type": "boolean"
          },
          "link": {
            "type": "boolean"
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-holder-widget-status": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-holder-widget-status.json",
        "title": "marco-holder-widget-status",
        "type": "object",
        "properties": {
          "display_status": {
            "enum": [
              "LIVE",
              "STALE",
              "DEGRADED",
              "UNAVAILABLE",
              "LOADING"
            ]
          },
          "rendered_value": {
            "type": [
              "string",
              "null"
            ]
          },
          "observed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-public-truth-health": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-public-truth-health.json",
        "title": "marco-public-truth-health",
        "type": "object",
        "properties": {
          "canonical_token_configured": {
            "type": "boolean"
          },
          "holder_provider_configured": {
            "type": "boolean"
          },
          "holder_provider_healthy": {
            "type": "boolean"
          },
          "holder_metric_live": {
            "type": "boolean"
          },
          "holder_cache_healthy": {
            "type": "boolean"
          },
          "snapshot_storage_healthy": {
            "type": "boolean"
          },
          "snapshot_scheduler_active": {
            "type": "boolean"
          },
          "historical_deltas_available": {
            "type": "boolean"
          },
          "holder_widget_implemented": {
            "type": "boolean"
          },
          "holder_widget_certified": {
            "type": "boolean"
          },
          "formal_schemas_published": {
            "type": "boolean"
          },
          "openapi_current": {
            "type": "boolean"
          },
          "external_ci_configured": {
            "type": "boolean"
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-public-truth-provenance": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-public-truth-provenance.json",
        "title": "marco-public-truth-provenance",
        "type": "object",
        "properties": {
          "authority": {
            "type": "object"
          },
          "freshness_policy": {
            "type": "object"
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      },
      "marco-public-truth-error": {
        "$id": "https://marco.melega.ai/schemas/marco-public-truth/v1/marco-public-truth-error.json",
        "title": "marco-public-truth-error",
        "type": "object",
        "required": [
          "ok",
          "error_code"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error_code": {
            "type": "string"
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "$schema": "https://json-schema.org/draft/2020-12/schema"
      }
    },
    "securitySchemes": {
      "MarcoSnapshotIngestSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "x-marco-snapshot-secret",
        "description": "Shared secret required by /api/internal/marco/holder-snapshot."
      }
    }
  },
  "paths": {
    "/api/public/marco/metrics": {
      "get": {
        "summary": "Aggregated MARCO metrics (holders + Passport aggregates + deltas).",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-metrics-response"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/holders": {
      "get": {
        "summary": "Live MARCO on-chain holder count.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-holder-metric"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/passport-metrics": {
      "get": {
        "summary": "Passport Core aggregates (issued / public / private).",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-passport-metrics"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/metrics/version": {
      "get": {
        "summary": "Metrics schema + data version.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/metrics/provenance": {
      "get": {
        "summary": "Metrics authority, freshness, environment hints.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-public-truth-provenance"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/schemas": {
      "get": {
        "summary": "MARCO Public Truth JSON Schemas index.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/schemas/{schemaId}": {
      "get": {
        "summary": "MARCO Public Truth JSON Schema by id.",
        "tags": [
          "MARCO Public Truth"
        ],
        "parameters": [
          {
            "name": "schemaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-public-truth-error"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/roadmap": {
      "get": {
        "summary": "Public MARCO Epoch roadmap.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-roadmap-response"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/roadmap/{epoch_id}": {
      "get": {
        "summary": "Roadmap Epoch detail.",
        "tags": [
          "MARCO Public Truth"
        ],
        "parameters": [
          {
            "name": "epoch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-roadmap-epoch"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/roadmap/version": {
      "get": {
        "summary": "Roadmap version.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/roadmap/provenance": {
      "get": {
        "summary": "Roadmap gating rules.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/tokenomics": {
      "get": {
        "summary": "MARCO Tokenomics 2.0 direction.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-tokenomics-direction"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/tokenomics/version": {
      "get": {
        "summary": "Tokenomics version.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/marco/tokenomics/provenance": {
      "get": {
        "summary": "Tokenomics authority + disclosure policy.",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/internal/marco/holder-snapshot": {
      "post": {
        "summary": "Internal MARCO holder snapshot ingestion (secret-authenticated).",
        "tags": [
          "MARCO Internal"
        ],
        "security": [
          {
            "MarcoSnapshotIngestSecret": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-public-truth-error"
                }
              }
            }
          },
          "409": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-public-truth-error"
                }
              }
            }
          },
          "503": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/marco-public-truth-error"
                }
              }
            }
          }
        }
      }
    },
    "/widgets/marco-holder-pulse.v1.js": {
      "get": {
        "summary": "MARCO Holder Pulse embeddable widget (Custom Element, Shadow DOM).",
        "tags": [
          "MARCO Public Truth"
        ],
        "responses": {
          "200": {
            "description": "JavaScript source",
            "content": {
              "application/javascript": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/pay/session": {
      "post": {
        "summary": "MARCO Pay — signed merchant-server session initialization (HMAC-SHA256, NOT browser-safe). Headers: marco-application, marco-timestamp, marco-signature over v1.<ts>.<raw body>. Unsigned callers are refused.",
        "tags": [
          "MARCO Pay"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/pay/state": {
      "post": {
        "summary": "MARCO Pay — safe public state. application_ref + payment_id are both required; no cross-application probing.",
        "tags": [
          "MARCO Pay"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/mcredits/order/authorize": {
      "post": {
        "summary": "M-Credits — customer spend authorization minted from the customer's own MARCO Passport session. Order-bound, amount-capped, short-lived, one-time. Browser-safe.",
        "tags": [
          "M-Credits"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/mcredits/order/reserve": {
      "post": {
        "summary": "M-Credits — reserve. Requires BOTH the merchant HMAC signature AND the customer authorization. A raw passport number never authorizes a spend. Expired reservations recover automatically, exactly once.",
        "tags": [
          "M-Credits"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/features": {
      "get": {
        "summary": "Feature registry",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/token": {
      "get": {
        "summary": "Token information",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/utility": {
      "get": {
        "summary": "Utility registry",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/handbook": {
      "get": {
        "summary": "Handbook structure",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/capabilities": {
      "get": {
        "summary": "Portal capabilities",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/version": {
      "get": {
        "summary": "Portal version",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/provenance": {
      "get": {
        "summary": "Data provenance & authority boundaries",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/status": {
      "get": {
        "summary": "Portal status summary",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/health": {
      "get": {
        "summary": "Liveness/readiness",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passport-core": {
      "get": {
        "summary": "MARCO Passport Core Protocol",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passport-core/openapi": {
      "get": {
        "summary": "Passport Core Protocol — OpenAPI 3.1",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passport-core/schemas": {
      "get": {
        "summary": "Passport Core Protocol — JSON Schemas",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passport-core/wallets": {
      "get": {
        "summary": "Wallet Binding Engine registry",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passport-core/handles": {
      "get": {
        "summary": "Handle Registry Engine",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passport-core/handles/check": {
      "get": {
        "summary": "Handle availability check",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passport-core/handles/history/{handle}": {
      "get": {
        "summary": "Handle history",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passports/{publicId}": {
      "get": {
        "summary": "Public MARCO Passport by public id",
        "parameters": [
          {
            "name": "publicId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "410": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passports/by-handle/{handle}": {
      "get": {
        "summary": "Public MARCO Passport by handle (with historical redirects)",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "410": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/passports/{publicId}/machine": {
      "get": {
        "summary": "Machine representation of a public Passport",
        "parameters": [
          {
            "name": "publicId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}