{
  "openapi": "3.1.0",
  "info": {
    "title": "evidence_extractor_api",
    "description": "",
    "license": {
      "name": "NONE",
      "identifier": "NONE"
    },
    "version": "0.1.0"
  },
  "paths": {
    "/extract": {
      "post": {
        "tags": [
          "evidence"
        ],
        "description": "Extract evidence for a proposal against an evidence schema",
        "operationId": "evidence/extract",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtractEvidenceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Evidence that complies with the given schema for the proposed solution.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InputMap"
                },
                "example": {
                  "price_usd_cents": 18732,
                  "symbol": "AAPL",
                  "trade_date": "2026-04-20"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EvidenceFieldType": {
        "type": "object",
        "required": [
          "ty"
        ],
        "properties": {
          "ty": {
            "$ref": "#/components/schemas/Type"
          }
        }
      },
      "EvidenceSchema": {
        "type": "object",
        "required": [
          "fields"
        ],
        "properties": {
          "fields": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/EvidenceFieldType"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ExtractEvidenceRequest": {
        "type": "object",
        "required": [
          "evidence_schema",
          "proposal"
        ],
        "properties": {
          "evidence_schema": {
            "$ref": "#/components/schemas/EvidenceSchema"
          },
          "proposal": {
            "$ref": "#/components/schemas/Proposal"
          }
        }
      },
      "InputMap": {
        "type": "object",
        "description": "Runtime input container, as defined in docs/API.md section 2.",
        "required": [
          "fields"
        ],
        "properties": {
          "fields": {
            "type": "object",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "IntentId": {
        "type": "string",
        "format": "uuid",
        "description": "Unique identifier for an intent, assigned by the caller."
      },
      "Proposal": {
        "type": "object",
        "description": "An agent's proposed solution for a specific intent.\n\nOnce submitted, the Orchestrator fetches the URL and runs ZK proof generation to\nverify the proposal satisfies the intent's template constraints.",
        "required": [
          "intent_id",
          "url"
        ],
        "properties": {
          "intent_id": {
            "$ref": "#/components/schemas/IntentId",
            "description": "The ID of the intent this proposal targets."
          },
          "url": {
            "type": "string",
            "description": "URL pointing to the proposed solution payload that the Orchestrator will fetch\nand verify."
          }
        }
      },
      "Type": {
        "type": "string",
        "description": "The set of types in the policy template language.",
        "enum": [
          "Bool",
          "Int",
          "String",
          "Date",
          "IntSet",
          "StringSet",
          "DateSet"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "evidence",
      "description": "Remote evidence extraction"
    }
  ]
}